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

Unified Diff: net/http/http_response_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_response_headers.h
===================================================================
--- net/http/http_response_headers.h (revision 140753)
+++ net/http/http_response_headers.h (working copy)
@@ -13,6 +13,7 @@
#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
+#include "net/base/net_log.h"
#include "net/http/http_version.h"
class Pickle;
@@ -21,6 +22,7 @@
namespace base {
class Time;
class TimeDelta;
+class Value;
}
namespace net {
@@ -244,6 +246,17 @@
// Returns true if the response is chunk-encoded.
bool IsChunkEncoded() const;
+ // Returns a Value for use with the NetLog containing the response headers.
eroman 2012/06/06 21:27:11 optional nit: Returns --> Creates (to imply caller
mmenke 2012/06/07 19:20:46 Done.
+ base::Value* NetLogCallback(NetLog::LogLevel log_level) const;
+
+ // Takes in a Value created by the above function, and attempts to extract the
+ // original response headers. Returns a duplicate of the original headers
+ // on success. On failure, returns NULL.
+ // TODO(mmenke): Long term, we want to remove this, and migrate external
+ // consumers to be NetworkDelegates.
+ static scoped_refptr<HttpResponseHeaders> FromNetLogParam(
eroman 2012/06/06 21:27:11 nit: for consistency with the other converters, I
mmenke 2012/06/07 19:20:46 Done.
+ const base::Value* event_param);
+
// Returns the HTTP response code. This is 0 if the response code text seems
// to exist but could not be parsed. Otherwise, it defaults to 200 if the
// response code is not found in the raw headers.

Powered by Google App Engine
This is Rietveld 408576698