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

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

Issue 6226001: Change code to use ScopedRunnableMethodFactory & a static callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « no previous file | media/base/composite_filter.cc » ('j') | media/base/composite_filter.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_COMPOSITE_FILTER_H_ 5 #ifndef MEDIA_BASE_COMPOSITE_FILTER_H_
6 #define MEDIA_BASE_COMPOSITE_FILTER_H_ 6 #define MEDIA_BASE_COMPOSITE_FILTER_H_
7 7
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "media/base/filter_host.h" 9 #include "media/base/filter_host.h"
10 #include "media/base/filters.h" 10 #include "media/base/filters.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Helper function for handling errors during call sequences. 111 // Helper function for handling errors during call sequences.
112 void HandleError(PipelineError error); 112 void HandleError(PipelineError error);
113 113
114 // Creates a callback that can be called from any thread, but is guaranteed 114 // Creates a callback that can be called from any thread, but is guaranteed
115 // to call the specified method on the thread associated with this filter. 115 // to call the specified method on the thread associated with this filter.
116 FilterCallback* NewThreadSafeCallback(void (CompositeFilter::*method)()); 116 FilterCallback* NewThreadSafeCallback(void (CompositeFilter::*method)());
117 117
118 // Helper function used by NewThreadSafeCallback() to make sure the 118 // Helper function used by NewThreadSafeCallback() to make sure the
119 // method gets called on the right thread. 119 // method gets called on the right thread.
120 void OnCallback(MessageLoop* message_loop, 120 static void OnCallback(MessageLoop* message_loop,
121 void (CompositeFilter::*method)()); 121 CancelableTask* task);
122 122
123 // Helper function that indicates whether SetError() calls can be forwarded 123 // Helper function that indicates whether SetError() calls can be forwarded
124 // to the host of this filter. 124 // to the host of this filter.
125 bool CanForwardError(); 125 bool CanForwardError();
126 126
127 // Vector of threads owned by the composite and used by filters in |filters_|. 127 // Vector of threads owned by the composite and used by filters in |filters_|.
128 typedef std::vector<base::Thread*> FilterThreadVector; 128 typedef std::vector<base::Thread*> FilterThreadVector;
129 FilterThreadVector filter_threads_; 129 FilterThreadVector filter_threads_;
130 130
131 // Vector of the filters added to the composite. 131 // Vector of the filters added to the composite.
(...skipping 18 matching lines...) Expand all
150 // Message loop passed into the constructor. 150 // Message loop passed into the constructor.
151 MessageLoop* message_loop_; 151 MessageLoop* message_loop_;
152 152
153 // FilterHost implementation passed to Filters owned by this 153 // FilterHost implementation passed to Filters owned by this
154 // object. 154 // object.
155 scoped_ptr<FilterHostImpl> host_impl_; 155 scoped_ptr<FilterHostImpl> host_impl_;
156 156
157 // Error passed in the last SetError() call. 157 // Error passed in the last SetError() call.
158 PipelineError error_; 158 PipelineError error_;
159 159
160 scoped_ptr<ScopedRunnableMethodFactory<CompositeFilter> > runnable_factory_;
161
160 DISALLOW_COPY_AND_ASSIGN(CompositeFilter); 162 DISALLOW_COPY_AND_ASSIGN(CompositeFilter);
161 }; 163 };
162 164
163 } // namespace media 165 } // namespace media
164 166
165 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_ 167 #endif // MEDIA_BASE_COMPOSITE_FILTER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/composite_filter.cc » ('j') | media/base/composite_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698