diff options
author | jkarlin@google.com <jkarlin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-30 20:31:52 +0000 |
---|---|---|
committer | jkarlin@google.com <jkarlin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-30 20:31:52 +0000 |
commit | 54c1529f8d9906e174a4578a5dbdef30b23d21d8 (patch) | |
tree | 0490797063f9261c17bf5f4ad06f5c712c418d4f /content/browser/loader/resource_request_info_impl.h | |
parent | 352fa30b2d8de684b4c09f97018b0c6144efaa56 (diff) | |
download | chromium_src-54c1529f8d9906e174a4578a5dbdef30b23d21d8.zip chromium_src-54c1529f8d9906e174a4578a5dbdef30b23d21d8.tar.gz chromium_src-54c1529f8d9906e174a4578a5dbdef30b23d21d8.tar.bz2 |
Allows prefetch and other detachable requests to live beyond the renderer by delaying LinkLoader::Cancel requests by a few seconds and through the use of a new DetachedResourceHandler.
The general concept of a detachable resource should be useful for <a ping> as well.
BUG=286186
Review URL: https://codereview.chromium.org/25772002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/loader/resource_request_info_impl.h')
-rw-r--r-- | content/browser/loader/resource_request_info_impl.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h index 6947315a..1ab85e3 100644 --- a/content/browser/loader/resource_request_info_impl.h +++ b/content/browser/loader/resource_request_info_impl.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -51,6 +52,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo, PageTransition transition_type, bool is_download, bool is_stream, + bool is_detachable, bool allow_download, bool has_user_gesture, WebKit::WebReferrerPolicy referrer_policy, @@ -123,6 +125,17 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo, bool is_stream() const { return is_stream_; } void set_is_stream(bool stream) { is_stream_ = stream; } + // Whether this is a detachable resource. Detachable resource requests can + // live beyond the life of the renderer. + bool is_detachable() const { return is_detachable_; } + void set_is_detachable(bool is_detachable) { is_detachable_ = is_detachable; } + + // Detached resources are detachable resources that have ignored a request by + // the renderer to cancel and will continue to fetch but stops sending + // messages to the renderer. Detached resources eventually timeout. + bool is_detached() const { return is_detached_; } + void set_detached() { is_detached_ = true; } + void set_was_ignored_by_handler(bool value) { was_ignored_by_handler_ = value; } @@ -133,6 +146,10 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo, void set_memory_cost(int cost) { memory_cost_ = cost; } private: + FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, + DeletedFilterDetachable); + FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, + DeletedFilterDetachableRedirect); // Non-owning, may be NULL. CrossSiteResourceHandler* cross_site_handler_; @@ -147,6 +164,8 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo, int64 parent_frame_id_; bool is_download_; bool is_stream_; + bool is_detachable_; + bool is_detached_; bool allow_download_; bool has_user_gesture_; bool was_ignored_by_handler_; |