diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-10 20:20:32 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-10 20:20:32 +0000 |
commit | 3abacd60fa00bc53d4cf3d28352e855d10533ac0 (patch) | |
tree | 444933dd014250163b78713a4e9d7a9ac8d4356b /net/http/http_response_headers.h | |
parent | 8b2d262447607c79fd3b18efa5eb1e5c2efa4cad (diff) | |
download | chromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.zip chromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.tar.gz chromium_src-3abacd60fa00bc53d4cf3d28352e855d10533ac0.tar.bz2 |
Make NetLog take in callbacks that return Values rather
than refcounted objects. Avoids the need to create
classes and copy data. Also no longer get time whenever
an event is logged.
BUG=126243
Review URL: https://chromiumcodereview.appspot.com/10399083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.h')
-rw-r--r-- | net/http/http_response_headers.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h index 6fbc0bb..1490872 100644 --- a/net/http/http_response_headers.h +++ b/net/http/http_response_headers.h @@ -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; @@ -244,6 +245,18 @@ class NET_EXPORT HttpResponseHeaders // Returns true if the response is chunk-encoded. bool IsChunkEncoded() const; + // Creates a Value for use with the NetLog containing the response headers. + base::Value* NetLogCallback(NetLog::LogLevel log_level) const; + + // Takes in a Value created by the above function, and attempts to create a + // copy of the original headers. Returns true on success. On failure, + // clears |http_response_headers|. + // TODO(mmenke): Long term, we want to remove this, and migrate external + // consumers to be NetworkDelegates. + static bool FromNetLogParam( + const base::Value* event_param, + scoped_refptr<HttpResponseHeaders>* http_response_headers); + // 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. |