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

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

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 #include "extensions/browser/api/web_request/web_request_time_tracker.h" 5 #include "extensions/browser/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 "extensions/browser/warning_set.h" 10 #include "extensions/browser/warning_set.h"
(...skipping 16 matching lines...) Expand all
27 27
28 // If this many requests (of the past kMaxRequestsLogged) have had "too much" 28 // If this many requests (of the past kMaxRequestsLogged) have had "too much"
29 // delay, then we will warn the user. 29 // delay, then we will warn the user.
30 const size_t kNumModerateDelaysBeforeWarning = 50u; 30 const size_t kNumModerateDelaysBeforeWarning = 50u;
31 const size_t kNumExcessiveDelaysBeforeWarning = 10u; 31 const size_t kNumExcessiveDelaysBeforeWarning = 10u;
32 32
33 // Default implementation for ExtensionWebRequestTimeTrackerDelegate 33 // Default implementation for ExtensionWebRequestTimeTrackerDelegate
34 // that sets a warning in the extension service of |profile|. 34 // that sets a warning in the extension service of |profile|.
35 class DefaultDelegate : public ExtensionWebRequestTimeTrackerDelegate { 35 class DefaultDelegate : public ExtensionWebRequestTimeTrackerDelegate {
36 public: 36 public:
37 virtual ~DefaultDelegate() {} 37 ~DefaultDelegate() override {}
38 38
39 // Implementation of ExtensionWebRequestTimeTrackerDelegate. 39 // Implementation of ExtensionWebRequestTimeTrackerDelegate.
40 virtual void NotifyExcessiveDelays( 40 void NotifyExcessiveDelays(
41 void* profile, 41 void* profile,
42 size_t num_delayed_messages, 42 size_t num_delayed_messages,
43 size_t total_num_messages, 43 size_t total_num_messages,
44 const std::set<std::string>& extension_ids) override; 44 const std::set<std::string>& extension_ids) override;
45 virtual void NotifyModerateDelays( 45 void NotifyModerateDelays(
46 void* profile, 46 void* profile,
47 size_t num_delayed_messages, 47 size_t num_delayed_messages,
48 size_t total_num_messages, 48 size_t total_num_messages,
49 const std::set<std::string>& extension_ids) override; 49 const std::set<std::string>& extension_ids) override;
50 }; 50 };
51 51
52 void DefaultDelegate::NotifyExcessiveDelays( 52 void DefaultDelegate::NotifyExcessiveDelays(
53 void* profile, 53 void* profile,
54 size_t num_delayed_messages, 54 size_t num_delayed_messages,
55 size_t total_num_messages, 55 size_t total_num_messages,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // When a request is redirected, we have no way of knowing how long the 240 // When a request is redirected, we have no way of knowing how long the
241 // request would have taken, so we can't say how much an extension slowed 241 // request would have taken, so we can't say how much an extension slowed
242 // down this request. Just ignore it. 242 // down this request. Just ignore it.
243 request_time_logs_.erase(request_id); 243 request_time_logs_.erase(request_id);
244 } 244 }
245 245
246 void ExtensionWebRequestTimeTracker::SetDelegate( 246 void ExtensionWebRequestTimeTracker::SetDelegate(
247 ExtensionWebRequestTimeTrackerDelegate* delegate) { 247 ExtensionWebRequestTimeTrackerDelegate* delegate) {
248 delegate_.reset(delegate); 248 delegate_.reset(delegate);
249 } 249 }
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.cc ('k') | extensions/browser/api/web_view/web_view_internal_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698