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

Side by Side Diff: media/base/serial_runner.h

Issue 11149006: Extend scoped_ptr to be closer to unique_ptr. Support custom deleters, and deleting arrays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | « media/base/message_loop_factory.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 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
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_
OLDNEW
« no previous file with comments | « media/base/message_loop_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698