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

Unified Diff: net/url_request/url_request_throttler_entry.cc

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « net/url_request/url_request_netlog_params.cc ('k') | remoting/protocol/ssl_hmac_channel_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_throttler_entry.cc
diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc
index fdaaf7ff0d89f9a612521e4ab61f7cf6bc589242..308ddc27ab5b85221c618cad968912f870077a4e 100644
--- a/net/url_request/url_request_throttler_entry.cc
+++ b/net/url_request/url_request_throttler_entry.cc
@@ -52,7 +52,7 @@ const char URLRequestThrottlerEntry::kExponentialThrottlingDisableValue[] =
"disable";
// Returns NetLog parameters when a request is rejected by throttling.
-base::Value* NetLogRejectedRequestCallback(
+scoped_ptr<base::Value> NetLogRejectedRequestCallback(
const std::string* url_id,
int num_failures,
const base::TimeDelta& release_after,
@@ -62,7 +62,7 @@ base::Value* NetLogRejectedRequestCallback(
dict->SetInteger("num_failures", num_failures);
dict->SetInteger("release_after_ms",
static_cast<int>(release_after.InMilliseconds()));
- return dict.release();
+ return dict.Pass();
}
URLRequestThrottlerEntry::URLRequestThrottlerEntry(
@@ -158,12 +158,10 @@ bool URLRequestThrottlerEntry::ShouldRejectRequest(
if (!is_backoff_disabled_ && !ExplicitUserRequest(request.load_flags()) &&
(!network_delegate || network_delegate->CanThrottleRequest(request)) &&
GetBackoffEntry()->ShouldRejectRequest()) {
- net_log_.AddEvent(
- NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
- base::Bind(&NetLogRejectedRequestCallback,
- &url_id_,
- GetBackoffEntry()->failure_count(),
- GetBackoffEntry()->GetTimeUntilRelease()));
+ net_log_.AddEvent(NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
+ base::Bind(NetLogRejectedRequestCallback, &url_id_,
+ GetBackoffEntry()->failure_count(),
+ GetBackoffEntry()->GetTimeUntilRelease()));
reject_request = true;
}
« no previous file with comments | « net/url_request/url_request_netlog_params.cc ('k') | remoting/protocol/ssl_hmac_channel_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698