| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/client/plugin/pepper_util.h" | 5 #include "remoting/client/plugin/pepper_util.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool PpAddressToSocketAddress(const PP_NetAddress_Private& pp_address, | 60 bool PpAddressToSocketAddress(const PP_NetAddress_Private& pp_address, |
| 61 talk_base::SocketAddress* address) { | 61 talk_base::SocketAddress* address) { |
| 62 uint8_t addr_storage[16]; | 62 uint8_t addr_storage[16]; |
| 63 bool result = pp::NetAddressPrivate::GetAddress( | 63 bool result = pp::NetAddressPrivate::GetAddress( |
| 64 pp_address, &addr_storage, sizeof(addr_storage)); | 64 pp_address, &addr_storage, sizeof(addr_storage)); |
| 65 | 65 |
| 66 if (result) { | 66 if (result) { |
| 67 switch (pp::NetAddressPrivate::GetFamily(pp_address)) { | 67 switch (pp::NetAddressPrivate::GetFamily(pp_address)) { |
| 68 case PP_NETADDRESSFAMILY_IPV4: | 68 case PP_NETADDRESSFAMILY_PRIVATE_IPV4: |
| 69 address->SetIP(talk_base::IPAddress( | 69 address->SetIP(talk_base::IPAddress( |
| 70 *reinterpret_cast<in_addr*>(addr_storage))); | 70 *reinterpret_cast<in_addr*>(addr_storage))); |
| 71 break; | 71 break; |
| 72 case PP_NETADDRESSFAMILY_IPV6: | 72 case PP_NETADDRESSFAMILY_PRIVATE_IPV6: |
| 73 address->SetIP(talk_base::IPAddress( | 73 address->SetIP(talk_base::IPAddress( |
| 74 *reinterpret_cast<in6_addr*>(addr_storage))); | 74 *reinterpret_cast<in6_addr*>(addr_storage))); |
| 75 break; | 75 break; |
| 76 default: | 76 default: |
| 77 result = false; | 77 result = false; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 if (!result) { | 81 if (!result) { |
| 82 LOG(WARNING) << "Failed to convert address: " | 82 LOG(WARNING) << "Failed to convert address: " |
| 83 << pp::NetAddressPrivate::Describe(pp_address, true); | 83 << pp::NetAddressPrivate::Describe(pp_address, true); |
| 84 } else { | 84 } else { |
| 85 address->SetPort(pp::NetAddressPrivate::GetPort(pp_address)); | 85 address->SetPort(pp::NetAddressPrivate::GetPort(pp_address)); |
| 86 } | 86 } |
| 87 return result; | 87 return result; |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace remoting | 90 } // namespace remoting |
| OLD | NEW |