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

Unified Diff: net/base/address_list.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/address_list.cc
===================================================================
--- net/base/address_list.cc (revision 141407)
+++ net/base/address_list.cc (working copy)
@@ -5,6 +5,7 @@
#include "net/base/address_list.h"
#include "base/logging.h"
+#include "base/values.h"
#include "net/base/net_util.h"
#include "net/base/sys_addrinfo.h"
@@ -59,11 +60,21 @@
set_canonical_name(front().ToStringWithoutPort());
}
+base::Value* AddressList::NetLogCallback(NetLog::LogLevel log_level) const {
+ DictionaryValue* dict = new DictionaryValue();
+ ListValue* list = new ListValue();
+
+ for (AddressList::const_iterator it = begin(); it != end(); ++it)
+ list->Append(Value::CreateStringValue(it->ToString()));
+
+ dict->Set("address_list", list);
+ return dict;
+}
+
void SetPortOnAddressList(uint16 port, AddressList* list) {
DCHECK(list);
- for (AddressList::iterator it = list->begin(); it != list->end(); ++it) {
+ for (AddressList::iterator it = list->begin(); it != list->end(); ++it)
*it = IPEndPoint(it->address(), port);
- }
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698