diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-22 00:36:46 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-22 00:36:46 +0000 |
commit | 92056b95525a92217684e0b3df68cf371d77fd55 (patch) | |
tree | 0d50a952b902b3afda45064078e7b7316facba80 /chrome/browser/dom_ui | |
parent | 950e1eb9ffe522a8acec921203182f5765461a2f (diff) | |
download | chromium_src-92056b95525a92217684e0b3df68cf371d77fd55.zip chromium_src-92056b95525a92217684e0b3df68cf371d77fd55.tar.gz chromium_src-92056b95525a92217684e0b3df68cf371d77fd55.tar.bz2 |
Address a TODO about not duplicating the name --> value mapping for NetLog::Source.
Review URL: http://codereview.chromium.org/2131024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/net_internals_ui.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/net_internals_ui.cc b/chrome/browser/dom_ui/net_internals_ui.cc index c9af90a..9c2611d 100644 --- a/chrome/browser/dom_ui/net_internals_ui.cc +++ b/chrome/browser/dom_ui/net_internals_ui.cc @@ -578,18 +578,13 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( // Tell the javascript about the relationship between source type enums and // their symbolic name. - // TODO(eroman): Don't duplicate the values, it will never stay up to date! { DictionaryValue* dict = new DictionaryValue(); - dict->SetInteger(L"NONE", net::NetLog::SOURCE_NONE); - dict->SetInteger(L"URL_REQUEST", net::NetLog::SOURCE_URL_REQUEST); - dict->SetInteger(L"SOCKET_STREAM", net::NetLog::SOURCE_SOCKET_STREAM); - dict->SetInteger(L"INIT_PROXY_RESOLVER", - net::NetLog::SOURCE_INIT_PROXY_RESOLVER); - dict->SetInteger(L"CONNECT_JOB", net::NetLog::SOURCE_CONNECT_JOB); - dict->SetInteger(L"SOCKET", net::NetLog::SOURCE_SOCKET); - dict->SetInteger(L"SPDY_SESSION", net::NetLog::SOURCE_SPDY_SESSION); + int i = 0; +#define SOURCE_TYPE(label) dict->SetInteger(ASCIIToWide(# label), i++); +#include "net/base/net_log_source_type_list.h" +#undef SOURCE_TYPE CallJavascriptFunction(L"g_browser.receivedLogSourceTypeConstants", dict); } |