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