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 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 private: | 36 private: |
37 int32_t result_; | 37 int32_t result_; |
38 bool run_called_; | 38 bool run_called_; |
39 bool quit_called_; | 39 bool quit_called_; |
40 RunFromHostProxyCallback run_callback_; | 40 RunFromHostProxyCallback run_callback_; |
41 }; | 41 }; |
42 | 42 |
43 PPB_Flash_MessageLoop_Impl::PPB_Flash_MessageLoop_Impl(PP_Instance instance) | 43 PPB_Flash_MessageLoop_Impl::PPB_Flash_MessageLoop_Impl(PP_Instance instance) |
44 : Resource(instance), | 44 : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
45 state_(new State()) { | 45 state_(new State()) { |
46 } | 46 } |
47 | 47 |
48 PPB_Flash_MessageLoop_Impl::~PPB_Flash_MessageLoop_Impl() { | 48 PPB_Flash_MessageLoop_Impl::~PPB_Flash_MessageLoop_Impl() { |
49 // It is a no-op if either Run() hasn't been called or Quit() has been called | 49 // It is a no-op if either Run() hasn't been called or Quit() has been called |
50 // to balance the call to Run(). | 50 // to balance the call to Run(). |
51 InternalQuit(PP_ERROR_ABORTED); | 51 InternalQuit(PP_ERROR_ABORTED); |
52 } | 52 } |
53 | 53 |
54 // static | 54 // static |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 state_->set_result(result); | 105 state_->set_result(result); |
106 | 106 |
107 MessageLoop::current()->QuitNow(); | 107 MessageLoop::current()->QuitNow(); |
108 | 108 |
109 if (!state_->run_callback().is_null()) | 109 if (!state_->run_callback().is_null()) |
110 state_->run_callback().Run(result); | 110 state_->run_callback().Run(result); |
111 } | 111 } |
112 | 112 |
113 } // namespace ppapi | 113 } // namespace ppapi |
114 } // namespace webkit | 114 } // namespace webkit |
OLD | NEW |