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

Unified Diff: net/http/http_net_log_params.cc

Issue 10399083: Make NetLog take in callbacks that return Values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix merge error 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 | « net/http/http_net_log_params.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_net_log_params.cc
===================================================================
--- net/http/http_net_log_params.cc (revision 141317)
+++ net/http/http_net_log_params.cc (working copy)
@@ -1,59 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/http/http_net_log_params.h"
-
-#include "base/stringprintf.h"
-#include "base/values.h"
-#include "net/http/http_response_headers.h"
-
-namespace net {
-
-NetLogHttpRequestParameter::NetLogHttpRequestParameter(
- const std::string& line,
- const HttpRequestHeaders& headers)
- : line_(line) {
- headers_.CopyFrom(headers);
-}
-
-Value* NetLogHttpRequestParameter::ToValue() const {
- DictionaryValue* dict = new DictionaryValue();
- dict->SetString("line", line_);
- ListValue* headers = new ListValue();
- HttpRequestHeaders::Iterator iterator(headers_);
- while (iterator.GetNext()) {
- headers->Append(
- new StringValue(base::StringPrintf("%s: %s",
- iterator.name().c_str(),
- iterator.value().c_str())));
- }
- dict->Set("headers", headers);
- return dict;
-}
-
-NetLogHttpRequestParameter::~NetLogHttpRequestParameter() {}
-
-NetLogHttpResponseParameter::NetLogHttpResponseParameter(
- const scoped_refptr<HttpResponseHeaders>& headers)
- : headers_(headers) {}
-
-Value* NetLogHttpResponseParameter::ToValue() const {
- DictionaryValue* dict = new DictionaryValue();
- ListValue* headers = new ListValue();
- headers->Append(new StringValue(headers_->GetStatusLine()));
- void* iterator = NULL;
- std::string name;
- std::string value;
- while (headers_->EnumerateHeaderLines(&iterator, &name, &value)) {
- headers->Append(
- new StringValue(base::StringPrintf("%s: %s", name.c_str(),
- value.c_str())));
- }
- dict->Set("headers", headers);
- return dict;
-}
-
-NetLogHttpResponseParameter::~NetLogHttpResponseParameter() {}
-
-} // namespace net
« no previous file with comments | « net/http/http_net_log_params.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698