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

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

Issue 174213003: PPAPI: Use clang-format on ppapi/shared_impl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove DEPS Created 6 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 unified diff | Download patch
« no previous file with comments | « ppapi/shared_impl/time_conversion.cc ('k') | ppapi/shared_impl/tracked_callback.cc » ('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 #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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // Returns true if the callback was completed (possibly aborted). 103 // Returns true if the callback was completed (possibly aborted).
104 bool completed() const { return completed_; } 104 bool completed() const { return completed_; }
105 105
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() { return !callback_.func; }
113 return !callback_.func;
114 }
115 113
116 MessageLoopShared* target_loop() const { 114 MessageLoopShared* target_loop() const { return target_loop_.get(); }
117 return target_loop_.get();
118 }
119 115
120 // Determines if the given callback is pending. A callback is pending if it 116 // Determines if the given callback is pending. A callback is pending if it
121 // has not completed and has not been aborted. When receiving a plugin call, 117 // has not completed and has not been aborted. When receiving a plugin call,
122 // use this to detect if |callback| represents an operation in progress. When 118 // use this to detect if |callback| represents an operation in progress. When
123 // finishing a plugin call, use this to determine whether to write 'out' 119 // finishing a plugin call, use this to determine whether to write 'out'
124 // params and Run |callback|. 120 // params and Run |callback|.
125 // NOTE: an aborted callback has not necessarily completed, so a false result 121 // NOTE: an aborted callback has not necessarily completed, so a false result
126 // doesn't imply that the callback has completed. 122 // doesn't imply that the callback has completed.
127 // As a convenience, if |callback| is null, this returns false. 123 // As a convenience, if |callback| is null, this returns false.
128 static bool IsPending(const scoped_refptr<TrackedCallback>& callback); 124 static bool IsPending(const scoped_refptr<TrackedCallback>& callback);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // callback. Note that in-process, there is no lock, blocking callbacks are 179 // callback. Note that in-process, there is no lock, blocking callbacks are
184 // not allowed, and therefore this pointer will be NULL. 180 // not allowed, and therefore this pointer will be NULL.
185 scoped_ptr<base::ConditionVariable> operation_completed_condvar_; 181 scoped_ptr<base::ConditionVariable> operation_completed_condvar_;
186 182
187 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback); 183 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback);
188 }; 184 };
189 185
190 } // namespace ppapi 186 } // namespace ppapi
191 187
192 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ 188 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/time_conversion.cc ('k') | ppapi/shared_impl/tracked_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698