OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <set> | 12 #include <set> |
12 | 13 |
13 #include "base/callback.h" | 14 #include "base/callback.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/synchronization/condition_variable.h" | 17 #include "base/synchronization/condition_variable.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 #include "ppapi/c/pp_completion_callback.h" | 19 #include "ppapi/c/pp_completion_callback.h" |
20 #include "ppapi/c/pp_instance.h" | 20 #include "ppapi/c/pp_instance.h" |
21 #include "ppapi/c/pp_resource.h" | 21 #include "ppapi/c/pp_resource.h" |
22 #include "ppapi/shared_impl/ppapi_shared_export.h" | 22 #include "ppapi/shared_impl/ppapi_shared_export.h" |
23 #include "ppapi/shared_impl/ppb_message_loop_shared.h" | 23 #include "ppapi/shared_impl/ppb_message_loop_shared.h" |
24 | 24 |
25 namespace ppapi { | 25 namespace ppapi { |
26 | 26 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 CompletionTask completion_task_; | 185 CompletionTask completion_task_; |
186 | 186 |
187 // The MessageLoopShared on which this callback should be run. This will be | 187 // The MessageLoopShared on which this callback should be run. This will be |
188 // NULL if we're in-process. | 188 // NULL if we're in-process. |
189 scoped_refptr<MessageLoopShared> target_loop_; | 189 scoped_refptr<MessageLoopShared> target_loop_; |
190 | 190 |
191 int32_t result_for_blocked_callback_; | 191 int32_t result_for_blocked_callback_; |
192 // Used for pausing/waking the blocked thread if this is a blocking completion | 192 // Used for pausing/waking the blocked thread if this is a blocking completion |
193 // callback. Note that in-process, there is no lock, blocking callbacks are | 193 // callback. Note that in-process, there is no lock, blocking callbacks are |
194 // not allowed, and therefore this pointer will be NULL. | 194 // not allowed, and therefore this pointer will be NULL. |
195 scoped_ptr<base::ConditionVariable> operation_completed_condvar_; | 195 std::unique_ptr<base::ConditionVariable> operation_completed_condvar_; |
196 | 196 |
197 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback); | 197 DISALLOW_IMPLICIT_CONSTRUCTORS(TrackedCallback); |
198 }; | 198 }; |
199 | 199 |
200 } // namespace ppapi | 200 } // namespace ppapi |
201 | 201 |
202 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ | 202 #endif // PPAPI_SHARED_IMPL_TRACKED_CALLBACK_H_ |
OLD | NEW |