Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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):

Canonical link: https://commits.webkit.org/144465@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Jan 7, 2014
1 parent def9c4a commit cb66de1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/WebContext.h
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit cb66de1

Please sign in to comment.