| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ppb_messaging.h" | 5 #include "ppapi/c/ppb_messaging.h" |
| 6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/thunk.h" | 7 #include "ppapi/thunk/thunk.h" |
| 8 #include "ppapi/thunk/ppb_instance_api.h" | 8 #include "ppapi/thunk/ppb_instance_api.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| 11 namespace thunk { | 11 namespace thunk { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 void PostMessage(PP_Instance instance, PP_Var message) { | 15 void PostMessage(PP_Instance instance, PP_Var message) { |
| 16 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); | 16 EnterFunction<PPB_Instance_FunctionAPI> enter(instance, true); |
| 17 if (enter.succeeded()) | 17 if (enter.succeeded()) |
| 18 enter.functions()->PostMessage(instance, message); | 18 enter.functions()->PostMessage(instance, message); |
| 19 } | 19 } |
| 20 | 20 |
| 21 const PPB_Messaging g_ppb_messaging_thunk = { | 21 const PPB_Messaging g_ppb_messaging_thunk = { |
| 22 &PostMessage | 22 &PostMessage |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 const PPB_Messaging* GetPPB_Messaging_Thunk() { | 27 const PPB_Messaging_1_0* GetPPB_Messaging_1_0_Thunk() { |
| 28 return &g_ppb_messaging_thunk; | 28 return &g_ppb_messaging_thunk; |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace thunk | 31 } // namespace thunk |
| 32 } // namespace ppapi | 32 } // namespace ppapi |
| OLD | NEW |