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