Modified: trunk/Source/WebKit2/ChangeLog (132547 => 132548)
--- trunk/Source/WebKit2/ChangeLog 2012-10-26 00:49:31 UTC (rev 132547)
+++ trunk/Source/WebKit2/ChangeLog 2012-10-26 01:02:52 UTC (rev 132548)
@@ -1,3 +1,25 @@
+2012-10-25 Byungwoo Lee <[email protected]>
+
+ [WK2] Use per destination ID message receivers for DownloadProxy.
+ https://bugs.webkit.org/show_bug.cgi?id=100342
+
+ Reviewed by Anders Carlsson.
+
+ Per destination ID message receivers were proposed in r132386.
+ IPC messages of DownloadProxy use download ID for destination ID,
+ so the messages should be handled by the messsage receiver that was
+ newly proposed.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::WebContext):
+ (WebKit::WebContext::createDownloadProxy):
+ (WebKit::WebContext::downloadFinished):
+ (WebKit::WebContext::addMessageReceiver):
+ (WebKit):
+ (WebKit::WebContext::removeMessageReceiver):
+ * UIProcess/WebContext.h:
+ (WebContext):
+
2012-10-25 Christophe Dumez <[email protected]>
[EFL][WK2] Add Ewk_Popup_Menu API
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (132547 => 132548)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-10-26 00:49:31 UTC (rev 132547)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-10-26 01:02:52 UTC (rev 132548)
@@ -136,7 +136,6 @@
#endif
{
addMessageReceiver(Messages::WebContext::messageReceiverName(), this);
- addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), this);
addMessageReceiver(CoreIPC::MessageKindTraits<WebContextLegacyMessage::Kind>::messageReceiverName(), this);
// NOTE: These sub-objects must be initialized after m_messageReceiverMap..
@@ -762,6 +761,7 @@
{
RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
m_downloads.set(downloadProxy->downloadID(), downloadProxy);
+ addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID(), this);
return downloadProxy.get();
}
@@ -770,6 +770,7 @@
ASSERT(m_downloads.contains(downloadProxy->downloadID()));
downloadProxy->invalidate();
+ removeMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID());
m_downloads.remove(downloadProxy->downloadID());
}
@@ -790,6 +791,16 @@
m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
}
+void WebContext::addMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID, CoreIPC::MessageReceiver* messageReceiver)
+{
+ m_messageReceiverMap.addMessageReceiver(messageReceiverName, destinationID, messageReceiver);
+}
+
+void WebContext::removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID)
+{
+ m_messageReceiverMap.removeMessageReceiver(messageReceiverName, destinationID);
+}
+
bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
return m_messageReceiverMap.dispatchMessage(connection, messageID, decoder);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (132547 => 132548)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2012-10-26 00:49:31 UTC (rev 132547)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2012-10-26 01:02:52 UTC (rev 132548)
@@ -87,6 +87,9 @@
static const Vector<WebContext*>& allContexts();
void addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver*);
+ void addMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID, CoreIPC::MessageReceiver*);
+ void removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID);
+
bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);