Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: ppapi/proxy/ppb_testing_proxy.cc

Issue 11361075: Enable pepper threading by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add lock for message loop Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/flash_resource.cc ('k') | ppapi/proxy/ppp_instance_private_proxy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // TODO(dmichael): We should probably assert that this is the main thread.
57 ProxyAutoLock lock;
dmichael (off chromium) 2012/11/06 03:00:02 No, you don't want the lock to be acquired at this
dmichael (off chromium) 2012/11/06 03:12:19 I've looked around a little, and it hasn't jumped
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 // TODO(dmichael): We should probably assert that this is the main thread.
62 MessageLoop::current()->QuitNow(); 63 MessageLoop::current()->QuitNow();
63 } 64 }
64 65
65 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) { 66 uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) {
66 ProxyAutoLock lock; 67 ProxyAutoLock lock;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 PP_Instance instance, 195 PP_Instance instance,
195 const InputEventData& input_event) { 196 const InputEventData& input_event) {
196 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( 197 scoped_refptr<PPB_InputEvent_Shared> input_event_impl(
197 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); 198 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event));
198 ppb_testing_impl_->SimulateInputEvent(instance, 199 ppb_testing_impl_->SimulateInputEvent(instance,
199 input_event_impl->pp_resource()); 200 input_event_impl->pp_resource());
200 } 201 }
201 202
202 } // namespace proxy 203 } // namespace proxy
203 } // namespace ppapi 204 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/flash_resource.cc ('k') | ppapi/proxy/ppp_instance_private_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698