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_NET_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/net/client_hints.h" |
14 #include "net/base/network_delegate.h" | 15 #include "net/base/network_delegate.h" |
15 | 16 |
16 class CookieSettings; | 17 class CookieSettings; |
17 class ExtensionInfoMap; | 18 class ExtensionInfoMap; |
18 class PrefService; | 19 class PrefService; |
19 template<class T> class PrefMember; | 20 template<class T> class PrefMember; |
20 | 21 |
21 typedef PrefMember<bool> BooleanPrefMember; | 22 typedef PrefMember<bool> BooleanPrefMember; |
22 | 23 |
23 namespace base { | 24 namespace base { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 84 |
84 void set_enable_do_not_track(BooleanPrefMember* enable_do_not_track) { | 85 void set_enable_do_not_track(BooleanPrefMember* enable_do_not_track) { |
85 enable_do_not_track_ = enable_do_not_track; | 86 enable_do_not_track_ = enable_do_not_track; |
86 } | 87 } |
87 | 88 |
88 void set_force_google_safe_search( | 89 void set_force_google_safe_search( |
89 BooleanPrefMember* force_google_safe_search) { | 90 BooleanPrefMember* force_google_safe_search) { |
90 force_google_safe_search_ = force_google_safe_search; | 91 force_google_safe_search_ = force_google_safe_search; |
91 } | 92 } |
92 | 93 |
| 94 // Adds the Client Hints header to HTTP requests. |
| 95 void set_enable_client_hints(); |
| 96 |
93 // Causes |OnCanThrottleRequest| to always return false, for all | 97 // Causes |OnCanThrottleRequest| to always return false, for all |
94 // instances of this object. | 98 // instances of this object. |
95 static void NeverThrottleRequests(); | 99 static void NeverThrottleRequests(); |
96 | 100 |
97 // Binds the pref members to |pref_service| and moves them to the IO thread. | 101 // Binds the pref members to |pref_service| and moves them to the IO thread. |
98 // |enable_referrers| cannot be NULL, the others can. | 102 // |enable_referrers| cannot be NULL, the others can. |
99 // This method should be called on the UI thread. | 103 // This method should be called on the UI thread. |
100 static void InitializePrefsOnUIThread( | 104 static void InitializePrefsOnUIThread( |
101 BooleanPrefMember* enable_referrers, | 105 BooleanPrefMember* enable_referrers, |
102 BooleanPrefMember* enable_do_not_track, | 106 BooleanPrefMember* enable_do_not_track, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. | 200 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. |
197 chrome_browser_net::LoadTimeStats* load_time_stats_; | 201 chrome_browser_net::LoadTimeStats* load_time_stats_; |
198 | 202 |
199 // Total size of all content (excluding headers) that has been received | 203 // Total size of all content (excluding headers) that has been received |
200 // over the network. | 204 // over the network. |
201 int64 received_content_length_; | 205 int64 received_content_length_; |
202 | 206 |
203 // Total original size of all content before it was transferred. | 207 // Total original size of all content before it was transferred. |
204 int64 original_content_length_; | 208 int64 original_content_length_; |
205 | 209 |
| 210 scoped_ptr<ClientHints> client_hints_; |
| 211 |
206 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 212 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
207 }; | 213 }; |
208 | 214 |
209 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 215 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |