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

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

Issue 2336043007: Domain Reliability: Don't crash on shutdown with uploads pending (Closed)
Patch Set: Remove outdated comment. Created 4 years 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
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "chrome/browser/net/safe_search_util.h" 19 #include "chrome/browser/net/safe_search_util.h"
20 #include "components/domain_reliability/monitor.h"
20 #include "components/prefs/pref_member.h" 21 #include "components/prefs/pref_member.h"
21 #include "net/base/network_delegate_impl.h" 22 #include "net/base/network_delegate_impl.h"
22 23
23 class ChromeExtensionsNetworkDelegate; 24 class ChromeExtensionsNetworkDelegate;
24 class PrefService; 25 class PrefService;
25 26
26 template<class T> class PrefMember; 27 template<class T> class PrefMember;
27 28
28 typedef PrefMember<bool> BooleanPrefMember; 29 typedef PrefMember<bool> BooleanPrefMember;
29 30
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 IntegerPrefMember* force_youtube_restrict) { 103 IntegerPrefMember* force_youtube_restrict) {
103 force_youtube_restrict_ = force_youtube_restrict; 104 force_youtube_restrict_ = force_youtube_restrict;
104 } 105 }
105 106
106 void set_allowed_domains_for_apps( 107 void set_allowed_domains_for_apps(
107 StringPrefMember* allowed_domains_for_apps) { 108 StringPrefMember* allowed_domains_for_apps) {
108 allowed_domains_for_apps_ = allowed_domains_for_apps; 109 allowed_domains_for_apps_ = allowed_domains_for_apps;
109 } 110 }
110 111
111 void set_domain_reliability_monitor( 112 void set_domain_reliability_monitor(
112 domain_reliability::DomainReliabilityMonitor* monitor) { 113 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> monitor) {
113 domain_reliability_monitor_ = monitor; 114 domain_reliability_monitor_ = std::move(monitor);
114 } 115 }
115 116
116 void set_data_use_aggregator( 117 void set_data_use_aggregator(
117 data_usage::DataUseAggregator* data_use_aggregator, 118 data_usage::DataUseAggregator* data_use_aggregator,
118 bool is_data_usage_off_the_record); 119 bool is_data_usage_off_the_record);
119 120
120 // Binds the pref members to |pref_service| and moves them to the IO thread. 121 // Binds the pref members to |pref_service| and moves them to the IO thread.
121 // |enable_referrers| cannot be nullptr, the others can. 122 // |enable_referrers| cannot be nullptr, the others can.
122 // This method should be called on the UI thread. 123 // This method should be called on the UI thread.
123 static void InitializePrefsOnUIThread( 124 static void InitializePrefsOnUIThread(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 197
197 // Weak, owned by our owner. 198 // Weak, owned by our owner.
198 BooleanPrefMember* enable_referrers_; 199 BooleanPrefMember* enable_referrers_;
199 BooleanPrefMember* enable_do_not_track_; 200 BooleanPrefMember* enable_do_not_track_;
200 BooleanPrefMember* force_google_safe_search_; 201 BooleanPrefMember* force_google_safe_search_;
201 IntegerPrefMember* force_youtube_restrict_; 202 IntegerPrefMember* force_youtube_restrict_;
202 StringPrefMember* allowed_domains_for_apps_; 203 StringPrefMember* allowed_domains_for_apps_;
203 204
204 // Weak, owned by our owner. 205 // Weak, owned by our owner.
205 const policy::URLBlacklistManager* url_blacklist_manager_; 206 const policy::URLBlacklistManager* url_blacklist_manager_;
206 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; 207 std::unique_ptr<domain_reliability::DomainReliabilityMonitor>
208 domain_reliability_monitor_;
207 209
208 // When true, allow access to all file:// URLs. 210 // When true, allow access to all file:// URLs.
209 static bool g_allow_file_access_; 211 static bool g_allow_file_access_;
210 212
211 bool experimental_web_platform_features_enabled_; 213 bool experimental_web_platform_features_enabled_;
212 214
213 // Aggregates and reports network usage. 215 // Aggregates and reports network usage.
214 data_usage::DataUseAggregator* data_use_aggregator_; 216 data_usage::DataUseAggregator* data_use_aggregator_;
215 // Controls whether network usage is reported as being off the record. 217 // Controls whether network usage is reported as being off the record.
216 bool is_data_usage_off_the_record_; 218 bool is_data_usage_off_the_record_;
217 219
218 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 220 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
219 }; 221 };
220 222
221 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 223 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/domain_reliability/browsertest.cc ('k') | chrome/browser/net/chrome_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698