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

Unified Diff: net/http/http_request_headers.h

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_proxy_client_socket.cc ('k') | net/http/http_request_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_request_headers.h
===================================================================
--- net/http/http_request_headers.h (revision 141317)
+++ net/http/http_request_headers.h (working copy)
@@ -17,6 +17,7 @@
#include "base/basictypes.h"
#include "base/string_piece.h"
#include "net/base/net_export.h"
+#include "net/base/net_log.h"
namespace net {
@@ -145,6 +146,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 +167,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);
};
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/http/http_request_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698