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

Unified Diff: net/url_request/url_request.cc

Issue 10532121: NetLogEventParameter to Callback refactoring 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Update includes Created 8 years, 6 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 | « no previous file | net/url_request/url_request_http_job.cc » ('j') | net/url_request/url_request_http_job.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
===================================================================
--- net/url_request/url_request.cc (revision 141814)
+++ net/url_request/url_request.cc (working copy)
@@ -422,8 +422,9 @@
SetUnblockedOnDelegate();
if (error != OK) {
+ std::string source("delegate");
net_log_.AddEvent(NetLog::TYPE_CANCELLED,
- make_scoped_refptr(new NetLogStringParameter("source", "delegate")));
+ NetLog::StringCallback("source", &source));
eroman 2012/06/13 18:48:11 I wander if we want to introduce a: NetLog::CSt
mmenke 2012/06/13 19:32:09 I don't think we need it yet, though don't feel st
StartJob(new URLRequestErrorJob(this, error));
} else if (!delegate_redirect_url_.is_empty()) {
GURL new_url;
@@ -566,10 +567,11 @@
}
void URLRequest::NotifyResponseStarted() {
- scoped_refptr<NetLog::EventParameters> params;
+ int net_error = OK;
if (!status_.is_success())
- params = new NetLogIntegerParameter("net_error", status_.error());
- net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_START_JOB, params);
+ net_error = status_.error();
+ net_log_.EndEventWithNetErrorCode(NetLog::TYPE_URL_REQUEST_START_JOB,
+ net_error);
URLRequestJob* job =
URLRequestJobManager::GetInstance()->MaybeInterceptResponse(this);
@@ -633,7 +635,7 @@
// Close the current URL_REQUEST_START_JOB, since we will be starting a new
// one.
- net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_START_JOB, NULL);
+ net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_START_JOB);
OrphanJob();
@@ -661,8 +663,7 @@
if (net_log_.IsLoggingAllEvents()) {
net_log_.AddEvent(
NetLog::TYPE_URL_REQUEST_REDIRECTED,
- make_scoped_refptr(new NetLogStringParameter(
- "location", location.possibly_invalid_spec())));
+ NetLog::StringCallback("location", &location.possibly_invalid_spec()));
}
if (context_ && context_->network_delegate())
@@ -757,7 +758,7 @@
if (context) {
net_log_ = BoundNetLog::Make(context->net_log(),
NetLog::SOURCE_URL_REQUEST);
- net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE);
}
}
}
@@ -906,7 +907,7 @@
void URLRequest::SetBlockedOnDelegate() {
blocked_on_delegate_ = true;
- net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL);
+ net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE);
}
void URLRequest::SetUnblockedOnDelegate() {
@@ -914,7 +915,7 @@
return;
blocked_on_delegate_ = false;
load_state_param_.clear();
- net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE, NULL);
+ net_log_.EndEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE);
}
void URLRequest::set_stack_trace(const base::debug::StackTrace& stack_trace) {
« no previous file with comments | « no previous file | net/url_request/url_request_http_job.cc » ('j') | net/url_request/url_request_http_job.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698