Crash when trying to register a custom scheme before network process has been launched
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2014 10:06:16 +0000 (10:06 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2014 10:06:16 +0000 (10:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126385

Reviewed by Anders Carlsson.

WebContext::registerSchemeForCustomProtocol() uses
sendToNetworkingProcess() to send the message to the appropriate
networking process. In the case of using web process,
sendToNetworkingProcess() first checks if there's already a web
process, doing nothing otherwise, but when using the network
process it assumes there's already a network process. In both
cases it's safe to do nothing, because the schemes will be passed
as creation parameters to the process when launched.

* UIProcess/WebContext.h:
(WebKit::WebContext::sendToNetworkingProcess):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebContext.h

index 53f6b03..cf5d041 100644 (file)
@@ -1,3 +1,22 @@
+2014-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Crash when trying to register a custom scheme before network process has been launched
+        https://bugs.webkit.org/show_bug.cgi?id=126385
+
+        Reviewed by Anders Carlsson.
+
+        WebContext::registerSchemeForCustomProtocol() uses
+        sendToNetworkingProcess() to send the message to the appropriate
+        networking process. In the case of using web process,
+        sendToNetworkingProcess() first checks if there's already a web
+        process, doing nothing otherwise, but when using the network
+        process it assumes there's already a network process. In both
+        cases it's safe to do nothing, because the schemes will be passed
+        as creation parameters to the process when launched.
+
+        * UIProcess/WebContext.h:
+        (WebKit::WebContext::sendToNetworkingProcess):
+
 2014-01-07  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         WebKit2 EFL build fix after r161387
index 3e6dc19..6960cdd 100644 (file)
@@ -512,7 +512,7 @@ void WebContext::sendToNetworkingProcess(T&& message)
     case ProcessModelSharedSecondaryProcess:
 #if ENABLE(NETWORK_PROCESS)
         if (m_usesNetworkProcess) {
-            if (m_networkProcess->canSendMessage())
+            if (m_networkProcess && m_networkProcess->canSendMessage())
                 m_networkProcess->send(std::forward<T>(message), 0);
             return;
         }
@@ -522,7 +522,7 @@ void WebContext::sendToNetworkingProcess(T&& message)
         return;
     case ProcessModelMultipleSecondaryProcesses:
 #if ENABLE(NETWORK_PROCESS)
-        if (m_networkProcess->canSendMessage())
+        if (m_networkProcess && m_networkProcess->canSendMessage())
             m_networkProcess->send(std::forward<T>(message), 0);
         return;
 #else