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

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

Issue 444333007: Pipeline: Invalidate weak pointers before returning stop callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add HasWeakPtrsForTesting Created 6 years, 4 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/pipeline.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_PIPELINE_H_ 5 #ifndef MEDIA_BASE_PIPELINE_H_
6 #define MEDIA_BASE_PIPELINE_H_ 6 #define MEDIA_BASE_PIPELINE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 bool DidLoadingProgress(); 176 bool DidLoadingProgress();
177 177
178 // Gets the current pipeline statistics. 178 // Gets the current pipeline statistics.
179 PipelineStatistics GetStatistics() const; 179 PipelineStatistics GetStatistics() const;
180 180
181 void set_underflow_disabled_for_testing(bool disabled) { 181 void set_underflow_disabled_for_testing(bool disabled) {
182 underflow_disabled_for_testing_ = disabled; 182 underflow_disabled_for_testing_ = disabled;
183 } 183 }
184 void SetTimeDeltaInterpolatorForTesting(TimeDeltaInterpolator* interpolator); 184 void SetTimeDeltaInterpolatorForTesting(TimeDeltaInterpolator* interpolator);
185 void SetErrorForTesting(PipelineStatus status); 185 void SetErrorForTesting(PipelineStatus status);
186 bool HasWeakPtrsForTesting() const;
186 187
187 private: 188 private:
188 FRIEND_TEST_ALL_PREFIXES(PipelineTest, GetBufferedTimeRanges); 189 FRIEND_TEST_ALL_PREFIXES(PipelineTest, GetBufferedTimeRanges);
189 FRIEND_TEST_ALL_PREFIXES(PipelineTest, EndedCallback); 190 FRIEND_TEST_ALL_PREFIXES(PipelineTest, EndedCallback);
190 FRIEND_TEST_ALL_PREFIXES(PipelineTest, AudioStreamShorterThanVideo); 191 FRIEND_TEST_ALL_PREFIXES(PipelineTest, AudioStreamShorterThanVideo);
191 friend class MediaLog; 192 friend class MediaLog;
192 193
193 // Pipeline states, as described above. 194 // Pipeline states, as described above.
194 enum State { 195 enum State {
195 kCreated, 196 kCreated,
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 430
430 // NOTE: Weak pointers must be invalidated before all other member variables. 431 // NOTE: Weak pointers must be invalidated before all other member variables.
431 base::WeakPtrFactory<Pipeline> weak_factory_; 432 base::WeakPtrFactory<Pipeline> weak_factory_;
432 433
433 DISALLOW_COPY_AND_ASSIGN(Pipeline); 434 DISALLOW_COPY_AND_ASSIGN(Pipeline);
434 }; 435 };
435 436
436 } // namespace media 437 } // namespace media
437 438
438 #endif // MEDIA_BASE_PIPELINE_H_ 439 #endif // MEDIA_BASE_PIPELINE_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698