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

Unified Diff: net/url_request/url_request_throttler_manager.cc

Issue 9585026: Add a source id to global NetLog entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Move friend declaration Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_throttler_manager.cc
===================================================================
--- net/url_request/url_request_throttler_manager.cc (revision 126703)
+++ net/url_request/url_request_throttler_manager.cc (working copy)
@@ -65,7 +65,7 @@
IsLocalhost(host)) {
if (!logged_for_localhost_disabled_ && IsLocalhost(host)) {
logged_for_localhost_disabled_ = true;
- net_log_->AddEvent(
+ net_log_.AddEvent(
NetLog::TYPE_THROTTLING_DISABLED_FOR_HOST,
make_scoped_refptr(new NetLogStringParameter("host", host)));
}
@@ -90,7 +90,7 @@
if (opt_out_hosts_.find(host) == opt_out_hosts_.end()) {
UMA_HISTOGRAM_COUNTS("Throttling.SiteOptedOut", 1);
- net_log_->EndEvent(
+ net_log_.EndEvent(
NetLog::TYPE_THROTTLING_DISABLED_FOR_HOST,
make_scoped_refptr(new NetLogStringParameter("host", host)));
opt_out_hosts_.insert(host);
@@ -133,13 +133,12 @@
void URLRequestThrottlerManager::set_net_log(NetLog* net_log) {
DCHECK(net_log);
- NetLog::Source source(NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING,
- net_log->NextID());
- net_log_.reset(new BoundNetLog(source, net_log));
+ net_log_ = BoundNetLog::Make(net_log,
+ NetLog::SOURCE_EXPONENTIAL_BACKOFF_THROTTLING);
}
NetLog* URLRequestThrottlerManager::net_log() const {
- return net_log_->net_log();
+ return net_log_.net_log();
}
void URLRequestThrottlerManager::OnIPAddressChanged() {
@@ -166,10 +165,6 @@
url_id_replacements_.ClearUsername();
url_id_replacements_.ClearQuery();
url_id_replacements_.ClearRef();
-
- // Make sure there is always a net_log_ instance, even if it logs to
- // nowhere.
- net_log_.reset(new BoundNetLog());
}
URLRequestThrottlerManager::~URLRequestThrottlerManager() {
« net/socket/socket_test_util.cc ('K') | « net/url_request/url_request_throttler_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698