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
3 // found in the LICENSE file.
5 #include "ppapi/c/pp_bool.h"
6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_flash_message_loop_api.h"
9 #include "ppapi/thunk/resource_creation_api.h"
10 #include "ppapi/thunk/thunk.h"
17 PP_Resource
Create(PP_Instance instance
) {
18 EnterResourceCreation
enter(instance
);
21 return enter
.functions()->CreateFlashMessageLoop(instance
);
24 PP_Bool
IsFlashMessageLoop(PP_Resource resource
) {
25 EnterResource
<PPB_Flash_MessageLoop_API
> enter(resource
, false);
26 return PP_FromBool(enter
.succeeded());
29 int32_t Run(PP_Resource resource
) {
30 EnterResource
<PPB_Flash_MessageLoop_API
> enter(resource
, true);
32 return PP_ERROR_BADRESOURCE
;
33 return enter
.object()->Run();
36 void Quit(PP_Resource resource
) {
37 EnterResource
<PPB_Flash_MessageLoop_API
> enter(resource
, true);
38 if (enter
.succeeded())
39 enter
.object()->Quit();
42 const PPB_Flash_MessageLoop g_ppb_flash_message_loop_thunk
= {
51 const PPB_Flash_MessageLoop_0_1
* GetPPB_Flash_MessageLoop_0_1_Thunk() {
52 return &g_ppb_flash_message_loop_thunk
;