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/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
9 #include "ppapi/thunk/ppb_transport_api.h" | 9 #include "ppapi/thunk/ppb_transport_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
11 | 11 |
12 namespace ppapi { | 12 namespace ppapi { |
13 namespace thunk { | 13 namespace thunk { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 typedef EnterResource<PPB_Transport_API> EnterTransport; | 17 typedef EnterResource<PPB_Transport_API> EnterTransport; |
18 | 18 |
19 PP_Resource Create(PP_Instance instance, const char* name, | 19 PP_Resource Create(PP_Instance instance, const char* name, |
20 PP_TransportType type) { | 20 PP_TransportType type) { |
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()->CreateTransport(instance, name, type); | 24 return enter.functions()->CreateTransport(instance, name, type); |
25 } | 25 } |
26 | 26 |
27 PP_Bool IsTransport(PP_Resource resource) { | 27 PP_Bool IsTransport(PP_Resource resource) { |
28 EnterTransport enter(resource, false); | 28 EnterTransport enter(resource, false); |
29 return PP_FromBool(enter.succeeded()); | 29 return PP_FromBool(enter.succeeded()); |
30 } | 30 } |
31 | 31 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 }; | 103 }; |
104 | 104 |
105 } // namespace | 105 } // namespace |
106 | 106 |
107 const PPB_Transport_Dev_0_7* GetPPB_Transport_Dev_0_7_Thunk() { | 107 const PPB_Transport_Dev_0_7* GetPPB_Transport_Dev_0_7_Thunk() { |
108 return &g_ppb_transport_thunk; | 108 return &g_ppb_transport_thunk; |
109 } | 109 } |
110 | 110 |
111 } // namespace thunk | 111 } // namespace thunk |
112 } // namespace ppapi | 112 } // namespace ppapi |
OLD | NEW |