[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jberlin at webkit.org jberlin at webkit.org
Wed Dec 22 15:04:22 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 18be5b81cb252dc077b0ca550f85a373cf8cf939
Author: jberlin at webkit.org <jberlin at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 27 20:38:36 2010 +0000

    Fix the WebKit2 API tests.
    https://bugs.webkit.org/show_bug.cgi?id=48461
    
    Reviewed by Sam Weinig.
    
    The API tests were failing because the tests expect to be able to send messages before the
    WebProcess finishes launching.
    
    Instead of dispatching the pending messages in processDidFinishLaunching, dispatch them in
    ensureWebProcess but do not make messages pending if the process is launching.
    
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::processDidFinishLaunching):
    Move dispatching the pending messages back from here ...
    (WebKit::WebContext::ensureWebProcess):
    ... to here.
    (WebKit::WebContext::postMessageToInjectedBundle):
    Check whether the process can send messages in order to determine if a message needs to be
    sent later.
    
    * UIProcess/WebProcessProxy.h:
    (WebKit::WebProcessProxy::canSendMessage):
    The WebProcessProxy can send a message if it is valid or if it is launching.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70702 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index a5e587e..7c029b2 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,29 @@
+2010-10-27  Jessie Berlin  <jberlin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fix the WebKit2 API tests.
+        https://bugs.webkit.org/show_bug.cgi?id=48461
+
+        The API tests were failing because the tests expect to be able to send messages before the
+        WebProcess finishes launching.
+
+        Instead of dispatching the pending messages in processDidFinishLaunching, dispatch them in
+        ensureWebProcess but do not make messages pending if the process is launching.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::processDidFinishLaunching):
+        Move dispatching the pending messages back from here ...
+        (WebKit::WebContext::ensureWebProcess):
+        ... to here.
+        (WebKit::WebContext::postMessageToInjectedBundle):
+        Check whether the process can send messages in order to determine if a message needs to be
+        sent later.
+
+        * UIProcess/WebProcessProxy.h:
+        (WebKit::WebProcessProxy::canSendMessage):
+        The WebProcessProxy can send a message if it is valid or if it is launching.
+
 2010-10-27  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 5547098..7044c2f 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -178,6 +178,12 @@ 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)
@@ -186,12 +192,6 @@ 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)
@@ -260,7 +260,7 @@ void WebContext::preferencesDidChange()
 
 void WebContext::postMessageToInjectedBundle(const String& messageName, APIObject* messageBody)
 {
-    if (!hasValidProcess()) {
+    if (!m_process || !m_process->canSendMessage()) {
         m_pendingMessagesToPostToInjectedBundle.append(make_pair(messageName, messageBody));
         return;
     }
diff --git a/WebKit2/UIProcess/WebProcessProxy.h b/WebKit2/UIProcess/WebProcessProxy.h
index ff8abd0..0e9f322 100644
--- a/WebKit2/UIProcess/WebProcessProxy.h
+++ b/WebKit2/UIProcess/WebProcessProxy.h
@@ -90,6 +90,7 @@ public:
 
     bool isValid() const { return m_connection; }
     bool isLaunching() const;
+    bool canSendMessage() const { return isValid() || isLaunching(); }
 
     WebFrameProxy* webFrame(uint64_t) const;
     void frameCreated(uint64_t, WebFrameProxy*);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list