| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "chrome/common/metrics/variation_ids.h" | 13 #include "chrome/common/metrics/variation_ids.h" |
| 14 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 14 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 15 | 15 |
| 16 class DelayedResourceQueue; | 16 class DelayedResourceQueue; |
| 17 class DownloadRequestLimiter; | 17 class DownloadRequestLimiter; |
| 18 class SafeBrowsingService; | 18 class SafeBrowsingService; |
| 19 |
| 20 namespace extensions { |
| 19 class UserScriptListener; | 21 class UserScriptListener; |
| 22 } |
| 20 | 23 |
| 21 namespace prerender { | 24 namespace prerender { |
| 22 class PrerenderTracker; | 25 class PrerenderTracker; |
| 23 } | 26 } |
| 24 | 27 |
| 25 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender | 28 // Implements ResourceDispatcherHostDelegate. Currently used by the Prerender |
| 26 // system to abort requests and add to the load flags when a request begins. | 29 // system to abort requests and add to the load flags when a request begins. |
| 27 class ChromeResourceDispatcherHostDelegate | 30 class ChromeResourceDispatcherHostDelegate |
| 28 : public content::ResourceDispatcherHostDelegate, | 31 : public content::ResourceDispatcherHostDelegate, |
| 29 public base::FieldTrialList::Observer { | 32 public base::FieldTrialList::Observer { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // This method also registers the caller with the FieldTrialList to receive | 113 // This method also registers the caller with the FieldTrialList to receive |
| 111 // new variation IDs. | 114 // new variation IDs. |
| 112 void InitVariationIDsCacheIfNeeded(); | 115 void InitVariationIDsCacheIfNeeded(); |
| 113 | 116 |
| 114 // Takes whatever is currently in |variation_ids_set_| and recreates | 117 // Takes whatever is currently in |variation_ids_set_| and recreates |
| 115 // |variation_ids_header_| with it. | 118 // |variation_ids_header_| with it. |
| 116 void UpdateVariationIDsHeaderValue(); | 119 void UpdateVariationIDsHeaderValue(); |
| 117 | 120 |
| 118 scoped_refptr<DownloadRequestLimiter> download_request_limiter_; | 121 scoped_refptr<DownloadRequestLimiter> download_request_limiter_; |
| 119 scoped_refptr<SafeBrowsingService> safe_browsing_; | 122 scoped_refptr<SafeBrowsingService> safe_browsing_; |
| 120 scoped_refptr<UserScriptListener> user_script_listener_; | 123 scoped_refptr<extensions::UserScriptListener> user_script_listener_; |
| 121 prerender::PrerenderTracker* prerender_tracker_; | 124 prerender::PrerenderTracker* prerender_tracker_; |
| 122 | 125 |
| 123 // Whether or not we've initialized the Cache. | 126 // Whether or not we've initialized the Cache. |
| 124 bool variation_ids_cache_initialized_; | 127 bool variation_ids_cache_initialized_; |
| 125 | 128 |
| 126 // Keep a cache of variation IDs that are transmitted in headers to Google. | 129 // Keep a cache of variation IDs that are transmitted in headers to Google. |
| 127 // This consists of a list of valid IDs, and the actual transmitted header. | 130 // This consists of a list of valid IDs, and the actual transmitted header. |
| 128 // Note that since this cache is both initialized and accessed from the IO | 131 // Note that since this cache is both initialized and accessed from the IO |
| 129 // thread, we do not need to synchronize its uses. | 132 // thread, we do not need to synchronize its uses. |
| 130 std::set<chrome_variations::VariationID> variation_ids_set_; | 133 std::set<chrome_variations::VariationID> variation_ids_set_; |
| 131 std::string variation_ids_header_; | 134 std::string variation_ids_header_; |
| 132 | 135 |
| 133 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); | 136 DISALLOW_COPY_AND_ASSIGN(ChromeResourceDispatcherHostDelegate); |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE
_H_ | 139 #endif // CHROME_BROWSER_RENDERER_HOST_CHROME_RESOURCE_DISPATCHER_HOST_DELEGATE
_H_ |
| OLD | NEW |