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

Unified Diff: ppapi/thunk/enter.cc

Issue 15806016: Update ppapi/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/shared_impl/var_tracker.cc ('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 02151eb4ad0a1d249ebaa274f2e81005fa95871b..6b4bbbe028ce158f4a3573e455bada12256da05d 100644
--- a/ppapi/thunk/enter.cc
+++ b/ppapi/thunk/enter.cc
@@ -73,12 +73,13 @@ EnterBase::~EnterBase() {
// callback_ is cleared any time it is run, scheduled to be run, or once we
// know it will be completed asynchronously. So by this point it should be
// NULL.
- DCHECK(!callback_) << "|callback_| is not NULL. Did you forget to call "
- "|EnterBase::SetResult| in the interface's thunk?";
+ DCHECK(!callback_.get())
+ << "|callback_| is not NULL. Did you forget to call "
+ "|EnterBase::SetResult| in the interface's thunk?";
}
int32_t EnterBase::SetResult(int32_t result) {
- if (!callback_) {
+ if (!callback_.get()) {
// It doesn't make sense to call SetResult if there is no callback.
NOTREACHED();
retval_ = result;
@@ -132,7 +133,7 @@ void EnterBase::SetStateForCallbackError(bool report_error) {
// In-process plugins can't make PPAPI calls off the main thread.
CHECK(IsMainThread());
}
- if (callback_) {
+ if (callback_.get()) {
if (callback_->is_blocking() && IsMainThread()) {
// Blocking callbacks are never allowed on the main thread.
callback_->MarkAsCompleted();
@@ -193,12 +194,12 @@ void EnterBase::SetStateForResourceError(PP_Resource pp_resource,
if (object)
return; // Everything worked.
- if (callback_ && callback_->is_required()) {
+ if (callback_.get() && callback_->is_required()) {
callback_->PostRun(static_cast<int32_t>(PP_ERROR_BADRESOURCE));
callback_ = NULL;
retval_ = PP_OK_COMPLETIONPENDING;
} else {
- if (callback_)
+ if (callback_.get())
callback_->MarkAsCompleted();
callback_ = NULL;
retval_ = PP_ERROR_BADRESOURCE;
@@ -235,12 +236,12 @@ void EnterBase::SetStateForFunctionError(PP_Instance pp_instance,
if (object)
return; // Everything worked.
- if (callback_ && callback_->is_required()) {
+ if (callback_.get() && callback_->is_required()) {
callback_->PostRun(static_cast<int32_t>(PP_ERROR_BADARGUMENT));
callback_ = NULL;
retval_ = PP_OK_COMPLETIONPENDING;
} else {
- if (callback_)
+ if (callback_.get())
callback_->MarkAsCompleted();
callback_ = NULL;
retval_ = PP_ERROR_BADARGUMENT;
« no previous file with comments | « ppapi/shared_impl/var_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698