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 <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // | 49 // |
50 // All bound functions are executed on the thread that Run() is called on, | 50 // All bound functions are executed on the thread that Run() is called on, |
51 // including |done_cb|. | 51 // including |done_cb|. |
52 // | 52 // |
53 // Deleting the object will prevent execution of any unstarted bound | 53 // Deleting the object will prevent execution of any unstarted bound |
54 // functions, including |done_cb|. | 54 // functions, including |done_cb|. |
55 static scoped_ptr<SerialRunner> Run( | 55 static scoped_ptr<SerialRunner> Run( |
56 const Queue& bound_fns, const PipelineStatusCB& done_cb); | 56 const Queue& bound_fns, const PipelineStatusCB& done_cb); |
57 | 57 |
58 private: | 58 private: |
59 friend class scoped_ptr<SerialRunner>; | 59 friend struct base::DefaultDeleter<SerialRunner>; |
60 | 60 |
61 SerialRunner(const Queue& bound_fns, const PipelineStatusCB& done_cb); | 61 SerialRunner(const Queue& bound_fns, const PipelineStatusCB& done_cb); |
62 ~SerialRunner(); | 62 ~SerialRunner(); |
63 | 63 |
64 void RunNextInSeries(PipelineStatus last_status); | 64 void RunNextInSeries(PipelineStatus last_status); |
65 | 65 |
66 base::WeakPtrFactory<SerialRunner> weak_this_; | 66 base::WeakPtrFactory<SerialRunner> weak_this_; |
67 scoped_refptr<base::MessageLoopProxy> message_loop_; | 67 scoped_refptr<base::MessageLoopProxy> message_loop_; |
68 Queue bound_fns_; | 68 Queue bound_fns_; |
69 PipelineStatusCB done_cb_; | 69 PipelineStatusCB done_cb_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(SerialRunner); | 71 DISALLOW_COPY_AND_ASSIGN(SerialRunner); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace media | 74 } // namespace media |
75 | 75 |
76 #endif // MEDIA_BASE_SERIAL_RUNNER_H_ | 76 #endif // MEDIA_BASE_SERIAL_RUNNER_H_ |
OLD | NEW |