diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 20:32:44 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-12 20:32:44 +0000 |
commit | 1ce7b66b8e871fb39633e8dc7547a649f6d60b53 (patch) | |
tree | ef72863fccd02a85a6ae864372bf75ba57d71f9b /net/base | |
parent | 0834a4b75e40256a08e4a0b1bacab2e8b69da665 (diff) | |
download | chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.zip chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.tar.gz chromium_src-1ce7b66b8e871fb39633e8dc7547a649f6d60b53.tar.bz2 |
Render SpdySessionPools on the Data tab and on a new
net-internals tab, with links to the corresponding sources on
the events tab.
Includes a minor cleanup or two relating to unneeded/unused code/headers for the rendering of SocketPools.
BUG=58034
TEST=manual
Review URL: http://codereview.chromium.org/3565015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/net_log.cc | 11 | ||||
-rw-r--r-- | net/base/net_log.h | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/net/base/net_log.cc b/net/base/net_log.cc index 2cc149f..f9f31c7 100644 --- a/net/base/net_log.cc +++ b/net/base/net_log.cc @@ -19,6 +19,12 @@ Value* NetLog::Source::ToValue() const { } // static +std::string NetLog::TickCountToString(const base::TimeTicks& time) { + int64 delta_time = (time - base::TimeTicks()).InMilliseconds(); + return base::Int64ToString(delta_time); +} + +// static const char* NetLog::EventTypeToString(EventType event) { switch (event) { #define EVENT_TYPE(label) case TYPE_ ## label: return #label; @@ -71,10 +77,7 @@ Value* NetLog::EntryToDictionaryValue(net::NetLog::EventType type, bool use_strings) { DictionaryValue* entry_dict = new DictionaryValue(); - // Set the entry time. (Note that we send it as a string since integers - // might overflow). - int64 delta_time = (time - base::TimeTicks()).InMilliseconds(); - entry_dict->SetString("time", base::Int64ToString(delta_time)); + entry_dict->SetString("time", TickCountToString(time)); // Set the entry source. DictionaryValue* source_dict = new DictionaryValue(); diff --git a/net/base/net_log.h b/net/base/net_log.h index c97eb1a..f240105 100644 --- a/net/base/net_log.h +++ b/net/base/net_log.h @@ -130,6 +130,10 @@ class NetLog { // and saving expensive log entries. virtual LogLevel GetLogLevel() const = 0; + // Converts a time to the string format that the NetLog uses to represent + // times. Strings are used since integers may overflow. + static std::string TickCountToString(const base::TimeTicks& time); + // Returns a C-String symbolic name for |event_type|. static const char* EventTypeToString(EventType event_type); |