summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authordmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-25 21:07:39 +0000
committerdmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-25 21:07:39 +0000
commit17a17b08c1f81ea1d0e2c212beedec39f0fd1b81 (patch)
treed902b61b56872e6fc2ee1ae14a254694ef03f345 /ppapi/proxy
parent302492be5971df01cddcca27ad892adc7ca8792f (diff)
downloadchromium_src-17a17b08c1f81ea1d0e2c212beedec39f0fd1b81.zip
chromium_src-17a17b08c1f81ea1d0e2c212beedec39f0fd1b81.tar.gz
chromium_src-17a17b08c1f81ea1d0e2c212beedec39f0fd1b81.tar.bz2
PAPI: Fix bug in RunWhileLocked, add support for params
This CL: - Fixes a bug whereby a Callback bound by RunWhileLocked would release the lock before releasing bound values. This could lead to de-refing and possibly destroying objects (like Resources) that should only be manipulated with the ProxyLock held. - Adds support for up to 3 parameters to RunWhileLocked. Should be easy to extend to more if/when we want. - Adds a unit test that checks the bug and tests other utilities from ProxyLock. There is still possibly a rare issue with the Callback being destroyed without being run, e.g. at process shutdown. I'm going to clean that up in a separate CL: https://codereview.chromium.org/19492014/ BUG= R=bbudge@chromium.org, teravest@chromium.org, yzshen@chromium.org Review URL: https://codereview.chromium.org/19678028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppb_core_proxy.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc
index 1cc9671..65845ae 100644
--- a/ppapi/proxy/ppb_core_proxy.cc
+++ b/ppapi/proxy/ppb_core_proxy.cc
@@ -62,6 +62,7 @@ void CallOnMainThread(int delay_in_ms,
#endif
if (!callback.func)
return;
+ ProxyAutoLock lock;
PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostDelayedTask(
FROM_HERE,
RunWhileLocked(base::Bind(&CallbackWrapper, callback, result)),