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

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: Update comments 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698