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

Unified Diff: ppapi/thunk/enter.cc

Issue 9391006: PPAPI: Add unlocking for PPP calls and callbacks. Add more locking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/thunk/enter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/enter.cc
diff --git a/ppapi/thunk/enter.cc b/ppapi/thunk/enter.cc
index 42ff6709cfd25449638ead839fe44efd18aab207..d8d42915e98f8b6fc827047cbadb6489e3ba6cd0 100644
--- a/ppapi/thunk/enter.cc
+++ b/ppapi/thunk/enter.cc
@@ -40,8 +40,8 @@ EnterBase::~EnterBase() {
if (callback_.func) {
// All async completions should have cleared the callback in SetResult().
DCHECK(retval_ != PP_OK_COMPLETIONPENDING && retval_ != PP_OK);
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- callback_.func, callback_.user_data, retval_));
+ MessageLoop::current()->PostTask(FROM_HERE, RunWhileLocked(base::Bind(
+ callback_.func, callback_.user_data, retval_)));
}
}
@@ -57,8 +57,8 @@ int32_t EnterBase::SetResult(int32_t result) {
// This is a required callback, asynchronously issue it.
// TODO(brettw) make this work on different threads, etc.
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- callback_.func, callback_.user_data, result));
+ MessageLoop::current()->PostTask(FROM_HERE, RunWhileLocked(base::Bind(
+ callback_.func, callback_.user_data, result)));
// Now that the callback will be issued in the future, we should return
// "pending" to the caller, and not issue the callback again.
@@ -85,9 +85,9 @@ void EnterBase::SetStateForResourceError(PP_Resource pp_resource,
if (callback_.func) {
// Required callback, issue the async completion.
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
+ MessageLoop::current()->PostTask(FROM_HERE, RunWhileLocked(base::Bind(
callback_.func, callback_.user_data,
- static_cast<int32_t>(PP_ERROR_BADRESOURCE)));
+ static_cast<int32_t>(PP_ERROR_BADRESOURCE))));
callback_ = PP_BlockUntilComplete();
retval_ = PP_OK_COMPLETIONPENDING;
} else {
@@ -121,9 +121,9 @@ void EnterBase::SetStateForFunctionError(PP_Instance pp_instance,
if (callback_.func) {
// Required callback, issue the async completion.
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
+ MessageLoop::current()->PostTask(FROM_HERE, RunWhileLocked(base::Bind(
callback_.func, callback_.user_data,
- static_cast<int32_t>(PP_ERROR_BADARGUMENT)));
+ static_cast<int32_t>(PP_ERROR_BADARGUMENT))));
callback_ = PP_BlockUntilComplete();
retval_ = PP_OK_COMPLETIONPENDING;
} else {
@@ -145,7 +145,7 @@ void EnterBase::SetStateForFunctionError(PP_Instance pp_instance,
} // namespace subtle
EnterResourceCreation::EnterResourceCreation(PP_Instance instance)
- : EnterFunctionNoLock<ResourceCreationAPI>(instance, true) {
+ : EnterFunction<ResourceCreationAPI>(instance, true) {
}
EnterResourceCreation::~EnterResourceCreation() {
« no previous file with comments | « ppapi/thunk/enter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698