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

Unified Diff: content/browser/loader/resource_dispatcher_host_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: Suppress duplicate async revalidations to the same URL. 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_dispatcher_host_impl.h
diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h
index 51d5b7386acf7007e6b01a26dc54553e4a92d0ec..7546b6a92b3dbb9030b80adb1a11f6dfab714cb1 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.h
+++ b/content/browser/loader/resource_dispatcher_host_impl.h
@@ -15,6 +15,7 @@
#include <map>
#include <set>
#include <string>
+#include <utility>
#include <vector>
#include "base/basictypes.h"
@@ -46,7 +47,9 @@ class ResourceHandler;
struct ResourceHostMsg_Request;
namespace net {
+class URLRequestContext;
class URLRequestJobFactory;
+class HttpCache;
}
namespace storage {
@@ -422,6 +425,16 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
IPC::Message* sync_result, // only valid for sync
int route_id); // only valid for async
+ void BeginRequestFromData(int request_id,
+ const ResourceHostMsg_Request& request_data,
+ IPC::Message* sync_result,
+ int process_type,
+ int child_id,
+ int route_id,
+ bool is_async_revalidation,
+ net::URLRequestContext* request_context,
+ ResourceContext* resource_context);
+
// Creates a ResourceHandler to be used by BeginRequest() for normal resource
// loading.
scoped_ptr<ResourceHandler> CreateResourceHandler(
@@ -431,11 +444,17 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
int route_id,
int process_type,
int child_id,
+ bool is_async_revalidation,
ResourceContext* resource_context);
+ // Wraps |handler| in the BufferedResourceHandler, enabling mime-type sniffing
+ // and redirecting to download or plugins as appropriate.
+ scoped_ptr<ResourceHandler> AddBufferedResourceHandler(
+ net::URLRequest* request,
+ scoped_ptr<ResourceHandler> handler);
+
// Wraps |handler| in the standard resource handlers for normal resource
- // loading and navigation requests. This adds BufferedResourceHandler and
- // ResourceThrottles.
+ // loading and navigation requests. This adds ResourceThrottles.
scoped_ptr<ResourceHandler> AddStandardHandlers(
net::URLRequest* request,
ResourceType resource_type,
@@ -491,6 +510,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
int child_id,
bool is_sync_load);
+ void BeginAsyncRevalidation(net::URLRequest* for_request);
+
LoaderMap pending_loaders_;
// Collection of temp files downloaded for child processes via
@@ -569,6 +590,14 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
bool allow_cross_origin_auth_prompt_;
+ // stale-while-revalidate is enabled either via experiment or command-line
+ // flag.
+ bool async_revalidation_enabled_;
+
+ // In progress async revalidations.
+ std::set<std::pair<net::HttpCache*, std::string>>
+ in_progress_async_revalidations_;
+
// http://crbug.com/90971 - Assists in tracking down use-after-frees on
// shutdown.
std::set<const ResourceContext*> active_resource_contexts_;

Powered by Google App Engine
This is Rietveld 408576698