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

Side by Side Diff: components/domain_reliability/monitor.cc

Issue 1062413002: Remove unnecessary instrumentation for several jank bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/domain_reliability/monitor.h" 5 #include "components/domain_reliability/monitor.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void DomainReliabilityMonitor::MoveToNetworkThread() { 70 void DomainReliabilityMonitor::MoveToNetworkThread() {
71 DCHECK(OnPrefThread()); 71 DCHECK(OnPrefThread());
72 DCHECK(!moved_to_network_thread_); 72 DCHECK(!moved_to_network_thread_);
73 73
74 moved_to_network_thread_ = true; 74 moved_to_network_thread_ = true;
75 } 75 }
76 76
77 void DomainReliabilityMonitor::InitURLRequestContext( 77 void DomainReliabilityMonitor::InitURLRequestContext(
78 net::URLRequestContext* url_request_context) { 78 net::URLRequestContext* url_request_context) {
79 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed.
80 tracked_objects::ScopedTracker tracking_profile(
81 FROM_HERE_WITH_EXPLICIT_FUNCTION(
82 "436671 DomainReliabilityMonitor::InitURLRequestContext"));
83
84 DCHECK(OnNetworkThread()); 79 DCHECK(OnNetworkThread());
85 DCHECK(moved_to_network_thread_); 80 DCHECK(moved_to_network_thread_);
86 81
87 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter = 82 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter =
88 new net::TrivialURLRequestContextGetter(url_request_context, 83 new net::TrivialURLRequestContextGetter(url_request_context,
89 network_task_runner_); 84 network_task_runner_);
90 InitURLRequestContext(url_request_context_getter); 85 InitURLRequestContext(url_request_context_getter);
91 } 86 }
92 87
93 void DomainReliabilityMonitor::InitURLRequestContext( 88 void DomainReliabilityMonitor::InitURLRequestContext(
94 const scoped_refptr<net::URLRequestContextGetter>& 89 const scoped_refptr<net::URLRequestContextGetter>&
95 url_request_context_getter) { 90 url_request_context_getter) {
96 DCHECK(OnNetworkThread()); 91 DCHECK(OnNetworkThread());
97 DCHECK(moved_to_network_thread_); 92 DCHECK(moved_to_network_thread_);
98 93
99 // Make sure the URLRequestContext actually lives on what was declared to be 94 // Make sure the URLRequestContext actually lives on what was declared to be
100 // the network thread. 95 // the network thread.
101 DCHECK(url_request_context_getter->GetNetworkTaskRunner()-> 96 DCHECK(url_request_context_getter->GetNetworkTaskRunner()->
102 RunsTasksOnCurrentThread()); 97 RunsTasksOnCurrentThread());
103 98
104 uploader_ = DomainReliabilityUploader::Create(time_.get(), 99 uploader_ = DomainReliabilityUploader::Create(time_.get(),
105 url_request_context_getter); 100 url_request_context_getter);
106 } 101 }
107 102
108 void DomainReliabilityMonitor::AddBakedInConfigs() { 103 void DomainReliabilityMonitor::AddBakedInConfigs() {
109 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. 104 // TODO(ttuttle): Remove ScopedTracker below once crbug.com/436671 is fixed.
110 tracked_objects::ScopedTracker tracking_profile( 105 tracked_objects::ScopedTracker tracking_profile(
111 FROM_HERE_WITH_EXPLICIT_FUNCTION( 106 FROM_HERE_WITH_EXPLICIT_FUNCTION(
112 "436671 DomainReliabilityMonitor::AddBakedInConfigs")); 107 "436671 DomainReliabilityMonitor::AddBakedInConfigs"));
113 108
114 DCHECK(OnNetworkThread()); 109 DCHECK(OnNetworkThread());
115 DCHECK(moved_to_network_thread_); 110 DCHECK(moved_to_network_thread_);
116 111
117 base::Time now = base::Time::Now(); 112 base::Time now = base::Time::Now();
118 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { 113 for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) {
119 base::StringPiece json(kBakedInJsonConfigs[i]); 114 base::StringPiece json(kBakedInJsonConfigs[i]);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 184
190 scoped_ptr<base::DictionaryValue> data_value(new base::DictionaryValue()); 185 scoped_ptr<base::DictionaryValue> data_value(new base::DictionaryValue());
191 data_value->Set("contexts", context_manager_.GetWebUIData()); 186 data_value->Set("contexts", context_manager_.GetWebUIData());
192 return data_value.Pass(); 187 return data_value.Pass();
193 } 188 }
194 189
195 DomainReliabilityContext* DomainReliabilityMonitor::AddContextForTesting( 190 DomainReliabilityContext* DomainReliabilityMonitor::AddContextForTesting(
196 scoped_ptr<const DomainReliabilityConfig> config) { 191 scoped_ptr<const DomainReliabilityConfig> config) {
197 DCHECK(OnNetworkThread()); 192 DCHECK(OnNetworkThread());
198 193
199 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed.
200 tracked_objects::ScopedTracker tracking_profile(
201 FROM_HERE_WITH_EXPLICIT_FUNCTION(
202 "436671 DomainReliabilityConfig::AddContextForConfig"));
203
204 return context_manager_.AddContextForConfig(config.Pass()); 194 return context_manager_.AddContextForConfig(config.Pass());
205 } 195 }
206 196
207 scoped_ptr<DomainReliabilityContext> 197 scoped_ptr<DomainReliabilityContext>
208 DomainReliabilityMonitor::CreateContextForConfig( 198 DomainReliabilityMonitor::CreateContextForConfig(
209 scoped_ptr<const DomainReliabilityConfig> config) { 199 scoped_ptr<const DomainReliabilityConfig> config) {
210 DCHECK(OnNetworkThread()); 200 DCHECK(OnNetworkThread());
211 DCHECK(config); 201 DCHECK(config);
212 DCHECK(config->IsValid()); 202 DCHECK(config->IsValid());
213 203
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 beacon.domain = request.url.host(); 283 beacon.domain = request.url.host();
294 context_manager_.RouteBeacon(request.url, beacon); 284 context_manager_.RouteBeacon(request.url, beacon);
295 } 285 }
296 286
297 base::WeakPtr<DomainReliabilityMonitor> 287 base::WeakPtr<DomainReliabilityMonitor>
298 DomainReliabilityMonitor::MakeWeakPtr() { 288 DomainReliabilityMonitor::MakeWeakPtr() {
299 return weak_factory_.GetWeakPtr(); 289 return weak_factory_.GetWeakPtr();
300 } 290 }
301 291
302 } // namespace domain_reliability 292 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager.cc ('k') | components/nacl/browser/pnacl_translation_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698