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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 return PP_FALSE; | 43 return PP_FALSE; |
44 | 44 |
45 PP_Bool result = PP_FALSE; | 45 PP_Bool result = PP_FALSE; |
46 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( | 46 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( |
47 API_ID_PPB_TESTING, graphics_2d_object->host_resource(), | 47 API_ID_PPB_TESTING, graphics_2d_object->host_resource(), |
48 image_object->host_resource(), *top_left, &result)); | 48 image_object->host_resource(), *top_left, &result)); |
49 return result; | 49 return result; |
50 } | 50 } |
51 | 51 |
52 void RunMessageLoop(PP_Instance instance) { | 52 void RunMessageLoop(PP_Instance instance) { |
53 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 53 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); |
54 MessageLoop::current()->SetNestableTasksAllowed(true); | |
55 MessageLoop::current()->Run(); | 54 MessageLoop::current()->Run(); |
56 MessageLoop::current()->SetNestableTasksAllowed(old_state); | |
57 } | 55 } |
58 | 56 |
59 void QuitMessageLoop(PP_Instance instance) { | 57 void QuitMessageLoop(PP_Instance instance) { |
60 MessageLoop::current()->QuitNow(); | 58 MessageLoop::current()->QuitNow(); |
61 } | 59 } |
62 | 60 |
63 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { | 61 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { |
64 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); | 62 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); |
65 if (!dispatcher) | 63 if (!dispatcher) |
66 return static_cast<uint32_t>(-1); | 64 return static_cast<uint32_t>(-1); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 PP_Instance instance, | 187 PP_Instance instance, |
190 const InputEventData& input_event) { | 188 const InputEventData& input_event) { |
191 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( | 189 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( |
192 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); | 190 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); |
193 ppb_testing_impl_->SimulateInputEvent(instance, | 191 ppb_testing_impl_->SimulateInputEvent(instance, |
194 input_event_impl->pp_resource()); | 192 input_event_impl->pp_resource()); |
195 } | 193 } |
196 | 194 |
197 } // namespace proxy | 195 } // namespace proxy |
198 } // namespace ppapi | 196 } // namespace ppapi |
OLD | NEW |