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

Side by Side Diff: ppapi/shared_impl/thread_aware_callback.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, 6 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/proxy/websocket_resource.cc ('k') | ppapi/shared_impl/tracked_callback.h » ('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/shared_impl/thread_aware_callback.h" 5 #include "ppapi/shared_impl/thread_aware_callback.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ppapi/shared_impl/ppapi_globals.h" 9 #include "ppapi/shared_impl/ppapi_globals.h"
10 #include "ppapi/shared_impl/ppb_message_loop_shared.h" 10 #include "ppapi/shared_impl/ppb_message_loop_shared.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 core_->MarkAsAborted(); 42 core_->MarkAsAborted();
43 } 43 }
44 44
45 // static 45 // static
46 bool ThreadAwareCallbackBase::HasTargetLoop() { 46 bool ThreadAwareCallbackBase::HasTargetLoop() {
47 return !!PpapiGlobals::Get()->GetCurrentMessageLoop(); 47 return !!PpapiGlobals::Get()->GetCurrentMessageLoop();
48 } 48 }
49 49
50 void ThreadAwareCallbackBase::InternalRunOnTargetThread( 50 void ThreadAwareCallbackBase::InternalRunOnTargetThread(
51 const base::Closure& closure) { 51 const base::Closure& closure) {
52 if (target_loop_ != PpapiGlobals::Get()->GetCurrentMessageLoop()) { 52 if (target_loop_.get() != PpapiGlobals::Get()->GetCurrentMessageLoop()) {
53 target_loop_->PostClosure( 53 target_loop_->PostClosure(
54 FROM_HERE, 54 FROM_HERE,
55 RunWhileLocked(base::Bind(&Core::RunIfNotAborted, core_, closure)), 55 RunWhileLocked(base::Bind(&Core::RunIfNotAborted, core_, closure)),
56 0); 56 0);
57 } else { 57 } else {
58 CallWhileUnlocked(closure); 58 CallWhileUnlocked(closure);
59 } 59 }
60 } 60 }
61 61
62 } // namespace internal 62 } // namespace internal
63 } // namespace ppapi 63 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/websocket_resource.cc ('k') | ppapi/shared_impl/tracked_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698