summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/net_internals_ui.cc
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 13:55:10 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 13:55:10 +0000
commit9319035b01befc8d59c9c1c7f9d83fbe15b0ba79 (patch)
tree4f871697a10d9e6b46630571edb298982b550d42 /chrome/browser/dom_ui/net_internals_ui.cc
parent0e6fd884e68670a70a857d092b79fb7e71bf3856 (diff)
downloadchromium_src-9319035b01befc8d59c9c1c7f9d83fbe15b0ba79.zip
chromium_src-9319035b01befc8d59c9c1c7f9d83fbe15b0ba79.tar.gz
chromium_src-9319035b01befc8d59c9c1c7f9d83fbe15b0ba79.tar.bz2
Redirects NetLog output to the log file, when the command line
option "--log-net-log" is used. BUG= 50987 TEST= Run "chrome --log-net-log --enable-logging --log-level=0" And then check to make sure the log contains the NetLog events. Review URL: http://codereview.chromium.org/3040051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/net_internals_ui.cc')
-rw-r--r--chrome/browser/dom_ui/net_internals_ui.cc43
1 files changed, 8 insertions, 35 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc
index d64e68c..a3cfed4 100644
--- a/chrome/browser/dom_ui/net_internals_ui.cc
+++ b/chrome/browser/dom_ui/net_internals_ui.cc
@@ -78,35 +78,6 @@ disk_cache::Backend* GetDiskCacheBackend(URLRequestContext* context) {
return http_cache->GetCurrentBackend();
}
-// Serializes the specified event to a DictionaryValue.
-Value* EntryToDictionaryValue(net::NetLog::EventType type,
- const base::TimeTicks& time,
- const net::NetLog::Source& source,
- net::NetLog::EventPhase phase,
- net::NetLog::EventParameters* params) {
- DictionaryValue* entry_dict = new DictionaryValue();
-
- // Set the entry time. (Note that we send it as a string since integers
- // might overflow).
- entry_dict->SetString("time", TickCountToString(time));
-
- // Set the entry source.
- DictionaryValue* source_dict = new DictionaryValue();
- source_dict->SetInteger("id", source.id);
- source_dict->SetInteger("type", static_cast<int>(source.type));
- entry_dict->Set("source", source_dict);
-
- // Set the event info.
- entry_dict->SetInteger("type", static_cast<int>(type));
- entry_dict->SetInteger("phase", static_cast<int>(phase));
-
- // Set the event-specific parameters.
- if (params)
- entry_dict->Set("params", params->ToValue());
-
- return entry_dict;
-}
-
Value* ExperimentToValue(const ConnectionTester::Experiment& experiment) {
DictionaryValue* dict = new DictionaryValue();
@@ -734,11 +705,12 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetPassiveLogEntries(
ListValue* list = new ListValue();
for (size_t i = 0; i < passive_entries.size(); ++i) {
const PassiveLogCollector::Entry& e = passive_entries[i];
- list->Append(EntryToDictionaryValue(e.type,
- e.time,
- e.source,
- e.phase,
- e.params));
+ list->Append(net::NetLog::EntryToDictionaryValue(e.type,
+ e.time,
+ e.source,
+ e.phase,
+ e.params,
+ false));
}
CallJavascriptFunction(L"g_browser.receivedPassiveLogEntries", list);
@@ -794,7 +766,8 @@ void NetInternalsMessageHandler::IOThreadImpl::OnAddEntry(
CallJavascriptFunction(
L"g_browser.receivedLogEntry",
- EntryToDictionaryValue(type, time, source, phase, params));
+ net::NetLog::EntryToDictionaryValue(type, time, source, phase, params,
+ false));
}
void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTestSuite() {