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

Unified Diff: net/base/net_log.cc

Issue 10539094: NetLogEventParameter to Callback refactoring 1, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix headers 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
Index: net/base/net_log.cc
===================================================================
--- net/base/net_log.cc (revision 141407)
+++ net/base/net_log.cc (working copy)
@@ -55,6 +55,16 @@
return event_params;
}
+Value* SingleStringCallback(const char* name,
+ const std::string* value,
+ NetLog::LogLevel /* log_level */) {
+ if (!value)
eroman 2012/06/11 23:42:25 Is it necessary to allow this? Seems like passing
mmenke 2012/06/12 00:42:19 You're right, done. Also, noticed other related b
+ return NULL;
+ DictionaryValue* event_params = new DictionaryValue();
+ event_params->SetString(name, *value);
+ return event_params;
+}
+
} // namespace
Value* NetLog::Source::ToValue() const {
@@ -266,6 +276,12 @@
return base::Bind(&SingleIntegerCallback, name, value);
}
+// static
+NetLog::ParametersCallback NetLog::StringCallback(const char* name,
+ const std::string* value) {
+ return base::Bind(&SingleStringCallback, name, value);
+}
+
void NetLog::OnAddObserver(ThreadSafeObserver* observer, LogLevel log_level) {
DCHECK(!observer->net_log_);
observer->net_log_ = this;

Powered by Google App Engine
This is Rietveld 408576698