Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_OBSERVER_H_ | |
| 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_OBSERVER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "content/browser/renderer_host/resource_dispatcher_host.h" | |
| 10 | |
| 11 namespace prerender { | |
| 12 class PrerenderTracker; | |
| 13 } | |
| 14 | |
| 15 // Implements ResourceDispatcherHost::Observer. Currently used by the Prerender | |
| 16 // system to abort requests and add to the load flags when a request begins. | |
| 17 class ChromeResourceDispatcherHostObserver : | |
|
mmenke
2011/05/24 18:38:09
nit: I believe the colon should go on the next li
dominich
2011/05/24 19:45:41
Done.
| |
| 18 public ResourceDispatcherHost::Observer { | |
| 19 public: | |
| 20 // This class does not take ownership of the tracker but merely holds a | |
| 21 // reference to it to avoid accessing g_browser_process. The PrerenderTracker | |
| 22 // will be destroyed after the observer. | |
| 23 explicit ChromeResourceDispatcherHostObserver( | |
| 24 prerender::PrerenderTracker* prerender_tracker); | |
| 25 virtual ~ChromeResourceDispatcherHostObserver(); | |
| 26 | |
| 27 // ResourceDispatcherHost::Observer implementation. | |
| 28 virtual bool ShouldBeginRequest( | |
| 29 int child_id, int route_id, | |
| 30 const ResourceHostMsg_Request& request_data, | |
| 31 const content::ResourceContext& resource_context, | |
| 32 const GURL& referrer) OVERRIDE; | |
| 33 | |
| 34 virtual void MutateLoadFlags(int child_id, int route_id, | |
| 35 int* load_flags) OVERRIDE; | |
| 36 | |
| 37 private: | |
| 38 prerender::PrerenderTracker* prerender_tracker_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostObserver); | |
| 41 }; | |
| 42 | |
| 43 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_OBSERVER _H_ | |
| OLD | NEW |