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

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

Issue 1445003002: Use std::default_delete as the default deleter for scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: How many trial and errors before this builds on the Windows bots Created 5 years, 1 month 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 | « media/base/audio_buffer_converter.cc ('k') | media/base/yuv_convert.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 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 <queue> 9 #include <queue>
9 10
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
14 #include "media/base/media_export.h" 15 #include "media/base/media_export.h"
15 #include "media/base/pipeline_status.h" 16 #include "media/base/pipeline_status.h"
16 17
17 namespace base { 18 namespace base {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // 59 //
59 // In all cases, |done_cb| is guaranteed to execute on a separate calling 60 // In all cases, |done_cb| is guaranteed to execute on a separate calling
60 // stack. 61 // stack.
61 // 62 //
62 // Deleting the object will prevent execution of any unstarted bound 63 // Deleting the object will prevent execution of any unstarted bound
63 // functions, including |done_cb|. 64 // functions, including |done_cb|.
64 static scoped_ptr<SerialRunner> Run( 65 static scoped_ptr<SerialRunner> Run(
65 const Queue& bound_fns, const PipelineStatusCB& done_cb); 66 const Queue& bound_fns, const PipelineStatusCB& done_cb);
66 67
67 private: 68 private:
68 friend struct base::DefaultDeleter<SerialRunner>; 69 friend std::default_delete<SerialRunner>;
69 70
70 SerialRunner(const Queue& bound_fns, const PipelineStatusCB& done_cb); 71 SerialRunner(const Queue& bound_fns, const PipelineStatusCB& done_cb);
71 ~SerialRunner(); 72 ~SerialRunner();
72 73
73 void RunNextInSeries(PipelineStatus last_status); 74 void RunNextInSeries(PipelineStatus last_status);
74 75
75 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 76 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
76 Queue bound_fns_; 77 Queue bound_fns_;
77 PipelineStatusCB done_cb_; 78 PipelineStatusCB done_cb_;
78 79
79 // NOTE: Weak pointers must be invalidated before all other member variables. 80 // NOTE: Weak pointers must be invalidated before all other member variables.
80 base::WeakPtrFactory<SerialRunner> weak_factory_; 81 base::WeakPtrFactory<SerialRunner> weak_factory_;
81 82
82 DISALLOW_COPY_AND_ASSIGN(SerialRunner); 83 DISALLOW_COPY_AND_ASSIGN(SerialRunner);
83 }; 84 };
84 85
85 } // namespace media 86 } // namespace media
86 87
87 #endif // MEDIA_BASE_SERIAL_RUNNER_H_ 88 #endif // MEDIA_BASE_SERIAL_RUNNER_H_
OLDNEW
« no previous file with comments | « media/base/audio_buffer_converter.cc ('k') | media/base/yuv_convert.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698