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

Side by Side Diff: media/base/filters.cc

Issue 9717021: Make Callback::Reset() return a copy to support use-cases where Run() ends up modifying |*this|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no base:: Created 8 years, 9 months 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/filters.h ('k') | media/filters/audio_renderer_base.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 #include "media/base/filters.h" 5 #include "media/base/filters.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 void ResetAndRunCB(PipelineStatusCB* cb, PipelineStatus status) {
12 DCHECK(!cb->is_null());
13 PipelineStatusCB tmp_cb(*cb);
14 cb->Reset();
15 tmp_cb.Run(status);
16 }
17
18 void ResetAndRunCB(base::Closure* cb) {
19 DCHECK(!cb->is_null());
20 base::Closure tmp_cb(*cb);
21 cb->Reset();
22 tmp_cb.Run();
23 }
24
25 Filter::Filter() : host_(NULL) {} 11 Filter::Filter() : host_(NULL) {}
26 12
27 Filter::~Filter() {} 13 Filter::~Filter() {}
28 14
29 void Filter::clear_host() { 15 void Filter::clear_host() {
30 DCHECK(host_); 16 DCHECK(host_);
31 host_ = NULL; 17 host_ = NULL;
32 } 18 }
33 19
34 void Filter::set_host(FilterHost* host) { 20 void Filter::set_host(FilterHost* host) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 LOG(FATAL) << "VideoDecoder::Seek is not supposed to be called."; 74 LOG(FATAL) << "VideoDecoder::Seek is not supposed to be called.";
89 } 75 }
90 76
91 bool VideoDecoder::HasAlpha() const { 77 bool VideoDecoder::HasAlpha() const {
92 return false; 78 return false;
93 } 79 }
94 80
95 void VideoDecoder::PrepareForShutdownHack() {} 81 void VideoDecoder::PrepareForShutdownHack() {}
96 82
97 } // namespace media 83 } // namespace media
OLDNEW
« no previous file with comments | « media/base/filters.h ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698