 Chromium Code Reviews
 Chromium Code Reviews Issue 1405963021:
  Add support for default local address in IpcNetworkManager  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1405963021:
  Add support for default local address in IpcNetworkManager  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: jingle/glue/utils.cc | 
| diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc | 
| index 4c9f4b681029ab9c8cc4df2bd18e834335eb3107..0872d31748ccf960e5bc114e6664b4e3e0c3c629 100644 | 
| --- a/jingle/glue/utils.cc | 
| +++ b/jingle/glue/utils.cc | 
| @@ -12,6 +12,7 @@ | 
| #include "net/base/ip_endpoint.h" | 
| #include "net/base/net_util.h" | 
| #include "third_party/webrtc/base/byteorder.h" | 
| +#include "third_party/webrtc/base/ipaddress.h" | 
| #include "third_party/webrtc/base/socketaddress.h" | 
| #include "third_party/webrtc/p2p/base/candidate.h" | 
| @@ -33,6 +34,24 @@ bool SocketAddressToIPEndPoint(const rtc::SocketAddress& address, | 
| ip_endpoint->FromSockAddr(reinterpret_cast<sockaddr*>(&addr), size); | 
| } | 
| +bool IPAddressNumberToIPAddress(const net::IPAddressNumber& ip_address_number, | 
| 
Sergey Ulanov
2015/11/11 21:10:02
Don't really need to return bool here. rtc::IPAddr
 | 
| + rtc::IPAddress* ip_address) { | 
| + if (ip_address_number.size() == net::kIPv4AddressSize) { | 
| + uint32 address; | 
| 
Sergey Ulanov
2015/11/11 21:10:02
Please change this to uint32_t
 | 
| + memcpy(&address, &ip_address_number[0], sizeof(uint32)); | 
| + address = rtc::NetworkToHost32(address); | 
| + *ip_address = rtc::IPAddress(address); | 
| + return true; | 
| + } | 
| + if (ip_address_number.size() == net::kIPv6AddressSize) { | 
| + in6_addr address; | 
| + memcpy(&address, &ip_address_number[0], sizeof(in6_addr)); | 
| + *ip_address = rtc::IPAddress(address); | 
| + return true; | 
| + } | 
| + return false; | 
| +} | 
| + | 
| std::string SerializeP2PCandidate(const cricket::Candidate& candidate) { | 
| // TODO(sergeyu): Use SDP to format candidates? | 
| base::DictionaryValue value; |