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

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: Shutdown uploader in unittest Created 4 years, 2 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
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 "components/data_use_measurement/content/data_use_measurement.h" 19 #include "components/data_use_measurement/content/data_use_measurement.h"
20 #include "components/domain_reliability/monitor.h"
20 #include "components/metrics/data_use_tracker.h" 21 #include "components/metrics/data_use_tracker.h"
21 #include "components/prefs/pref_member.h" 22 #include "components/prefs/pref_member.h"
22 #include "net/base/network_delegate_impl.h" 23 #include "net/base/network_delegate_impl.h"
23 24
24 class ChromeExtensionsNetworkDelegate; 25 class ChromeExtensionsNetworkDelegate;
25 class PrefService; 26 class PrefService;
26 27
27 template<class T> class PrefMember; 28 template<class T> class PrefMember;
28 29
29 typedef PrefMember<bool> BooleanPrefMember; 30 typedef PrefMember<bool> BooleanPrefMember;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 BooleanPrefMember* force_youtube_safety_mode) { 110 BooleanPrefMember* force_youtube_safety_mode) {
110 force_youtube_safety_mode_ = force_youtube_safety_mode; 111 force_youtube_safety_mode_ = force_youtube_safety_mode;
111 } 112 }
112 113
113 void set_allowed_domains_for_apps( 114 void set_allowed_domains_for_apps(
114 StringPrefMember* allowed_domains_for_apps) { 115 StringPrefMember* allowed_domains_for_apps) {
115 allowed_domains_for_apps_ = allowed_domains_for_apps; 116 allowed_domains_for_apps_ = allowed_domains_for_apps;
116 } 117 }
117 118
118 void set_domain_reliability_monitor( 119 void set_domain_reliability_monitor(
119 domain_reliability::DomainReliabilityMonitor* monitor) { 120 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> monitor) {
120 domain_reliability_monitor_ = monitor; 121 domain_reliability_monitor_ = std::move(monitor);
121 } 122 }
122 123
123 void set_data_use_aggregator( 124 void set_data_use_aggregator(
124 data_usage::DataUseAggregator* data_use_aggregator, 125 data_usage::DataUseAggregator* data_use_aggregator,
125 bool is_data_usage_off_the_record); 126 bool is_data_usage_off_the_record);
126 127
127 // Binds the pref members to |pref_service| and moves them to the IO thread. 128 // Binds the pref members to |pref_service| and moves them to the IO thread.
128 // |enable_referrers| cannot be NULL, the others can. 129 // |enable_referrers| cannot be NULL, the others can.
129 // This method should be called on the UI thread. 130 // This method should be called on the UI thread.
130 static void InitializePrefsOnUIThread( 131 static void InitializePrefsOnUIThread(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 202
202 // Weak, owned by our owner. 203 // Weak, owned by our owner.
203 BooleanPrefMember* enable_referrers_; 204 BooleanPrefMember* enable_referrers_;
204 BooleanPrefMember* enable_do_not_track_; 205 BooleanPrefMember* enable_do_not_track_;
205 BooleanPrefMember* force_google_safe_search_; 206 BooleanPrefMember* force_google_safe_search_;
206 BooleanPrefMember* force_youtube_safety_mode_; 207 BooleanPrefMember* force_youtube_safety_mode_;
207 StringPrefMember* allowed_domains_for_apps_; 208 StringPrefMember* allowed_domains_for_apps_;
208 209
209 // Weak, owned by our owner. 210 // Weak, owned by our owner.
210 const policy::URLBlacklistManager* url_blacklist_manager_; 211 const policy::URLBlacklistManager* url_blacklist_manager_;
211 domain_reliability::DomainReliabilityMonitor* domain_reliability_monitor_; 212 std::unique_ptr<domain_reliability::DomainReliabilityMonitor>
213 domain_reliability_monitor_;
212 214
213 // When true, allow access to all file:// URLs. 215 // When true, allow access to all file:// URLs.
214 static bool g_allow_file_access_; 216 static bool g_allow_file_access_;
215 217
216 // Component to measure data use. 218 // Component to measure data use.
217 data_use_measurement::DataUseMeasurement data_use_measurement_; 219 data_use_measurement::DataUseMeasurement data_use_measurement_;
218 220
219 bool experimental_web_platform_features_enabled_; 221 bool experimental_web_platform_features_enabled_;
220 222
221 // Aggregates and reports network usage. 223 // Aggregates and reports network usage.
222 data_usage::DataUseAggregator* data_use_aggregator_; 224 data_usage::DataUseAggregator* data_use_aggregator_;
223 // Controls whether network usage is reported as being off the record. 225 // Controls whether network usage is reported as being off the record.
224 bool is_data_usage_off_the_record_; 226 bool is_data_usage_off_the_record_;
225 227
226 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 228 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
227 }; 229 };
228 230
229 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 231 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | components/domain_reliability/monitor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698