[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 15:20:23 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit df968144cc38960d5ebc0b97ff67eb56401573c3
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 1 16:51:07 2010 +0000
Cancel main resource loads after we hand them off to the media engine
This is the WebKit2 equivalent of r51104. Clearly this code should be
moved to a cross-platform location someday.
Fixes <http://webkit.org/b/48561> <rdar://problem/8606679> Assertion
failure in DocumentLoader::commitData when loading a media document in
WebKit2
Reviewed by Eric Carlson.
* WebProcess/WebCoreSupport/WebErrors.h: Added pluginWillHandleLoadError.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::committedLoad): Cancel the main resource load
after handing off the load to the media engine. This code originally
came from -[WebHTMLRepresentation receivedData:withDataSource:].
(WebKit::WebFrameLoaderClient::pluginWillHandleLoadError): Call through to WebErrors.
(WebKit::WebFrameLoaderClient::shouldFallBack): Implemented. We fall
back for all errors except when the load was cancelled or we handed it
off to the media engine or a plugin.
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
(WebKit::pluginWillHandleLoadError): Implemented.
* WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp:
(WebKit::pluginWillHandleLoadError): Stubbed out.
* WebProcess/WebCoreSupport/win/WebErrorsWin.cpp:
(WebKit::pluginWillHandleLoadError): Implemented.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 5fb7372..8b690a6 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,36 @@
+2010-11-01 Adam Roben <aroben at apple.com>
+
+ Cancel main resource loads after we hand them off to the media engine
+
+ This is the WebKit2 equivalent of r51104. Clearly this code should be
+ moved to a cross-platform location someday.
+
+ Fixes <http://webkit.org/b/48561> <rdar://problem/8606679> Assertion
+ failure in DocumentLoader::commitData when loading a media document in
+ WebKit2
+
+ Reviewed by Eric Carlson.
+
+ * WebProcess/WebCoreSupport/WebErrors.h: Added pluginWillHandleLoadError.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebFrameLoaderClient::committedLoad): Cancel the main resource load
+ after handing off the load to the media engine. This code originally
+ came from -[WebHTMLRepresentation receivedData:withDataSource:].
+ (WebKit::WebFrameLoaderClient::pluginWillHandleLoadError): Call through to WebErrors.
+ (WebKit::WebFrameLoaderClient::shouldFallBack): Implemented. We fall
+ back for all errors except when the load was cancelled or we handed it
+ off to the media engine or a plugin.
+
+ * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
+ (WebKit::pluginWillHandleLoadError): Implemented.
+
+ * WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp:
+ (WebKit::pluginWillHandleLoadError): Stubbed out.
+
+ * WebProcess/WebCoreSupport/win/WebErrorsWin.cpp:
+ (WebKit::pluginWillHandleLoadError): Implemented.
+
2010-11-01 Andreas Kling <kling at webkit.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebErrors.h b/WebKit2/WebProcess/WebCoreSupport/WebErrors.h
index 42e5822..ed43c57 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebErrors.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebErrors.h
@@ -38,6 +38,7 @@ WebCore::ResourceError cannotShowURLError(const WebCore::ResourceRequest&);
WebCore::ResourceError interruptForPolicyChangeError(const WebCore::ResourceRequest&);
WebCore::ResourceError cannotShowMIMETypeError(const WebCore::ResourceResponse&);
WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&);
+WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&);
} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 95fab0a..82efac6 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -677,12 +677,17 @@ void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat
if (!m_pluginView)
loader->commitData(data, length);
+ // If the document is a stand-alone media document, now is the right time to cancel the WebKit load.
+ // FIXME: This code should be shared across all ports. <http://webkit.org/b/48762>.
+ if (m_frame->coreFrame()->document()->isMediaDocument())
+ loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response()));
+
// Calling commitData did not create the plug-in view.
if (!m_pluginView)
return;
if (!m_hasSentResponseToPluginView) {
- m_pluginView->manualLoadDidReceiveResponse(m_frame->coreFrame()->loader()->documentLoader()->response());
+ m_pluginView->manualLoadDidReceiveResponse(loader->response());
// manualLoadDidReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
// setting up this stream can cause the main document load to be cancelled, setting m_pluginView
// to null
@@ -829,16 +834,23 @@ ResourceError WebFrameLoaderClient::fileDoesNotExistError(const ResourceResponse
return WebKit::fileDoesNotExistError(response);
}
-ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse&)
+ResourceError WebFrameLoaderClient::pluginWillHandleLoadError(const ResourceResponse& response)
{
- notImplemented();
- return ResourceError();
+ return WebKit::pluginWillHandleLoadError(response);
}
-bool WebFrameLoaderClient::shouldFallBack(const ResourceError&)
+bool WebFrameLoaderClient::shouldFallBack(const ResourceError& error)
{
- notImplemented();
- return false;
+ DEFINE_STATIC_LOCAL(const ResourceError, cancelledError, (this->cancelledError(ResourceRequest())));
+ DEFINE_STATIC_LOCAL(const ResourceError, pluginWillHandleLoadError, (this->pluginWillHandleLoadError(ResourceResponse())));
+
+ if (error.errorCode() == cancelledError.errorCode() && error.domain() == cancelledError.domain())
+ return false;
+
+ if (error.errorCode() == pluginWillHandleLoadError.errorCode() && error.domain() == pluginWillHandleLoadError.domain())
+ return false;
+
+ return true;
}
bool WebFrameLoaderClient::canHandleRequest(const ResourceRequest&) const
diff --git a/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm b/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
index 6076cb9..50656fb 100644
--- a/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
+++ b/WebKit2/WebProcess/WebCoreSupport/mac/WebErrorsMac.mm
@@ -169,4 +169,9 @@ ResourceError fileDoesNotExistError(const ResourceResponse& response)
return [NSError _webKitErrorWithDomain:NSURLErrorDomain code:NSURLErrorFileDoesNotExist URL:response.url()];
}
+ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
+{
+ return [NSError _webKitErrorWithDomain:WebError::webKitErrorDomain() code:kWKErrorCodePlugInWillHandleLoad URL:response.url()];
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp b/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
index c67c472..c1d340e 100644
--- a/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp
@@ -26,6 +26,7 @@
#include "WebErrors.h"
+#include "NotImplemented.h"
#include <WebCore/ResourceRequest.h>
#include <WebCore/ResourceResponse.h>
@@ -85,4 +86,10 @@ ResourceError fileDoesNotExistError(const ResourceResponse& response)
QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
}
+ResourceError pluginWillHandleLoadError(const ResourceResponse&)
+{
+ notImplemented();
+ return ResourceError();
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/win/WebErrorsWin.cpp b/WebKit2/WebProcess/WebCoreSupport/win/WebErrorsWin.cpp
index f39e0f7..b29b461 100644
--- a/WebKit2/WebProcess/WebCoreSupport/win/WebErrorsWin.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/win/WebErrorsWin.cpp
@@ -72,4 +72,9 @@ ResourceError fileDoesNotExistError(const ResourceResponse& response)
return ResourceError();
}
+ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
+{
+ return ResourceError(WebError::webKitErrorDomain(), kWKErrorCodePlugInWillHandleLoad, response.url().string(), String());
+}
+
} // namespace WebKit
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list