Changeset 143050 in webkit
- Timestamp:
- Feb 15, 2013 2:01:04 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r143038 r143050 1 2013-02-15 Anders Carlsson <andersca@apple.com> 2 3 Add a synchronous GetValues message to StorageManager 4 https://bugs.webkit.org/show_bug.cgi?id=109968 5 6 Reviewed by Sam Weinig. 7 8 * Platform/CoreIPC/Connection.cpp: 9 (CoreIPC::Connection::dispatchWorkQueueMessageReceiverMessage): 10 Handle synchronous messages. 11 12 (CoreIPC::Connection::processIncomingMessage): 13 Check for work queue message receivers before doing any other processing. 14 15 * UIProcess/Storage/StorageManager.cpp: 16 (WebKit::StorageManager::getValues): 17 Add empty stub. 18 19 * UIProcess/Storage/StorageManager.h: 20 * UIProcess/Storage/StorageManager.messages.in: 21 Add GetValues message. 22 23 * WebProcess/Storage/StorageAreaProxy.cpp: 24 (WebKit::StorageAreaProxy::loadValuesIfNeeded): 25 Send the GetValues message. 26 1 27 2013-02-15 Anders Carlsson <andersca@apple.com> 2 28 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r142792 r143050 286 286 OwnPtr<MessageDecoder> decoder = adoptPtr(incomingMessageDecoder); 287 287 288 // FIXME: Handle sync messages. 289 ASSERT(!decoder->isSyncMessage()); 290 291 workQueueMessageReceiver->didReceiveMessage(this, *decoder); 288 if (!decoder->isSyncMessage()) { 289 workQueueMessageReceiver->didReceiveMessage(this, *decoder); 290 return; 291 } 292 293 uint64_t syncRequestID = 0; 294 if (!decoder->decode(syncRequestID) || !syncRequestID) { 295 // We received an invalid sync message. 296 // FIXME: Handle this. 297 decoder->markInvalid(); 298 return; 299 } 300 301 OwnPtr<MessageEncoder> replyEncoder = MessageEncoder::create("IPC", "SyncMessageReply", syncRequestID); 302 303 // Hand off both the decoder and encoder to the work queue message receiver. 304 workQueueMessageReceiver->didReceiveSyncMessage(this, *decoder, replyEncoder); 305 306 // FIXME: If the message was invalid, we should send back a SyncMessageError. 307 ASSERT(!decoder->isInvalid()); 308 309 if (replyEncoder) 310 sendSyncReply(replyEncoder.release()); 292 311 } 293 312 … … 594 613 } 595 614 615 // Check if any work queue message receivers are interested in this message. 616 HashMap<StringReference, std::pair<RefPtr<WorkQueue>, RefPtr<WorkQueueMessageReceiver> > >::const_iterator it = m_workQueueMessageReceivers.find(message->messageReceiverName()); 617 if (it != m_workQueueMessageReceivers.end()) { 618 it->value.first->dispatch(bind(&Connection::dispatchWorkQueueMessageReceiverMessage, this, it->value.second, message.release().leakPtr())); 619 return; 620 } 621 596 622 // Check if this is a sync message or if it's a message that should be dispatched even when waiting for 597 623 // a sync reply. If it is, and we're waiting for a sync reply this message needs to be dispatched. … … 614 640 } 615 641 616 // Check if any work queue message receivers are interested in this message.617 HashMap<StringReference, std::pair<RefPtr<WorkQueue>, RefPtr<WorkQueueMessageReceiver> > >::const_iterator it = m_workQueueMessageReceivers.find(message->messageReceiverName());618 if (it != m_workQueueMessageReceivers.end()) {619 it->value.first->dispatch(bind(&Connection::dispatchWorkQueueMessageReceiverMessage, this, it->value.second, message.release().leakPtr()));620 return;621 }622 623 642 enqueueIncomingMessage(message.release()); 624 643 } -
trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp
r142781 r143050 67 67 } 68 68 69 void StorageManager::getValues(uint64_t, HashMap<String, String>&) 70 { 71 // FIXME: Implement this. 72 } 73 69 74 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h
r142781 r143050 30 30 #include <wtf/PassRefPtr.h> 31 31 #include <wtf/ThreadSafeRefCounted.h> 32 #include <wtf/text/StringHash.h> 32 33 33 34 class WorkQueue; … … 51 52 // CoreIPC::Connection::WorkQueueMessageReceiver. 52 53 virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE; 54 virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder) OVERRIDE; 53 55 54 56 // Message handlers. 55 57 void createStorageArea(uint64_t storageAreaID, uint64_t storageNamespaceID, const SecurityOriginData&); 56 58 void destroyStorageArea(uint64_t storageAreaID); 59 void getValues(uint64_t storageAreaID, HashMap<String, String>& values); 57 60 58 61 RefPtr<WorkQueue> m_queue; -
trunk/Source/WebKit2/UIProcess/Storage/StorageManager.messages.in
r142781 r143050 24 24 CreateStorageArea(uint64_t storageAreaID, uint64_t storageNamespaceID, WebKit::SecurityOriginData securityOriginData) 25 25 DestroyStorageArea(uint64_t storageAreaID) 26 27 GetValues(uint64_t storageAreaID) -> (WTF::HashMap<WTF::String, WTF::String> values) 26 28 } -
trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp
r143038 r143050 75 75 76 76 loadValuesIfNeeded(); 77 78 77 return m_values->size(); 79 78 } … … 161 160 return; 162 161 163 // FIXME: Actually load the values. 164 m_values = adoptPtr(new HashMap<String, String>()); 162 HashMap<String, String> values; 163 // FIXME: This should use a special sendSync flag to indicate that we don't want to process incoming messages while waiting for a reply. 164 // (This flag does not yet exist). 165 WebProcess::shared().connection()->sendSync(Messages::StorageManager::GetValues(m_storageAreaID), Messages::StorageManager::GetValues::Reply(values), 0); 166 167 // FIXME: Don't copy the hash map. 168 m_values = adoptPtr(new HashMap<String, String>(values)); 165 169 } 166 170
Note: See TracChangeset
for help on using the changeset viewer.