Changeset 150753 in webkit
- Timestamp:
- May 27, 2013 6:32:07 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r150745 r150753 1 2013-05-27 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [GTK] Notify WebProcess in WebKitURISchemeRequest when we fail to read the user InputStream 4 https://bugs.webkit.org/show_bug.cgi?id=114347 5 6 Reviewed by Carlos Garcia Campos. 7 8 While processing a WebKitURISchemeRequest if there is any error reading 9 the InputStream provided by the user (for example the stream is already 10 closed) we have to notify the WebProcess that the request has failed. 11 12 * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: 13 (webkitURISchemeRequestReadCallback): Get the error from 14 g_input_stream_read_finish() and use it to call 15 webkit_uri_scheme_request_finish_error() in order to finish the failing 16 WebKitURISchemeRequest properly. 17 * UIProcess/API/gtk/tests/TestWebKitWebContext.cpp: 18 (testWebContextURIScheme): Modify test to check the new situation using 19 an already closed InputStream. 20 1 21 2013-05-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 22 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp
r149642 r150753 164 164 { 165 165 GRefPtr<WebKitURISchemeRequest> request = adoptGRef(schemeRequest); 166 gssize bytesRead = g_input_stream_read_finish(inputStream, result, 0);167 // FIXME: notify the WebProcess that we failed to read from the user stream.166 GOwnPtr<GError> error; 167 gssize bytesRead = g_input_stream_read_finish(inputStream, result, &error.outPtr()); 168 168 if (bytesRead == -1) { 169 webkit WebContextDidFinishURIRequest(request->priv->webContext, request->priv->requestID);169 webkit_uri_scheme_request_finish_error(request.get(), error.get()); 170 170 return; 171 171 } -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
r149642 r150753 167 167 char* replyHTML = g_strdup_printf(handler.reply.data(), webkit_uri_scheme_request_get_path(request)); 168 168 g_memory_input_stream_add_data(G_MEMORY_INPUT_STREAM(inputStream.get()), replyHTML, strlen(replyHTML), g_free); 169 } else if (!handler.reply.isNull()) 169 } else if (!g_strcmp0(scheme, "closed")) 170 g_input_stream_close(inputStream.get(), 0, 0); 171 else if (!handler.reply.isNull()) 170 172 g_memory_input_stream_add_data(G_MEMORY_INPUT_STREAM(inputStream.get()), handler.reply.data(), handler.reply.length(), 0); 171 173 … … 223 225 g_assert_error(test->m_error.get(), g_quark_from_string(errorDomain), errorCode); 224 226 g_assert_cmpstr(test->m_error->message, ==, errorMessage); 227 228 test->registerURISchemeHandler("closed", 0, 0, 0); 229 test->m_loadEvents.clear(); 230 test->loadURI("closed:input-stream"); 231 test->waitUntilLoadFinished(); 232 g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); 233 g_assert(test->m_loadFailed); 234 g_assert_error(test->m_error.get(), G_IO_ERROR, G_IO_ERROR_CLOSED); 225 235 } 226 236
Note: See TracChangeset
for help on using the changeset viewer.