Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GTK] Crash in WebProcess when loading large content with custom URI …
…schemes https://bugs.webkit.org/show_bug.cgi?id=144262 Reviewed by Carlos Garcia Campos. Source/WebKit2: Properly handle scenarios where errors happen after reading the first chunk of data coming from the GInputStream provided by the application. * UIProcess/API/gtk/WebKitWebContextPrivate.h: * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextIsLoadingCustomProtocol): New, checks whether a load is still in progress, after the startLoading method has been called. * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): Early return if the stream has been cancelled on finish_error, so that we make sure we don't keep on reading the GInputStream after that point. (webkit_uri_scheme_request_finish_error): Don't send a didFailWithError message to the Network process if the load is not longer in progress. * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: (WebKit::CustomProtocolManagerImpl::didFailWithError): Handle the case where an error is notified from the UI process after the first chunk has been read. (WebKit::CustomProtocolManagerImpl::didReceiveResponse): Handle the case where data might no longer be available if an error happened even before this point. * WebProcess/soup/WebKitSoupRequestInputStream.h: * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamDidFailWithError): Notify the custom GInputStream that we no longer want to keep reading data in chunks due to a specific error. (webkitSoupRequestInputStreamReadAsync): Early finish the GTask with a specific error whenever webkitSoupRequestInputStreamDidFailWithError() has been called. Tools: Added new unit test to check the additional scenarios we now handle for custom URI schemes. * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp: (generateHTMLContent): New helper function to generate big enough content. (testWebContextURIScheme): New unit test. Canonical link: https://commits.webkit.org/170205@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
193 additions
and 16 deletions.
- +32 −0 Source/WebKit2/ChangeLog
- +15 −5 Source/WebKit2/Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp
- +8 −0 Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
- +5 −0 Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
- +1 −0 Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h
- +20 −0 Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.cpp
- +2 −0 Source/WebKit2/WebProcess/soup/WebKitSoupRequestInputStream.h
- +14 −0 Tools/ChangeLog
- +96 −11 Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters