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

Unified Diff: webkit/child/weburlloader_impl.cc

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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 | « webkit/child/weburlloader_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/child/weburlloader_impl.cc
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 08857219febad376f6cc332f665f9fcf1a6d9711..64f91ab6eff59f098fa57d5e0cc4a1e26dc4d1a1 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) {
« no previous file with comments | « webkit/child/weburlloader_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698