| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_HTTP_HTTP_NET_LOG_PARAMS_H_ | 5 #ifndef NET_HTTP_HTTP_NET_LOG_PARAMS_H_ |
| 6 #define NET_HTTP_HTTP_NET_LOG_PARAMS_H_ | 6 #define NET_HTTP_HTTP_NET_LOG_PARAMS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 while (iterator.GetNext()) { | 34 while (iterator.GetNext()) { |
| 35 headers->Append( | 35 headers->Append( |
| 36 new StringValue(base::StringPrintf("%s: %s", | 36 new StringValue(base::StringPrintf("%s: %s", |
| 37 iterator.name().c_str(), | 37 iterator.name().c_str(), |
| 38 iterator.value().c_str()))); | 38 iterator.value().c_str()))); |
| 39 } | 39 } |
| 40 dict->Set("headers", headers); | 40 dict->Set("headers", headers); |
| 41 return dict; | 41 return dict; |
| 42 } | 42 } |
| 43 | 43 |
| 44 const HttpRequestHeaders& GetHeaders() const { |
| 45 return headers_; |
| 46 } |
| 47 |
| 44 private: | 48 private: |
| 45 ~NetLogHttpRequestParameter() {} | 49 ~NetLogHttpRequestParameter() {} |
| 46 | 50 |
| 47 const std::string line_; | 51 const std::string line_; |
| 48 HttpRequestHeaders headers_; | 52 HttpRequestHeaders headers_; |
| 49 | 53 |
| 50 DISALLOW_COPY_AND_ASSIGN(NetLogHttpRequestParameter); | 54 DISALLOW_COPY_AND_ASSIGN(NetLogHttpRequestParameter); |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 class NetLogHttpResponseParameter : public NetLog::EventParameters { | 57 class NetLogHttpResponseParameter : public NetLog::EventParameters { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 std::string value; | 69 std::string value; |
| 66 while (headers_->EnumerateHeaderLines(&iterator, &name, &value)) { | 70 while (headers_->EnumerateHeaderLines(&iterator, &name, &value)) { |
| 67 headers->Append( | 71 headers->Append( |
| 68 new StringValue(base::StringPrintf("%s: %s", name.c_str(), | 72 new StringValue(base::StringPrintf("%s: %s", name.c_str(), |
| 69 value.c_str()))); | 73 value.c_str()))); |
| 70 } | 74 } |
| 71 dict->Set("headers", headers); | 75 dict->Set("headers", headers); |
| 72 return dict; | 76 return dict; |
| 73 } | 77 } |
| 74 | 78 |
| 79 const HttpResponseHeaders& GetHeaders() const { |
| 80 return *headers_; |
| 81 } |
| 82 |
| 75 private: | 83 private: |
| 76 ~NetLogHttpResponseParameter() {} | 84 ~NetLogHttpResponseParameter() {} |
| 77 | 85 |
| 78 const scoped_refptr<HttpResponseHeaders> headers_; | 86 const scoped_refptr<HttpResponseHeaders> headers_; |
| 79 | 87 |
| 80 DISALLOW_COPY_AND_ASSIGN(NetLogHttpResponseParameter); | 88 DISALLOW_COPY_AND_ASSIGN(NetLogHttpResponseParameter); |
| 81 }; | 89 }; |
| 82 | 90 |
| 83 } // namespace net | 91 } // namespace net |
| 84 | 92 |
| 85 #endif // NET_HTTP_HTTP_NET_LOG_PARAMS_H_ | 93 #endif // NET_HTTP_HTTP_NET_LOG_PARAMS_H_ |
| 86 | 94 |
| OLD | NEW |