OLD | NEW |
| (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 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MESSAGE_LOOP_IMPL_H_ | |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MESSAGE_LOOP_IMPL_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/ref_counted.h" | |
11 #include "ppapi/shared_impl/resource.h" | |
12 #include "ppapi/thunk/ppb_flash_message_loop_api.h" | |
13 | |
14 namespace webkit { | |
15 namespace ppapi { | |
16 | |
17 class PPB_Flash_MessageLoop_Impl | |
18 : public ::ppapi::Resource, | |
19 public ::ppapi::thunk::PPB_Flash_MessageLoop_API { | |
20 public: | |
21 virtual ~PPB_Flash_MessageLoop_Impl(); | |
22 | |
23 static PP_Resource Create(PP_Instance instance); | |
24 | |
25 // Resource. | |
26 virtual ::ppapi::thunk::PPB_Flash_MessageLoop_API* | |
27 AsPPB_Flash_MessageLoop_API() OVERRIDE; | |
28 | |
29 // PPB_Flash_MessageLoop_API implementation. | |
30 virtual int32_t Run() OVERRIDE; | |
31 virtual void Quit() OVERRIDE; | |
32 virtual void RunFromHostProxy( | |
33 const RunFromHostProxyCallback& callback) OVERRIDE; | |
34 | |
35 private: | |
36 class State; | |
37 | |
38 explicit PPB_Flash_MessageLoop_Impl(PP_Instance instance); | |
39 | |
40 // If |callback| is valid, it will be called when the message loop is signaled | |
41 // to quit, and the result passed into it will be the same value as what this | |
42 // method returns. | |
43 // Please note that |callback| happens before this method returns. | |
44 int32_t InternalRun(const RunFromHostProxyCallback& callback); | |
45 void InternalQuit(int32_t result); | |
46 | |
47 scoped_refptr<State> state_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(PPB_Flash_MessageLoop_Impl); | |
50 }; | |
51 | |
52 } // namespace ppapi | |
53 } // namespace webkit | |
54 | |
55 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MESSAGE_LOOP_IMPL_H_ | |
OLD | NEW |