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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 23654014: Updated Client-Hints patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed issues raised in review by mmenke and bengr Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/base/network_delegate.h" 14 #include "net/base/network_delegate.h"
15 15
16 class CookieSettings; 16 class CookieSettings;
17 class ExtensionInfoMap; 17 class ExtensionInfoMap;
18 class PrefService; 18 class PrefService;
19 class ClientHints;
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 {
24 class Value; 25 class Value;
25 } 26 }
26 27
27 namespace chrome_browser_net { 28 namespace chrome_browser_net {
28 class ConnectInterceptor; 29 class ConnectInterceptor;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SetEnableClientHints();
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Pointer to IOThread global, should outlive ChromeNetworkDelegate. 204 // Pointer to IOThread global, should outlive ChromeNetworkDelegate.
201 chrome_browser_net::LoadTimeStats* load_time_stats_; 205 chrome_browser_net::LoadTimeStats* load_time_stats_;
202 206
203 // Total size of all content (excluding headers) that has been received 207 // Total size of all content (excluding headers) that has been received
204 // over the network. 208 // over the network.
205 int64 received_content_length_; 209 int64 received_content_length_;
206 210
207 // Total original size of all content before it was transferred. 211 // Total original size of all content before it was transferred.
208 int64 original_content_length_; 212 int64 original_content_length_;
209 213
214 scoped_ptr<ClientHints> client_hints_;
215
210 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 216 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
211 }; 217 };
212 218
213 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 219 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698