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

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

Issue 19678028: PAPI: Fix bug in RunWhileLocked, add support for params (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unlock when joining the audio thread so that we don't deadlock if it makes pepper calls. Created 7 years, 4 months 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/ppapi_tests.gypi ('k') | ppapi/shared_impl/ppb_audio_shared.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_core_proxy.h" 5 #include "ppapi/proxy/ppb_core_proxy.h"
6 6
7 #include <stdlib.h> // For malloc 7 #include <stdlib.h> // For malloc
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 int32_t result) { 55 int32_t result) {
56 DCHECK(callback.func); 56 DCHECK(callback.func);
57 #if defined(OS_NACL) 57 #if defined(OS_NACL)
58 // Some NaCl apps pass a negative delay, so we just sanitize to 0, to run as 58 // Some NaCl apps pass a negative delay, so we just sanitize to 0, to run as
59 // soon as possible. MessageLoop checks that the delay is non-negative. 59 // soon as possible. MessageLoop checks that the delay is non-negative.
60 if (delay_in_ms < 0) 60 if (delay_in_ms < 0)
61 delay_in_ms = 0; 61 delay_in_ms = 0;
62 #endif 62 #endif
63 if (!callback.func) 63 if (!callback.func)
64 return; 64 return;
65 ProxyAutoLock lock;
65 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask( 66 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask(
66 FROM_HERE, 67 FROM_HERE,
67 RunWhileLocked(base::Bind(&CallbackWrapper, callback, result)), 68 RunWhileLocked(base::Bind(&CallbackWrapper, callback, result)),
68 base::TimeDelta::FromMilliseconds(delay_in_ms)); 69 base::TimeDelta::FromMilliseconds(delay_in_ms));
69 } 70 }
70 71
71 PP_Bool IsMainThread() { 72 PP_Bool IsMainThread() {
72 return PP_FromBool(PpapiGlobals::Get()-> 73 return PP_FromBool(PpapiGlobals::Get()->
73 GetMainThreadMessageLoop()->BelongsToCurrentThread()); 74 GetMainThreadMessageLoop()->BelongsToCurrentThread());
74 } 75 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ppb_core_impl_->AddRefResource(resource.host_resource()); 122 ppb_core_impl_->AddRefResource(resource.host_resource());
122 } 123 }
123 124
124 void PPB_Core_Proxy::OnMsgReleaseResource(const HostResource& resource) { 125 void PPB_Core_Proxy::OnMsgReleaseResource(const HostResource& resource) {
125 ppb_core_impl_->ReleaseResource(resource.host_resource()); 126 ppb_core_impl_->ReleaseResource(resource.host_resource());
126 } 127 }
127 #endif // !defined(OS_NACL) 128 #endif // !defined(OS_NACL)
128 129
129 } // namespace proxy 130 } // namespace proxy
130 } // namespace ppapi 131 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/ppapi_tests.gypi ('k') | ppapi/shared_impl/ppb_audio_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698