summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 19:28:09 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 19:28:09 +0000
commitec11be60eaf6e832219328ea18656c558dec3040 (patch)
tree1d8a6710f277a55b4743fbc54c8554abf3164669 /net/url_request
parent9bb75ccc56cdb94a9778dcef26be3de97808f3ce (diff)
downloadchromium_src-ec11be60eaf6e832219328ea18656c558dec3040.zip
chromium_src-ec11be60eaf6e832219328ea18656c558dec3040.tar.gz
chromium_src-ec11be60eaf6e832219328ea18656c558dec3040.tar.bz2
More cleanup to address TODOs in net_log.h.
* Removes 9 methods: AddEventWithParameters, BeginEventWithParameters, EndEventWithParameters, BeginEventWithString, BeginEventWithInteger, AddEventWithString, AddEventWithInteger, EndEventWithParameters, EndEventWithInteger. This was becoming ridiculous, instead made the EventParameters* a required parameter. * Moves CapturingBoundNetLog / CapturingNetLog to its own file. BUG=37421 Review URL: http://codereview.chromium.org/1746012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 589d81f..bf50655 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -259,8 +259,10 @@ void URLRequest::StartJob(URLRequestJob* job) {
DCHECK(!is_pending_);
DCHECK(!job_);
- net_log_.BeginEventWithString(net::NetLog::TYPE_URL_REQUEST_START,
- "url", original_url().possibly_invalid_spec());
+ net_log_.BeginEvent(
+ net::NetLog::TYPE_URL_REQUEST_START,
+ new net::NetLogStringParameter(
+ "url", original_url().possibly_invalid_spec()));
job_ = job;
job_->SetExtraRequestHeaders(extra_request_headers_);
@@ -367,10 +369,11 @@ void URLRequest::ReceivedRedirect(const GURL& location, bool* defer_redirect) {
void URLRequest::ResponseStarted() {
if (!status_.is_success()) {
- net_log_.EndEventWithInteger(net::NetLog::TYPE_URL_REQUEST_START,
- "net_error", status_.os_error());
+ net_log_.EndEvent(
+ net::NetLog::TYPE_URL_REQUEST_START,
+ new net::NetLogIntegerParameter("net_error", status_.os_error()));
} else {
- net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START);
+ net_log_.EndEvent(net::NetLog::TYPE_URL_REQUEST_START, NULL);
}
URLRequestJob* job = GetJobManager()->MaybeInterceptResponse(this);
@@ -445,8 +448,10 @@ std::string URLRequest::StripPostSpecificHeaders(const std::string& headers) {
int URLRequest::Redirect(const GURL& location, int http_status_code) {
if (net_log_.HasListener()) {
- net_log_.AddEventWithString(net::NetLog::TYPE_URL_REQUEST_REDIRECTED,
- "location", location.possibly_invalid_spec());
+ net_log_.AddEvent(
+ net::NetLog::TYPE_URL_REQUEST_REDIRECTED,
+ new net::NetLogStringParameter(
+ "location", location.possibly_invalid_spec()));
}
if (redirect_limit_ <= 0) {
DLOG(INFO) << "disallowing redirect: exceeds limit";
@@ -512,13 +517,13 @@ void URLRequest::set_context(URLRequestContext* context) {
// If the context this request belongs to has changed, update the tracker.
if (prev_context != context) {
- net_log_.EndEvent(net::NetLog::TYPE_REQUEST_ALIVE);
+ net_log_.EndEvent(net::NetLog::TYPE_REQUEST_ALIVE, NULL);
net_log_ = net::BoundNetLog();
if (context) {
net_log_ = net::BoundNetLog::Make(context->net_log(),
net::NetLog::SOURCE_URL_REQUEST);
- net_log_.BeginEvent(net::NetLog::TYPE_REQUEST_ALIVE);
+ net_log_.BeginEvent(net::NetLog::TYPE_REQUEST_ALIVE, NULL);
}
}
}