diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/child_thread.cc | 6 | ||||
-rw-r--r-- | chrome/common/child_thread.h | 2 | ||||
-rw-r--r-- | chrome/common/message_router.cc | 6 | ||||
-rw-r--r-- | chrome/common/message_router.h | 2 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 46 | ||||
-rw-r--r-- | chrome/common/resource_dispatcher.cc | 5 |
6 files changed, 42 insertions, 25 deletions
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index e973554..5d61738 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -95,6 +95,12 @@ void ChildThread::RemoveRoute(int32 routing_id) { router_.RemoveRoute(routing_id); } +IPC::Channel::Listener* ChildThread::ResolveRoute(int32 routing_id) { + DCHECK(MessageLoop::current() == message_loop()); + + return router_.ResolveRoute(routing_id); +} + webkit_glue::ResourceLoaderBridge* ChildThread::CreateBridge( const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info, int host_renderer_id, diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h index c731b45..2b55417 100644 --- a/chrome/common/child_thread.h +++ b/chrome/common/child_thread.h @@ -32,6 +32,8 @@ class ChildThread : public IPC::Channel::Listener, void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); void RemoveRoute(int32 routing_id); + IPC::Channel::Listener* ResolveRoute(int32 routing_id); + // Creates a ResourceLoaderBridge. // Tests can override this method if they want a custom loading behavior. virtual webkit_glue::ResourceLoaderBridge* CreateBridge( diff --git a/chrome/common/message_router.cc b/chrome/common/message_router.cc index 4b0703e..b73f2d0 100644 --- a/chrome/common/message_router.cc +++ b/chrome/common/message_router.cc @@ -33,10 +33,14 @@ void MessageRouter::OnMessageReceived(const IPC::Message& msg) { } bool MessageRouter::RouteMessage(const IPC::Message& msg) { - IPC::Channel::Listener* listener = routes_.Lookup(msg.routing_id()); + IPC::Channel::Listener* listener = ResolveRoute(msg.routing_id()); if (!listener) return false; listener->OnMessageReceived(msg); return true; } + +IPC::Channel::Listener* MessageRouter::ResolveRoute(int32 routing_id) { + return routes_.Lookup(routing_id); +} diff --git a/chrome/common/message_router.h b/chrome/common/message_router.h index 45fc03a..35d2a5d 100644 --- a/chrome/common/message_router.h +++ b/chrome/common/message_router.h @@ -50,6 +50,8 @@ class MessageRouter : public IPC::Channel::Listener, void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); void RemoveRoute(int32 routing_id); + IPC::Channel::Listener* ResolveRoute(int32 routing_id); + private: // A list of all listeners with assigned routing IDs. IDMap<IPC::Channel::Listener> routes_; diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index eeba87e..208a280 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -1112,18 +1112,20 @@ IPC_BEGIN_MESSAGES(ViewHost) GURL /* first_party_for_cookies */, std::string /* cookie */) - // Used to get cookies for the given URL - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_GetCookies, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::string /* cookies */) + // Used to get cookies for the given URL. This may be blocked by a user + // prompt to validate a previous SetCookie message. + IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookies */) - // Used to get raw cookie information for the given URL - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_GetRawCookies, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::vector<webkit_glue::WebCookie> - /* raw_cookies */) + // Used to get raw cookie information for the given URL. This may be blocked + // by a user prompt to validate a previous SetCookie message. + IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetRawCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::vector<webkit_glue::WebCookie> + /* raw_cookies */) // Used to delete cookie for the given URL and name IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie, @@ -1458,10 +1460,10 @@ IPC_BEGIN_MESSAGES(ViewHost) // by javascript. This step is about showing UI to the user to select the // final print settings. The output parameter is the same as // ViewMsg_PrintPages which is executed implicitly. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ScriptedPrint, - ViewHostMsg_ScriptedPrint_Params, - ViewMsg_PrintPages_Params /* settings choosen by - the user*/) + IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_ScriptedPrint, + ViewHostMsg_ScriptedPrint_Params, + ViewMsg_PrintPages_Params + /* settings choosen by the user*/) #endif // defined(OS_WIN) || defined(OS_MACOSX) // WebKit and JavaScript error messages to log to the console @@ -1981,13 +1983,13 @@ IPC_BEGIN_MESSAGES(ViewHost) NullableString16 /* value */) // Set a value that's associated with a key in a storage area. - IPC_SYNC_MESSAGE_CONTROL4_2(ViewHostMsg_DOMStorageSetItem, - int64 /* storage_area_id */, - string16 /* key */, - string16 /* value */, - GURL /* url */, - WebKit::WebStorageArea::Result /* result */, - NullableString16 /* old_value */) + IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_DOMStorageSetItem, + int64 /* storage_area_id */, + string16 /* key */, + string16 /* value */, + GURL /* url */, + WebKit::WebStorageArea::Result /* result */, + NullableString16 /* old_value */) // Remove the value associated with a key in a storage area. IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_DOMStorageRemoveItem, diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index 7cbb2a8..de1c239 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -223,8 +223,9 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { request_id_ = MakeRequestID(); SyncLoadResult result; - IPC::Message* msg = new ViewHostMsg_SyncLoad(routing_id_, request_id_, - request_, &result); + IPC::SyncMessage* msg = new ViewHostMsg_SyncLoad(routing_id_, request_id_, + request_, &result); + msg->EnableMessagePumping(); if (!dispatcher_->message_sender()->Send(msg)) { response->status.set_status(URLRequestStatus::FAILED); return; |