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/c/pp_completion_callback.h" | 5 #include "ppapi/c/pp_completion_callback.h" |
6 #include "ppapi/c/pp_errors.h" | 6 #include "ppapi/c/pp_errors.h" |
7 #include "ppapi/c/private/ppb_udp_socket_private.h" | 7 #include "ppapi/c/private/ppb_udp_socket_private.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/ppb_udp_socket_private_api.h" | 9 #include "ppapi/thunk/ppb_udp_socket_private_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
11 #include "ppapi/thunk/thunk.h" | 11 #include "ppapi/thunk/thunk.h" |
12 | 12 |
13 namespace ppapi { | 13 namespace ppapi { |
14 namespace thunk { | 14 namespace thunk { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 typedef EnterResource<PPB_UDPSocket_Private_API> EnterUDP; | 18 typedef EnterResource<PPB_UDPSocket_Private_API> EnterUDP; |
19 | 19 |
20 PP_Resource Create(PP_Instance instance) { | 20 PP_Resource Create(PP_Instance instance) { |
21 EnterFunction<ResourceCreationAPI> enter(instance, true); | 21 EnterResourceCreation enter(instance); |
22 if (enter.failed()) | 22 if (enter.failed()) |
23 return 0; | 23 return 0; |
24 return enter.functions()->CreateUDPSocketPrivate(instance); | 24 return enter.functions()->CreateUDPSocketPrivate(instance); |
25 } | 25 } |
26 | 26 |
27 PP_Bool IsUDPSocket(PP_Resource resource) { | 27 PP_Bool IsUDPSocket(PP_Resource resource) { |
28 EnterUDP enter(resource, false); | 28 EnterUDP enter(resource, false); |
29 return PP_FromBool(enter.succeeded()); | 29 return PP_FromBool(enter.succeeded()); |
30 } | 30 } |
31 | 31 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const PPB_UDPSocket_Private_0_2* GetPPB_UDPSocket_Private_0_2_Thunk() { | 108 const PPB_UDPSocket_Private_0_2* GetPPB_UDPSocket_Private_0_2_Thunk() { |
109 return &g_ppb_udp_socket_thunk_0_2; | 109 return &g_ppb_udp_socket_thunk_0_2; |
110 } | 110 } |
111 | 111 |
112 const PPB_UDPSocket_Private_0_3* GetPPB_UDPSocket_Private_0_3_Thunk() { | 112 const PPB_UDPSocket_Private_0_3* GetPPB_UDPSocket_Private_0_3_Thunk() { |
113 return &g_ppb_udp_socket_thunk_0_3; | 113 return &g_ppb_udp_socket_thunk_0_3; |
114 } | 114 } |
115 | 115 |
116 } // namespace thunk | 116 } // namespace thunk |
117 } // namespace ppapi | 117 } // namespace ppapi |
OLD | NEW |