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

Unified Diff: content/browser/loader/resource_request_info_impl.h

Issue 1041993004: content::ResourceDispatcherHostImpl changes for stale-while-revalidate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s-w-r-yhirano-patch
Patch Set: Readability improvements suggested by tyoshino Created 5 years, 6 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
Index: content/browser/loader/resource_request_info_impl.h
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index afc30fff60f001720b3c58b476df6da8f2a84726..1f7bd1e50592415b69d3bd6abe67b3404693d13d 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -18,6 +18,8 @@
#include "content/public/common/resource_type.h"
#include "net/base/load_states.h"
+struct ResourceHostMsg_Request;
+
namespace content {
class CrossSiteResourceHandler;
class DetachableResourceHandler;
@@ -39,6 +41,9 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
CONTENT_EXPORT static const ResourceRequestInfoImpl* ForRequest(
const net::URLRequest* request);
+ // TODO(ricea): Something about this constructor.
+ // |original_request| is owned by the caller. If non-NULL, it is copied by
+ // the constructor.
CONTENT_EXPORT ResourceRequestInfoImpl(
int process_type,
int child_id,
@@ -64,7 +69,9 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
blink::WebPageVisibilityState visibility_state,
ResourceContext* context,
base::WeakPtr<ResourceMessageFilter> filter,
- bool is_async);
+ bool is_async,
+ bool is_async_revalidation,
+ const ResourceHostMsg_Request* original_request);
~ResourceRequestInfoImpl() override;
// ResourceRequestInfo implementation:
@@ -88,6 +95,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
int* render_frame_id) const override;
bool IsAsync() const override;
bool IsDownload() const override;
+ bool IsAsyncRevalidation() const override;
CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request);
@@ -178,6 +186,9 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
void set_do_not_prompt_for_login(bool do_not_prompt) {
do_not_prompt_for_login_ = do_not_prompt;
}
+ ResourceHostMsg_Request* original_request() {
+ return original_request_.get();
+ }
private:
FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
@@ -217,7 +228,15 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
// The filter might be deleted without deleting this object if the process
// exits during a transfer.
base::WeakPtr<ResourceMessageFilter> filter_;
+
+ // Original request information required to clone the request if an async
+ // revalidation will be performed. NULL if async revalidation is not
+ // applicable to this request (eg. it is already an async revalidation, is not
+ // method "GET", etc.).
+ scoped_ptr<ResourceHostMsg_Request> original_request_;
+
bool is_async_;
+ bool is_async_revalidation_;
DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl);
};

Powered by Google App Engine
This is Rietveld 408576698