Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 EnterResourceNoLock<PPB_Graphics2D_API> enter(graphics_2d, true); | 45 EnterResourceNoLock<PPB_Graphics2D_API> enter(graphics_2d, true); |
| 46 if (enter.failed()) | 46 if (enter.failed()) |
| 47 return PP_FALSE; | 47 return PP_FALSE; |
| 48 const HostResource& host_image = image_object->host_resource(); | 48 const HostResource& host_image = image_object->host_resource(); |
| 49 return enter.object()->ReadImageData(host_image.host_resource(), top_left) ? | 49 return enter.object()->ReadImageData(host_image.host_resource(), top_left) ? |
| 50 PP_TRUE : PP_FALSE; | 50 PP_TRUE : PP_FALSE; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void RunMessageLoop(PP_Instance instance) { | 53 void RunMessageLoop(PP_Instance instance) { |
| 54 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); | 54 base::MessageLoop::ScopedNestableTaskAllower allow( |
| 55 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop()-> | 55 base::MessageLoop::current()); |
| 56 BelongsToCurrentThread()); | 56 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop() |
| 57 MessageLoop::current()->Run(); | 57 ->BelongsToCurrentThread()); |
|
dmichael (off chromium)
2013/05/06 15:23:22
nit: the -> should stay on the previous line
xhwang
2013/05/06 16:00:55
Done.
| |
| 58 base::MessageLoop::current()->Run(); | |
| 58 } | 59 } |
| 59 | 60 |
| 60 void QuitMessageLoop(PP_Instance instance) { | 61 void QuitMessageLoop(PP_Instance instance) { |
| 61 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop()-> | 62 CHECK(PpapiGlobals::Get()->GetMainThreadMessageLoop()-> |
| 62 BelongsToCurrentThread()); | 63 BelongsToCurrentThread()); |
| 63 MessageLoop::current()->QuitNow(); | 64 base::MessageLoop::current()->QuitNow(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { | 67 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { |
| 67 ProxyAutoLock lock; | 68 ProxyAutoLock lock; |
| 68 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); | 69 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); |
| 69 if (!dispatcher) | 70 if (!dispatcher) |
| 70 return static_cast<uint32_t>(-1); | 71 return static_cast<uint32_t>(-1); |
| 71 | 72 |
| 72 uint32_t result = 0; | 73 uint32_t result = 0; |
| 73 dispatcher->Send(new PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance( | 74 dispatcher->Send(new PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance( |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 input_event_impl->pp_resource()); | 220 input_event_impl->pp_resource()); |
| 220 } | 221 } |
| 221 | 222 |
| 222 void PPB_Testing_Proxy::OnMsgSetMinimumArrayBufferSizeForShmem( | 223 void PPB_Testing_Proxy::OnMsgSetMinimumArrayBufferSizeForShmem( |
| 223 uint32_t threshold) { | 224 uint32_t threshold) { |
| 224 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); | 225 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); |
| 225 } | 226 } |
| 226 | 227 |
| 227 } // namespace proxy | 228 } // namespace proxy |
| 228 } // namespace ppapi | 229 } // namespace ppapi |
| OLD | NEW |