Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 14495011: Revert "Create errors (especially cancellation errors) internally to WebCore, rather" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index e895269c1ecafdb193624ff5faff100520f6eee5..2b7adbb2f4b57480aded9a3c3ee37d5b80a4cd26 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -2323,11 +2323,7 @@ void FrameLoader::receivedMainResourceError(const ResourceError& error)
// FIXME: Don't want to do this if an entirely new load is going, so should check
// that both data sources on the frame are either this or nil.
stop();
-
- // FIXME: We really ought to be able to just check for isCancellation() here, but there are some
- // ResourceErrors that setIsCancellation() but aren't created by ResourceError::cancelledError().
- ResourceError c(ResourceError::cancelledError(KURL()));
- if (error.errorCode() != c.errorCode() || error.domain() != c.domain())
+ if (m_client->shouldFallBack(error))
handleFallbackContent();
if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) {
@@ -2596,7 +2592,7 @@ void FrameLoader::requestFromDelegate(ResourceRequest& request, unsigned long& i
notifier()->dispatchWillSendRequest(m_documentLoader.get(), identifier, newRequest, ResourceResponse());
if (newRequest.isNull())
- error = ResourceError::cancelledError(request.url());
+ error = cancelledError(request);
else
error = ResourceError();
@@ -2849,6 +2845,13 @@ void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
loadDifferentDocumentItem(item, loadType, MayAttemptCacheOnlyLoadForFormSubmissionItem);
}
+ResourceError FrameLoader::cancelledError(const ResourceRequest& request) const
+{
+ ResourceError error = m_client->cancelledError(request);
+ error.setIsCancellation(true);
+ return error;
+}
+
void FrameLoader::setTitle(const StringWithDirection& title)
{
documentLoader()->setTitle(title);
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/core/loader/FrameLoaderClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698