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

Unified Diff: net/dns/mojo_host_struct_traits.cc

Issue 2675033002: [Media Router] Add MediaSink subtypes (Closed)
Patch Set: resolve code review comments from dcheng Created 3 years, 9 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/dns/mojo_host_struct_traits.cc
diff --git a/net/dns/mojo_host_struct_traits.cc b/net/dns/mojo_host_struct_traits.cc
index 09f167323a1761fd92b6977256f3ab867f8d10f9..ba543ad9b58b1a5dabb00a61aa6bd956549241ff 100644
--- a/net/dns/mojo_host_struct_traits.cc
+++ b/net/dns/mojo_host_struct_traits.cc
@@ -69,6 +69,18 @@ bool StructTraits<net::interfaces::HostResolverRequestInfoDataView,
}
// static
+bool StructTraits<net::interfaces::IPAddressDataView, net::IPAddress>::Read(
+ net::interfaces::IPAddressDataView data,
+ net::IPAddress* out) {
+ std::vector<uint8_t> bytes;
+ if (!data.ReadAddress(&bytes))
+ return false;
+
+ *out = net::IPAddress(bytes);
+ return true;
+}
+
+// static
bool StructTraits<net::interfaces::IPEndPointDataView, net::IPEndPoint>::Read(
net::interfaces::IPEndPointDataView data,
net::IPEndPoint* out) {

Powered by Google App Engine
This is Rietveld 408576698