summaryrefslogtreecommitdiffstats
path: root/net/base/net_log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/net_log.cc')
-rw-r--r--net/base/net_log.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index 372930d..b811db4 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -32,7 +32,7 @@ Value* BytesTransferredCallback(int byte_count,
Value* SourceEventParametersCallback(const NetLog::Source source,
NetLog::LogLevel /* log_level */) {
- if (!source.is_valid())
+ if (!source.IsValid())
return NULL;
DictionaryValue* event_params = new DictionaryValue();
source.AddToEventParameters(event_params);
@@ -73,6 +73,18 @@ Value* NetLogString16Callback(const char* name,
} // namespace
+const uint32 NetLog::Source::kInvalidId = 0;
+
+NetLog::Source::Source() : type(SOURCE_NONE), id(kInvalidId) {
+}
+
+NetLog::Source::Source(SourceType type, uint32 id) : type(type), id(id) {
+}
+
+bool NetLog::Source::IsValid() const {
+ return id != kInvalidId;
+}
+
void NetLog::Source::AddToEventParameters(DictionaryValue* event_params) const {
DictionaryValue* dict = new DictionaryValue();
dict->SetInteger("type", static_cast<int>(type));