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 "ppapi/cpp/private/net_address_private.h" | 5 #include "ppapi/cpp/private/net_address_private.h" |
6 | 6 |
7 #include "ppapi/c/pp_bool.h" | 7 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
9 #include "ppapi/cpp/module_impl.h" | 9 #include "ppapi/cpp/module_impl.h" |
10 #include "ppapi/cpp/var.h" | 10 #include "ppapi/cpp/var.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 // static | 146 // static |
147 PP_NetAddressFamily_Private NetAddressPrivate::GetFamily( | 147 PP_NetAddressFamily_Private NetAddressPrivate::GetFamily( |
148 const PP_NetAddress_Private& addr) { | 148 const PP_NetAddress_Private& addr) { |
149 if (has_interface<PPB_NetAddress_Private_1_1>()) | 149 if (has_interface<PPB_NetAddress_Private_1_1>()) |
150 return get_interface<PPB_NetAddress_Private_1_1>()->GetFamily(&addr); | 150 return get_interface<PPB_NetAddress_Private_1_1>()->GetFamily(&addr); |
151 if (has_interface<PPB_NetAddress_Private_1_0>()) | 151 if (has_interface<PPB_NetAddress_Private_1_0>()) |
152 return get_interface<PPB_NetAddress_Private_1_0>()->GetFamily(&addr); | 152 return get_interface<PPB_NetAddress_Private_1_0>()->GetFamily(&addr); |
153 return PP_NETADDRESSFAMILY_UNSPECIFIED; | 153 return PP_NETADDRESSFAMILY_PRIVATE_UNSPECIFIED; |
154 } | 154 } |
155 | 155 |
156 // static | 156 // static |
157 uint16_t NetAddressPrivate::GetPort(const PP_NetAddress_Private& addr) { | 157 uint16_t NetAddressPrivate::GetPort(const PP_NetAddress_Private& addr) { |
158 if (has_interface<PPB_NetAddress_Private_1_1>()) | 158 if (has_interface<PPB_NetAddress_Private_1_1>()) |
159 return get_interface<PPB_NetAddress_Private_1_1>()->GetPort(&addr); | 159 return get_interface<PPB_NetAddress_Private_1_1>()->GetPort(&addr); |
160 if (has_interface<PPB_NetAddress_Private_1_0>()) | 160 if (has_interface<PPB_NetAddress_Private_1_0>()) |
161 return get_interface<PPB_NetAddress_Private_1_0>()->GetPort(&addr); | 161 return get_interface<PPB_NetAddress_Private_1_0>()->GetPort(&addr); |
162 return 0; | 162 return 0; |
163 } | 163 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 struct PP_NetAddress_Private* addr_out) { | 209 struct PP_NetAddress_Private* addr_out) { |
210 if (has_interface<PPB_NetAddress_Private_1_1>()) { | 210 if (has_interface<PPB_NetAddress_Private_1_1>()) { |
211 get_interface<PPB_NetAddress_Private_1_1>()->CreateFromIPv6Address( | 211 get_interface<PPB_NetAddress_Private_1_1>()->CreateFromIPv6Address( |
212 ip, scope_id, port, addr_out); | 212 ip, scope_id, port, addr_out); |
213 return true; | 213 return true; |
214 } | 214 } |
215 return false; | 215 return false; |
216 } | 216 } |
217 | 217 |
218 } // namespace pp | 218 } // namespace pp |
OLD | NEW |