| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_text_track_stream.h" | 5 #include "media/base/fake_text_track_stream.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/single_thread_task_runner.h" | |
| 10 #include "base/thread_task_runner_handle.h" | |
| 11 #include "media/base/decoder_buffer.h" | 9 #include "media/base/decoder_buffer.h" |
| 12 #include "media/filters/webvtt_util.h" | 10 #include "media/filters/webvtt_util.h" |
| 13 | 11 |
| 14 namespace media { | 12 namespace media { |
| 15 | 13 |
| 16 FakeTextTrackStream::FakeTextTrackStream() | 14 FakeTextTrackStream::FakeTextTrackStream() |
| 17 : task_runner_(base::ThreadTaskRunnerHandle::Get()), | 15 : task_runner_(base::MessageLoopProxy::current()), |
| 18 stopping_(false) { | 16 stopping_(false) { |
| 19 } | 17 } |
| 20 | 18 |
| 21 FakeTextTrackStream::~FakeTextTrackStream() { | 19 FakeTextTrackStream::~FakeTextTrackStream() { |
| 22 DCHECK(read_cb_.is_null()); | 20 DCHECK(read_cb_.is_null()); |
| 23 } | 21 } |
| 24 | 22 |
| 25 void FakeTextTrackStream::Read(const ReadCB& read_cb) { | 23 void FakeTextTrackStream::Read(const ReadCB& read_cb) { |
| 26 DCHECK(!read_cb.is_null()); | 24 DCHECK(!read_cb.is_null()); |
| 27 DCHECK(read_cb_.is_null()); | 25 DCHECK(read_cb_.is_null()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); | 83 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); |
| 86 } | 84 } |
| 87 | 85 |
| 88 void FakeTextTrackStream::Stop() { | 86 void FakeTextTrackStream::Stop() { |
| 89 stopping_ = true; | 87 stopping_ = true; |
| 90 if (!read_cb_.is_null()) | 88 if (!read_cb_.is_null()) |
| 91 AbortPendingRead(); | 89 AbortPendingRead(); |
| 92 } | 90 } |
| 93 | 91 |
| 94 } // namespace media | 92 } // namespace media |
| OLD | NEW |