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 /content/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 'content/child')
-rw-r--r-- | content/child/npapi/plugin_url_fetcher.cc | 1 | ||||
-rw-r--r-- | content/child/npapi/plugin_url_fetcher.h | 1 | ||||
-rw-r--r-- | content/child/resource_dispatcher.cc | 15 | ||||
-rw-r--r-- | content/child/resource_dispatcher.h | 7 | ||||
-rw-r--r-- | content/child/resource_dispatcher_unittest.cc | 3 |
5 files changed, 16 insertions, 11 deletions
diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc index efc5b13..fa85dd6 100644 --- a/content/child/npapi/plugin_url_fetcher.cc +++ b/content/child/npapi/plugin_url_fetcher.cc @@ -341,6 +341,7 @@ void PluginURLFetcher::OnReceivedData(const char* data, void PluginURLFetcher::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 (multipart_delegate_) { diff --git a/content/child/npapi/plugin_url_fetcher.h b/content/child/npapi/plugin_url_fetcher.h index 2a0a10d..cf58813 100644 --- a/content/child/npapi/plugin_url_fetcher.h +++ b/content/child/npapi/plugin_url_fetcher.h @@ -62,6 +62,7 @@ class PluginURLFetcher : public webkit_glue::ResourceLoaderBridge::Peer { 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; diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index 6e4f438..d6affbb 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc @@ -521,10 +521,7 @@ void ResourceDispatcher::FollowPendingRedirect( void ResourceDispatcher::OnRequestComplete( int request_id, - int error_code, - bool was_ignored_by_handler, - const std::string& security_info, - const base::TimeTicks& browser_completion_time) { + const ResourceMsg_RequestCompleteData& request_complete_data) { TRACE_EVENT0("loader", "ResourceDispatcher::OnRequestComplete"); SiteIsolationPolicy::OnRequestComplete(request_id); @@ -540,17 +537,21 @@ void ResourceDispatcher::OnRequestComplete( if (delegate_) { ResourceLoaderBridge::Peer* new_peer = delegate_->OnRequestComplete( - request_info->peer, request_info->resource_type, error_code); + request_info->peer, request_info->resource_type, + request_complete_data.error_code); if (new_peer) request_info->peer = new_peer; } base::TimeTicks renderer_completion_time = ToRendererCompletionTime( - *request_info, browser_completion_time); + *request_info, request_complete_data.completion_time); // The request ID will be removed from our pending list in the destructor. // Normally, dispatching this message causes the reference-counted request to // die immediately. - peer->OnCompletedRequest(error_code, was_ignored_by_handler, security_info, + peer->OnCompletedRequest(request_complete_data.error_code, + request_complete_data.was_ignored_by_handler, + request_complete_data.exists_in_cache, + request_complete_data.security_info, renderer_completion_time); } diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h index d85087d..4943765 100644 --- a/content/child/resource_dispatcher.h +++ b/content/child/resource_dispatcher.h @@ -20,6 +20,8 @@ #include "ipc/ipc_sender.h" #include "webkit/child/resource_loader_bridge.h" +struct ResourceMsg_RequestCompleteData; + namespace content { class ResourceDispatcherDelegate; struct ResourceResponseHead; @@ -150,10 +152,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener { int encoded_data_length); void OnRequestComplete( int request_id, - int error_code, - bool was_ignored_by_handler, - const std::string& security_info, - const base::TimeTicks& completion_time); + const ResourceMsg_RequestCompleteData &request_complete_data); // Dispatch the message to one of the message response handlers. void DispatchMessage(const IPC::Message& message); diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc index 46869d5..7ff9ac3 100644 --- a/content/child/resource_dispatcher_unittest.cc +++ b/content/child/resource_dispatcher_unittest.cc @@ -70,6 +70,7 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer { 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 { EXPECT_FALSE(complete_); @@ -295,6 +296,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, 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 { } @@ -382,6 +384,7 @@ class TimeConversionTest : public ResourceDispatcherTest, 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 { } |