Chromium Code Reviews| Index: net/http/http_request_headers.h |
| =================================================================== |
| --- net/http/http_request_headers.h (revision 140753) |
| +++ net/http/http_request_headers.h (working copy) |
| @@ -17,7 +17,12 @@ |
| #include "base/basictypes.h" |
| #include "base/string_piece.h" |
| #include "net/base/net_export.h" |
| +#include "net/base/net_log.h" |
| +namespace base { |
| + class Value; |
|
eroman
2012/06/06 21:27:11
nit: de-indent. Isn't value already declared in ne
mmenke
2012/06/07 19:20:46
Yea, it is. Removed.
|
| +} |
| + |
| namespace net { |
| class NET_EXPORT HttpRequestHeaders { |
| @@ -145,6 +150,20 @@ |
| // line, and adds the trailing "\r\n". |
| std::string ToString() const; |
| + // Takes in the request line and returns a Value for use with the NetLog |
| + // containing both the request line and all headers fields. |
| + base::Value* NetLogCallback(const std::string* request_line, |
| + NetLog::LogLevel log_level) const; |
| + |
| + // Takes in a Value created by the above function, and attempts to extract the |
| + // request line and create a copy of the original headers. Returns true on |
| + // success. On failure, clears |headers| and |request_line|. |
| + // TODO(mmenke): Long term, we want to remove this, and migrate external |
| + // consumers to be NetworkDelegates. |
| + static bool FromNetLogParam(const base::Value* event_param, |
| + HttpRequestHeaders* headers, |
| + std::string* request_line); |
| + |
| private: |
| HeaderVector::iterator FindHeader(const base::StringPiece& key); |
| HeaderVector::const_iterator FindHeader(const base::StringPiece& key) const; |
| @@ -152,9 +171,9 @@ |
| HeaderVector headers_; |
| // Allow the copy construction and operator= to facilitate copying in |
| - // HttpRequestInfo. |
| + // HttpRequestHeaders. |
| // TODO(willchan): Investigate to see if we can remove the need to copy |
| - // HttpRequestInfo. |
| + // HttpRequestHeaders. |
| // DISALLOW_COPY_AND_ASSIGN(HttpRequestHeaders); |
| }; |