Index: net/base/net_log.h |
=================================================================== |
--- net/base/net_log.h (revision 48758) |
+++ net/base/net_log.h (working copy) |
@@ -53,7 +53,7 @@ |
// The "source" identifies the entity that generated the log message. |
enum SourceType { |
-#define SOURCE_TYPE(label) SOURCE_ ## label, |
+#define SOURCE_TYPE(label, value) SOURCE_ ## label = value, |
#include "net/base/net_log_source_type_list.h" |
#undef SOURCE_TYPE |
}; |
@@ -206,6 +206,25 @@ |
const int value_; |
}; |
+// NetLogSourceParameter is a subclass of EventParameters that encapsulates a |
+// single NetLog::Source parameter. |
+class NetLogSourceParameter : public NetLog::EventParameters { |
+ public: |
+ // |name| must be a string literal. |
+ NetLogSourceParameter(const char* name, const NetLog::Source& value) |
+ : name_(name), value_(value) {} |
+ |
+ const NetLog::Source& value() const { |
+ return value_; |
+ } |
+ |
+ virtual Value* ToValue() const; |
+ |
+ private: |
+ const char* name_; |
+ const NetLog::Source value_; |
+}; |
+ |
} // namespace net |
#endif // NET_BASE_NET_LOG_H_ |