summaryrefslogtreecommitdiffstats
path: root/net/http/http_net_log_params.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 20:21:31 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-18 20:21:31 +0000
commitb104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17 (patch)
tree0d35c3f624aec7c6de8824fab2b9521bfff1dbff /net/http/http_net_log_params.cc
parentd13509f32546e26332733ac6153d359fbd566eaa (diff)
downloadchromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.zip
chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.gz
chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.bz2
FBTF: Monster ctor patch after changing heuristics in clang plugin.
(Only 916k this time off Debug Linux .a files) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3814013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_net_log_params.cc')
-rw-r--r--net/http/http_net_log_params.cc59
1 files changed, 59 insertions, 0 deletions
diff --git a/net/http/http_net_log_params.cc b/net/http/http_net_log_params.cc
new file mode 100644
index 0000000..989d30d
--- /dev/null
+++ b/net/http/http_net_log_params.cc
@@ -0,0 +1,59 @@
+// 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