Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: net/base/net_log.cc

Issue 10546151: A pair of NetLog changes for ongoing refactoring: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/base/net_log.h ('K') | « net/base/net_log.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log.cc
===================================================================
--- net/base/net_log.cc (revision 141814)
+++ net/base/net_log.cc (working copy)
@@ -40,6 +40,8 @@
Value* SourceEventParametersCallback(const NetLog::Source source,
NetLog::LogLevel /* log_level */) {
+ if (!source.is_valid())
+ return NULL;
DictionaryValue* event_params = new DictionaryValue();
source.AddToEventParameters(event_params);
return event_params;
@@ -61,6 +63,14 @@
return event_params;
}
+Value* NetLogString16Callback(const char* name,
+ const string16* value,
+ NetLog::LogLevel /* log_level */) {
+ DictionaryValue* event_params = new DictionaryValue();
+ event_params->SetString(name, *value);
+ return event_params;
+}
+
} // namespace
Value* NetLog::Source::ToValue() const {
@@ -279,6 +289,13 @@
return base::Bind(&NetLogStringCallback, name, value);
}
+// static
+NetLog::ParametersCallback NetLog::StringCallback(const char* name,
+ const string16* value) {
+ DCHECK(value);
+ return base::Bind(&NetLogString16Callback, name, value);
+}
+
void NetLog::OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level) {
DCHECK(!observer->net_log_);
observer->net_log_ = this;
« net/base/net_log.h ('K') | « net/base/net_log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698