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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_time_tracker.cc

Issue 528363002: Move webCacheManager to //components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove an unnecessary dependency in web_cache.gypi. Created 6 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
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 #include "chrome/browser/extensions/api/web_request/web_request_time_tracker.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_time_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "content/public/browser/browser_thread.h"
James Cook 2014/09/05 16:53:18 Hooray for cleaning up unused includes!
Xi Han 2014/09/05 19:39:24 Yeah! I will remove the last unneeded one "chrome/
14 #include "extensions/browser/warning_set.h" 11 #include "extensions/browser/warning_set.h"
15 12
16 using content::BrowserThread;
17 13
18 // TODO(mpcomplete): tweak all these constants. 14 // TODO(mpcomplete): tweak all these constants.
19 namespace { 15 namespace {
20 // The number of requests we keep track of at a time. 16 // The number of requests we keep track of at a time.
21 const size_t kMaxRequestsLogged = 100u; 17 const size_t kMaxRequestsLogged = 100u;
22 18
23 // If a request completes faster than this amount (in ms), then we ignore it. 19 // If a request completes faster than this amount (in ms), then we ignore it.
24 // Any delays on such a request was negligible. 20 // Any delays on such a request was negligible.
25 const int kMinRequestTimeToCareMs = 10; 21 const int kMinRequestTimeToCareMs = 10;
26 22
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // When a request is redirected, we have no way of knowing how long the 241 // When a request is redirected, we have no way of knowing how long the
246 // request would have taken, so we can't say how much an extension slowed 242 // request would have taken, so we can't say how much an extension slowed
247 // down this request. Just ignore it. 243 // down this request. Just ignore it.
248 request_time_logs_.erase(request_id); 244 request_time_logs_.erase(request_id);
249 } 245 }
250 246
251 void ExtensionWebRequestTimeTracker::SetDelegate( 247 void ExtensionWebRequestTimeTracker::SetDelegate(
252 ExtensionWebRequestTimeTrackerDelegate* delegate) { 248 ExtensionWebRequestTimeTrackerDelegate* delegate) {
253 delegate_.reset(delegate); 249 delegate_.reset(delegate);
254 } 250 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698