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 "ppapi/proxy/ppb_testing_proxy.h" | 5 #include "ppapi/proxy/ppb_testing_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ppapi/c/dev/ppb_testing_dev.h" | 8 #include "ppapi/c/dev/ppb_testing_dev.h" |
9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 PP_Bool result = PP_FALSE; | 47 PP_Bool result = PP_FALSE; |
48 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( | 48 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( |
49 API_ID_PPB_TESTING, graphics_2d_object->host_resource(), | 49 API_ID_PPB_TESTING, graphics_2d_object->host_resource(), |
50 image_object->host_resource(), *top_left, &result)); | 50 image_object->host_resource(), *top_left, &result)); |
51 return result; | 51 return result; |
52 } | 52 } |
53 | 53 |
54 void RunMessageLoop(PP_Instance instance) { | 54 void RunMessageLoop(PP_Instance instance) { |
55 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 55 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
56 // TODO(dmichael): We should probably assert that this is the main thread. | 56 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop()-> |
| 57 BelongsToCurrentThread()); |
57 MessageLoop::current()->Run(); | 58 MessageLoop::current()->Run(); |
58 } | 59 } |
59 | 60 |
60 void QuitMessageLoop(PP_Instance instance) { | 61 void QuitMessageLoop(PP_Instance instance) { |
61 // TODO(dmichael): We should probably assert that this is the main thread. | 62 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop()-> |
| 63 BelongsToCurrentThread()); |
62 MessageLoop::current()->QuitNow(); | 64 MessageLoop::current()->QuitNow(); |
63 } | 65 } |
64 | 66 |
65 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { | 67 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { |
66 ProxyAutoLock lock; | 68 ProxyAutoLock lock; |
67 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); | 69 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); |
68 if (!dispatcher) | 70 if (!dispatcher) |
69 return static_cast<uint32_t>(-1); | 71 return static_cast<uint32_t>(-1); |
70 | 72 |
71 uint32_t result = 0; | 73 uint32_t result = 0; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 PP_Instance instance, | 196 PP_Instance instance, |
195 const InputEventData& input_event) { | 197 const InputEventData& input_event) { |
196 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( | 198 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( |
197 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); | 199 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); |
198 ppb_testing_impl_->SimulateInputEvent(instance, | 200 ppb_testing_impl_->SimulateInputEvent(instance, |
199 input_event_impl->pp_resource()); | 201 input_event_impl->pp_resource()); |
200 } | 202 } |
201 | 203 |
202 } // namespace proxy | 204 } // namespace proxy |
203 } // namespace ppapi | 205 } // namespace ppapi |
OLD | NEW |