Changeset 71033 in webkit
- Timestamp:
- Nov 1, 2010 9:51:07 AM (14 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r71029 r71033 1 2010-11-01 Adam Roben <aroben@apple.com> 2 3 Cancel main resource loads after we hand them off to the media engine 4 5 This is the WebKit2 equivalent of r51104. Clearly this code should be 6 moved to a cross-platform location someday. 7 8 Fixes <http://webkit.org/b/48561> <rdar://problem/8606679> Assertion 9 failure in DocumentLoader::commitData when loading a media document in 10 WebKit2 11 12 Reviewed by Eric Carlson. 13 14 * WebProcess/WebCoreSupport/WebErrors.h: Added pluginWillHandleLoadError. 15 16 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 17 (WebFrameLoaderClient::committedLoad): Cancel the main resource load 18 after handing off the load to the media engine. This code originally 19 came from -[WebHTMLRepresentation receivedData:withDataSource:]. 20 (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError): Call through to WebErrors. 21 (WebKit::WebFrameLoaderClient::shouldFallBack): Implemented. We fall 22 back for all errors except when the load was cancelled or we handed it 23 off to the media engine or a plugin. 24 25 * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: 26 (WebKit::pluginWillHandleLoadError): Implemented. 27 28 * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp: 29 (WebKit::pluginWillHandleLoadError): Stubbed out. 30 31 * WebProcess/WebCoreSupport/win/WebErrorsWin.cpp: 32 (WebKit::pluginWillHandleLoadError): Implemented. 33 1 34 2010-11-01 Andreas Kling <kling@webkit.org> 2 35 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebErrors.h
r57309 r71033 39 39 WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&); 40 40 WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); 41 WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); 41 42 42 43 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r70936 r71033 678 678 loader->commitData(data, length); 679 679 680 // If the document is a stand-alone media document, now is the right time to cancel the WebKit load. 681 // FIXME: This code should be shared across all ports. <http://webkit.org/b/48762>. 682 if (m_frame->coreFrame()->document()->isMediaDocument()) 683 loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response())); 684 680 685 // Calling commitData did not create the plug-in view. 681 686 if (!m_pluginView) … … 683 688 684 689 if (!m_hasSentResponseToPluginView) { 685 m_pluginView->manualLoadDidReceiveResponse( m_frame->coreFrame()->loader()->documentLoader()->response());690 m_pluginView->manualLoadDidReceiveResponse(loader->response()); 686 691 // manualLoadDidReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in 687 692 // setting up this stream can cause the main document load to be cancelled, setting m_pluginView … … 830 835 } 831 836 832 ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&) 833 { 834 notImplemented(); 835 return ResourceError(); 836 } 837 838 bool WebFrameLoaderClient::shouldFallBack(const ResourceError&) 839 { 840 notImplemented(); 841 return false; 837 ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response) 838 { 839 return WebKit::pluginWillHandleLoadError(response); 840 } 841 842 bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error) 843 { 844 DEFINE_STATIC_LOCAL(const ResourceError, cancelledError, (this->cancelledError(ResourceRequest()))); 845 DEFINE_STATIC_LOCAL(const ResourceError, pluginWillHandleLoadError, (this->pluginWillHandleLoadError(ResourceResponse()))); 846 847 if (error.errorCode() == cancelledError.errorCode() && error.domain() == cancelledError.domain()) 848 return false; 849 850 if (error.errorCode() == pluginWillHandleLoadError.errorCode() && error.domain() == pluginWillHandleLoadError.domain()) 851 return false; 852 853 return true; 842 854 } 843 855 -
trunk/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
r70066 r71033 170 170 } 171 171 172 ResourceError pluginWillHandleLoadError(const ResourceResponse& response) 173 { 174 return [NSError _webKitErrorWithDomain:WebError::webKitErrorDomain() code:kWKErrorCodePlugInWillHandleLoad URL:response.url()]; 175 } 176 172 177 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
r62491 r71033 27 27 #include "WebErrors.h" 28 28 29 #include "NotImplemented.h" 29 30 #include <WebCore/ResourceRequest.h> 30 31 #include <WebCore/ResourceResponse.h> … … 86 87 } 87 88 89 ResourceError pluginWillHandleLoadError(const ResourceResponse&) 90 { 91 notImplemented(); 92 return ResourceError(); 93 } 94 88 95 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebCoreSupport/win/WebErrorsWin.cpp
r70597 r71033 73 73 } 74 74 75 ResourceError pluginWillHandleLoadError(const ResourceResponse& response) 76 { 77 return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodePlugInWillHandleLoad, response.url().string(), String()); 78 } 79 75 80 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.