summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-22 00:36:46 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-22 00:36:46 +0000
commit92056b95525a92217684e0b3df68cf371d77fd55 (patch)
tree0d50a952b902b3afda45064078e7b7316facba80 /net/base
parent950e1eb9ffe522a8acec921203182f5765461a2f (diff)
downloadchromium_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 'net/base')
-rw-r--r--net/base/net_log.h10
-rw-r--r--net/base/net_log_source_type_list.h15
2 files changed, 18 insertions, 7 deletions
diff --git a/net/base/net_log.h b/net/base/net_log.h
index 02f0a4b..619b57b 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -53,13 +53,9 @@ class NetLog {
// The "source" identifies the entity that generated the log message.
enum SourceType {
- SOURCE_NONE,
- SOURCE_URL_REQUEST,
- SOURCE_SOCKET_STREAM,
- SOURCE_INIT_PROXY_RESOLVER,
- SOURCE_CONNECT_JOB,
- SOURCE_SOCKET,
- SOURCE_SPDY_SESSION,
+#define SOURCE_TYPE(label) SOURCE_ ## label,
+#include "net/base/net_log_source_type_list.h"
+#undef SOURCE_TYPE
};
// Identifies the entity that generated this log. The |id| field should
diff --git a/net/base/net_log_source_type_list.h b/net/base/net_log_source_type_list.h
new file mode 100644
index 0000000..9d29826
--- /dev/null
+++ b/net/base/net_log_source_type_list.h
@@ -0,0 +1,15 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// NOTE: No header guards are used, since this file is intended to be expanded
+// directly within a block where the SOURCE_TYPE macro is defined.
+
+SOURCE_TYPE(NONE)
+SOURCE_TYPE(URL_REQUEST)
+SOURCE_TYPE(SOCKET_STREAM)
+SOURCE_TYPE(INIT_PROXY_RESOLVER)
+SOURCE_TYPE(CONNECT_JOB)
+SOURCE_TYPE(SOCKET)
+SOURCE_TYPE(SPDY_SESSION)
+