Post any pending messages to the Injected Bundle in WebContext::processDidFinishLaunching
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Oct 2010 20:46:27 +0000 (20:46 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Oct 2010 20:46:27 +0000 (20:46 +0000)
instead of in WebContext::ensureWebProcess.
https://bugs.webkit.org/show_bug.cgi?id=48367

Reviewed by Darin Adler.

Send pending injected bundle messages after the process finished launching instead of of
directly after creating it.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::ensureWebProcess):
Move the logic to dispatch pending injected bundle messages from here ...
(WebKit::WebContext::processDidFinishLaunching):
... to here.
Also use a reference instead of a pointer when sending the pending messages.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit2/ChangeLog
WebKit2/UIProcess/WebContext.cpp

index a5e8b4d..557374b 100644 (file)
@@ -1,3 +1,21 @@
+2010-10-26  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Post any pending messages to the Injected Bundle in WebContext::processDidFinishLaunching
+        instead of in WebContext::ensureWebProcess.
+        https://bugs.webkit.org/show_bug.cgi?id=48367
+
+        Send pending injected bundle messages after the process finished launching instead of of
+        directly after creating it.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::ensureWebProcess):
+        Move the logic to dispatch pending injected bundle messages from here ...
+        (WebKit::WebContext::processDidFinishLaunching):
+        ... to here.
+        Also use a reference instead of a pointer when sending the pending messages.
+
 2010-10-26  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index 0b87c21..86ca6f4 100644 (file)
@@ -178,12 +178,6 @@ void WebContext::ensureWebProcess()
     platformInitializeWebProcess(parameters);
 
     m_process->send(Messages::WebProcess::InitializeWebProcess(parameters), 0);
-
-    for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
-        pair<String, RefPtr<APIObject> >* message = &m_pendingMessagesToPostToInjectedBundle[i];
-        m_process->send(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(message->first, WebContextUserMessageEncoder(message->second.get())));
-    }
-    m_pendingMessagesToPostToInjectedBundle.clear();
 }
 
 void WebContext::processDidFinishLaunching(WebProcessProxy* process)
@@ -192,6 +186,12 @@ void WebContext::processDidFinishLaunching(WebProcessProxy* process)
     ASSERT(process == m_process);
 
     m_visitedLinkProvider.populateVisitedLinksIfNeeded();
+
+    for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
+        pair<String, RefPtr<APIObject> >& message = m_pendingMessagesToPostToInjectedBundle[i];
+        m_process->send(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(message.first, WebContextUserMessageEncoder(message.second.get())));
+    }
+    m_pendingMessagesToPostToInjectedBundle.clear();
 }
 
 void WebContext::processDidClose(WebProcessProxy* process)