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 MEDIA_BASE_SERIAL_RUNNER_H_ | 5 #ifndef MEDIA_BASE_SERIAL_RUNNER_H_ |
6 #define MEDIA_BASE_SERIAL_RUNNER_H_ | 6 #define MEDIA_BASE_SERIAL_RUNNER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // the completion callback as the series progresses. | 27 // the completion callback as the series progresses. |
28 class MEDIA_EXPORT SerialRunner { | 28 class MEDIA_EXPORT SerialRunner { |
29 public: | 29 public: |
30 typedef base::Callback<void(const base::Closure&)> BoundClosure; | 30 typedef base::Callback<void(const base::Closure&)> BoundClosure; |
31 typedef base::Callback<void(const PipelineStatusCB&)> BoundPipelineStatusCB; | 31 typedef base::Callback<void(const PipelineStatusCB&)> BoundPipelineStatusCB; |
32 | 32 |
33 // Serial queue of bound functions to run. | 33 // Serial queue of bound functions to run. |
34 class MEDIA_EXPORT Queue { | 34 class MEDIA_EXPORT Queue { |
35 public: | 35 public: |
36 Queue(); | 36 Queue(); |
| 37 Queue(const Queue& other); |
37 ~Queue(); | 38 ~Queue(); |
38 | 39 |
39 void Push(const base::Closure& closure); | 40 void Push(const base::Closure& closure); |
40 void Push(const BoundClosure& bound_fn); | 41 void Push(const BoundClosure& bound_fn); |
41 void Push(const BoundPipelineStatusCB& bound_fn); | 42 void Push(const BoundPipelineStatusCB& bound_fn); |
42 | 43 |
43 private: | 44 private: |
44 friend class SerialRunner; | 45 friend class SerialRunner; |
45 | 46 |
46 BoundPipelineStatusCB Pop(); | 47 BoundPipelineStatusCB Pop(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 81 |
81 // NOTE: Weak pointers must be invalidated before all other member variables. | 82 // NOTE: Weak pointers must be invalidated before all other member variables. |
82 base::WeakPtrFactory<SerialRunner> weak_factory_; | 83 base::WeakPtrFactory<SerialRunner> weak_factory_; |
83 | 84 |
84 DISALLOW_COPY_AND_ASSIGN(SerialRunner); | 85 DISALLOW_COPY_AND_ASSIGN(SerialRunner); |
85 }; | 86 }; |
86 | 87 |
87 } // namespace media | 88 } // namespace media |
88 | 89 |
89 #endif // MEDIA_BASE_SERIAL_RUNNER_H_ | 90 #endif // MEDIA_BASE_SERIAL_RUNNER_H_ |
OLD | NEW |