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

Side by Side Diff: ppapi/shared_impl/tracked_callback.h

Issue 46433002: Support using TrackedCallbacks as hints to determine the handling thread of resource reply messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/shared_impl/ppb_message_loop_shared.h ('k') | no next file » | 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 #ifndef PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ 5 #ifndef PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_
6 #define PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ 6 #define PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Returns true if the callback was or should be aborted; this will be the 106 // Returns true if the callback was or should be aborted; this will be the
107 // case whenever |Abort()| or |PostAbort()| is called before a non-abortive 107 // case whenever |Abort()| or |PostAbort()| is called before a non-abortive
108 // completion. 108 // completion.
109 bool aborted() const { return aborted_; } 109 bool aborted() const { return aborted_; }
110 110
111 // Returns true if this is a blocking callback. 111 // Returns true if this is a blocking callback.
112 bool is_blocking() { 112 bool is_blocking() {
113 return !callback_.func; 113 return !callback_.func;
114 } 114 }
115 115
116 MessageLoopShared* target_loop() const {
117 return target_loop_.get();
118 }
119
116 // Determines if the given callback is pending. A callback is pending if it 120 // Determines if the given callback is pending. A callback is pending if it
117 // has not completed and has not been aborted. When receiving a plugin call, 121 // has not completed and has not been aborted. When receiving a plugin call,
118 // use this to detect if |callback| represents an operation in progress. When 122 // use this to detect if |callback| represents an operation in progress. When
119 // finishing a plugin call, use this to determine whether to write 'out' 123 // finishing a plugin call, use this to determine whether to write 'out'
120 // params and Run |callback|. 124 // params and Run |callback|.
121 // NOTE: an aborted callback has not necessarily completed, so a false result 125 // NOTE: an aborted callback has not necessarily completed, so a false result
122 // doesn't imply that the callback has completed. 126 // doesn't imply that the callback has completed.
123 // As a convenience, if |callback| is null, this returns false. 127 // As a convenience, if |callback| is null, this returns false.
124 static bool IsPending(const scoped_refptr<TrackedCallback>& callback); 128 static bool IsPending(const scoped_refptr<TrackedCallback>& callback);
125 129
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // callback. Note that in-process, there is no lock, blocking callbacks are 183 // callback. Note that in-process, there is no lock, blocking callbacks are
180 // not allowed, and therefore this pointer will be NULL. 184 // not allowed, and therefore this pointer will be NULL.
181 scoped_ptr<base::ConditionVariable> operation_completed_condvar_; 185 scoped_ptr<base::ConditionVariable> operation_completed_condvar_;
182 186
183 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback); 187 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback);
184 }; 188 };
185 189
186 } // namespace ppapi 190 } // namespace ppapi
187 191
188 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ 192 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppb_message_loop_shared.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698