diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-06 23:08:37 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-06 23:08:37 +0000 |
commit | dcbe3df77892fded9f0afa3fe01112f242b6fff7 (patch) | |
tree | cc4a01616ff566c53df7b4d1c1b821850abcfcdf /webkit/child | |
parent | 097782be0628a771d04d49dbb06360b6232cb340 (diff) | |
download | chromium_src-dcbe3df77892fded9f0afa3fe01112f242b6fff7.zip chromium_src-dcbe3df77892fded9f0afa3fe01112f242b6fff7.tar.gz chromium_src-dcbe3df77892fded9f0afa3fe01112f242b6fff7.tar.bz2 |
Plumb network stack information about existence of cached copy
through to error page. Specifically, add a "stale_copy_in_cache" argument to all of (ordered from Browser->Renderer):
* ResourceMsg_RequestComplete IPC message.
* ResourceDispatcher::OnRequestComplete
* ResourceLoaderBridge::Peer::OnCompletedRequest.
* All subclasses of RLB::P::OnCompleted Request, including WebURLLoaderImpl::context::OnCompletedRequest.
* Blink WebURLError and ResourceError classes (https://codereview.chromium.org/138493002).
* LocalizedError::GetStrings.
This is a paired commit with the blink CL
https://codereview.chromium.org/138493002. That CL must be landed before this one.
BUG=329620
Review URL: https://codereview.chromium.org/138513002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/child')
-rw-r--r-- | webkit/child/resource_loader_bridge.h | 1 | ||||
-rw-r--r-- | webkit/child/webkitplatformsupport_impl.cc | 2 | ||||
-rw-r--r-- | webkit/child/weburlloader_impl.cc | 10 | ||||
-rw-r--r-- | webkit/child/weburlloader_impl.h | 3 |
4 files changed, 12 insertions, 4 deletions
diff --git a/webkit/child/resource_loader_bridge.h b/webkit/child/resource_loader_bridge.h index e1cd310..ac8d1fa 100644 --- a/webkit/child/resource_loader_bridge.h +++ b/webkit/child/resource_loader_bridge.h @@ -178,6 +178,7 @@ class ResourceLoaderBridge { virtual void OnCompletedRequest( int error_code, bool was_ignored_by_handler, + bool stale_copy_in_cache, const std::string& security_info, const base::TimeTicks& completion_time) = 0; diff --git a/webkit/child/webkitplatformsupport_impl.cc b/webkit/child/webkitplatformsupport_impl.cc index 5cbd348..a599fa5 100644 --- a/webkit/child/webkitplatformsupport_impl.cc +++ b/webkit/child/webkitplatformsupport_impl.cc @@ -395,7 +395,7 @@ WebData WebKitPlatformSupportImpl::parseDataURL( WebURLError WebKitPlatformSupportImpl::cancelledError( const WebURL& unreachableURL) const { - return WebURLLoaderImpl::CreateError(unreachableURL, net::ERR_ABORTED); + return WebURLLoaderImpl::CreateError(unreachableURL, false, net::ERR_ABORTED); } void WebKitPlatformSupportImpl::decrementStatsCounter(const char* name) { diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc index 0885721..64f91ab 100644 --- a/webkit/child/weburlloader_impl.cc +++ b/webkit/child/weburlloader_impl.cc @@ -245,6 +245,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, virtual void OnCompletedRequest( int error_code, bool was_ignored_by_handler, + bool stale_copy_in_cache, const std::string& security_info, const base::TimeTicks& completion_time) OVERRIDE; @@ -598,6 +599,7 @@ void WebURLLoaderImpl::Context::OnReceivedCachedMetadata( void WebURLLoaderImpl::Context::OnCompletedRequest( int error_code, bool was_ignored_by_handler, + bool stale_copy_in_cache, const std::string& security_info, const base::TimeTicks& completion_time) { if (ftp_listing_delegate_) { @@ -615,7 +617,9 @@ void WebURLLoaderImpl::Context::OnCompletedRequest( if (client_) { if (error_code != net::OK) { - client_->didFail(loader_, CreateError(request_.url(), error_code)); + client_->didFail(loader_, CreateError(request_.url(), + stale_copy_in_cache, + error_code)); } else { client_->didFinishLoading( loader_, (completion_time - TimeTicks()).InSecondsF()); @@ -669,7 +673,7 @@ void WebURLLoaderImpl::Context::HandleDataURL() { OnReceivedData(data.data(), data.size(), 0); } - OnCompletedRequest(error_code, false, info.security_info, + OnCompletedRequest(error_code, false, false, info.security_info, base::TimeTicks::Now()); } @@ -685,11 +689,13 @@ WebURLLoaderImpl::~WebURLLoaderImpl() { } WebURLError WebURLLoaderImpl::CreateError(const WebURL& unreachable_url, + bool stale_copy_in_cache, int reason) { WebURLError error; error.domain = WebString::fromUTF8(net::kErrorDomain); error.reason = reason; error.unreachableURL = unreachable_url; + error.staleCopyInCache = stale_copy_in_cache; if (reason == net::ERR_ABORTED) { error.isCancellation = true; } else if (reason == net::ERR_TEMPORARILY_THROTTLED) { diff --git a/webkit/child/weburlloader_impl.h b/webkit/child/weburlloader_impl.h index 3cd2001..b8ed0cc 100644 --- a/webkit/child/weburlloader_impl.h +++ b/webkit/child/weburlloader_impl.h @@ -20,7 +20,8 @@ class WebURLLoaderImpl : public blink::WebURLLoader { virtual ~WebURLLoaderImpl(); static blink::WebURLError CreateError(const blink::WebURL& unreachable_url, - int reason); + bool stale_copy_in_cache, + int reason); WEBKIT_CHILD_EXPORT static void PopulateURLResponse( const GURL& url, const ResourceResponseInfo& info, |