Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: ppapi/thunk/ppb_flash_message_loop_thunk.cc

Issue 9188045: Introduce PPB_Flash_MessageLoop interface for Pepper Flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use base::Callback instead of PP_CompletionCallback in RunFromHostProxy(). Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_flash_message_loop_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
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"
11
12 namespace ppapi {
13 namespace thunk {
14
15 namespace {
16
17 PP_Resource Create(PP_Instance instance) {
18 EnterFunction<ResourceCreationAPI> enter(instance, true);
19 if (enter.failed())
20 return 0;
21 return enter.functions()->CreateFlashMessageLoop(instance);
22 }
23
24 PP_Bool IsFlashMessageLoop(PP_Resource resource) {
25 EnterResource<PPB_Flash_MessageLoop_API> enter(resource, false);
26 return PP_FromBool(enter.succeeded());
27 }
28
29 int32_t Run(PP_Resource resource) {
30 EnterResource<PPB_Flash_MessageLoop_API> enter(resource, true);
31 if (enter.failed())
32 return PP_ERROR_BADRESOURCE;
33 return enter.object()->Run();
34 }
35
36 void Quit(PP_Resource resource) {
37 EnterResource<PPB_Flash_MessageLoop_API> enter(resource, true);
38 if (enter.succeeded())
39 enter.object()->Quit();
40 }
41
42 const PPB_Flash_MessageLoop g_ppb_flash_message_loop_thunk = {
43 &Create,
44 &IsFlashMessageLoop,
45 &Run,
46 &Quit
47 };
48
49 } // namespace
50
51 const PPB_Flash_MessageLoop_0_1* GetPPB_Flash_MessageLoop_0_1_Thunk() {
52 return &g_ppb_flash_message_loop_thunk;
53 }
54
55 } // namespace thunk
56 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_flash_message_loop_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698