Skip to content

Commit

Permalink
Merge r176154 - Network process crash when running http/tests/appcach…
Browse files Browse the repository at this point in the history
…e/fallback.html

https://bugs.webkit.org/show_bug.cgi?id=138740

Reviewed by Alexey Proskuryakov.

It happens because ResourceHandle::continueWillSendRequest() is
called with a null request. We could handle that case in the
ResourceHandle, but the thing is tha the behaviour is
not the same for async loads, or when loading in the web
process. In WebResourceLoader::willSendRequest(),
ResourceRequest::willSendRequest() is called, and cancels the load
if the client returns a null request. In this case, the
ResourceLoader is detached and WebResourceLoader::willSendRequest()
returns early without sending the ContinueWillSendRequest message
to the network process. However, for synchronous loads,
NetworkResourceLoader::continueWillSendRequest() is always called.

Fixes http/tests/appcache/fallback.html for GTK port when using
the network process.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest): Do not
call ResourceHandle::continueWillSendRequest() if the client
request is null, since the load is going to be cancelled.
  • Loading branch information
carlosgcampos committed Jan 5, 2015
1 parent d7fa522 commit 89588c3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
27 changes: 27 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,30 @@
2014-11-15 Carlos Garcia Campos <cgarcia@igalia.com>

Network process crash when running http/tests/appcache/fallback.html
https://bugs.webkit.org/show_bug.cgi?id=138740

Reviewed by Alexey Proskuryakov.

It happens because ResourceHandle::continueWillSendRequest() is
called with a null request. We could handle that case in the
ResourceHandle, but the thing is tha the behaviour is
not the same for async loads, or when loading in the web
process. In WebResourceLoader::willSendRequest(),
ResourceRequest::willSendRequest() is called, and cancels the load
if the client returns a null request. In this case, the
ResourceLoader is detached and WebResourceLoader::willSendRequest()
returns early without sending the ContinueWillSendRequest message
to the network process. However, for synchronous loads,
NetworkResourceLoader::continueWillSendRequest() is always called.

Fixes http/tests/appcache/fallback.html for GTK port when using
the network process.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest): Do not
call ResourceHandle::continueWillSendRequest() if the client
request is null, since the load is going to be cancelled.

2014-11-06 Alberto Garcia <berto@igalia.com>

[GTK] [Stable] webkitgtk 2.6.1 fails to load flashplugin
Expand Down
5 changes: 3 additions & 2 deletions Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Expand Up @@ -255,12 +255,13 @@ void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest& newRe
m_request = m_suggestedRequestForWillSendRequest;
m_suggestedRequestForWillSendRequest = ResourceRequest();

m_handle->continueWillSendRequest(m_request);

if (m_request.isNull()) {
m_handle->cancel();
didFail(m_handle.get(), cancelledError(m_request));
return;
}

m_handle->continueWillSendRequest(m_request);
}

void NetworkResourceLoader::continueDidReceiveResponse()
Expand Down

0 comments on commit 89588c3

Please sign in to comment.