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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.h

Issue 6966017: Remove a chrome dependency by removing Prerender from ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 7 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 | « content/browser/DEPS ('k') | content/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host.h
diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h
index 3e007efff145f586ee7244d4a897eb3b61fc6c7f..d59fce4b1b5a22b0573cb894c7eb6d0ddc5800e6 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.h
+++ b/content/browser/renderer_host/resource_dispatcher_host.h
@@ -59,6 +59,24 @@ class DeletableFileReference;
class ResourceDispatcherHost : public net::URLRequest::Delegate {
public:
+ class Observer {
+ public:
+ // Called when a request begins. Return false to abort the request.
+ virtual bool ShouldBeginRequest(
+ int child_id, int route_id,
+ const ResourceHostMsg_Request& request_data,
+ const content::ResourceContext& resource_context,
+ const GURL& referrer) = 0;
+
+ // Called after the load flags have been set when a request begins. Use it
+ // to add or remove load flags.
+ virtual void MutateLoadFlags(int child_id, int route_id,
+ int* load_flags) = 0;
+ protected:
+ Observer() {}
+ virtual ~Observer() {}
+ };
+
explicit ResourceDispatcherHost(
const ResourceQueue::DelegateSet& resource_queue_delegates);
virtual ~ResourceDispatcherHost();
@@ -244,6 +262,10 @@ class ResourceDispatcherHost : public net::URLRequest::Delegate {
static bool is_prefetch_enabled();
static void set_is_prefetch_enabled(bool value);
+ // This does not take ownership of the observer. It is expected that the
+ // observer have a longer lifetime than the ResourceDispatcherHost.
+ void set_observer(Observer* observer) { observer_ = observer; }
+
private:
FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
TestBlockedRequestsProcessDies);
@@ -476,8 +498,9 @@ class ResourceDispatcherHost : public net::URLRequest::Delegate {
// to the source of the message.
ResourceMessageFilter* filter_;
- static bool is_prefetch_enabled_;
+ Observer* observer_;
+ static bool is_prefetch_enabled_;
DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost);
};
« no previous file with comments | « content/browser/DEPS ('k') | content/browser/renderer_host/resource_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698