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

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

Issue 1116683002: [media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch Created 5 years, 7 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
« no previous file with comments | « media/base/bind_to_current_loop.h ('k') | media/base/serial_runner.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 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"
9 #include "media/base/decoder_buffer.h" 11 #include "media/base/decoder_buffer.h"
10 #include "media/filters/webvtt_util.h" 12 #include "media/filters/webvtt_util.h"
11 13
12 namespace media { 14 namespace media {
13 15
14 FakeTextTrackStream::FakeTextTrackStream() 16 FakeTextTrackStream::FakeTextTrackStream()
15 : task_runner_(base::MessageLoopProxy::current()), 17 : task_runner_(base::ThreadTaskRunnerHandle::Get()),
16 stopping_(false) { 18 stopping_(false) {
17 } 19 }
18 20
19 FakeTextTrackStream::~FakeTextTrackStream() { 21 FakeTextTrackStream::~FakeTextTrackStream() {
20 DCHECK(read_cb_.is_null()); 22 DCHECK(read_cb_.is_null());
21 } 23 }
22 24
23 void FakeTextTrackStream::Read(const ReadCB& read_cb) { 25 void FakeTextTrackStream::Read(const ReadCB& read_cb) {
24 DCHECK(!read_cb.is_null()); 26 DCHECK(!read_cb.is_null());
25 DCHECK(read_cb_.is_null()); 27 DCHECK(read_cb_.is_null());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer()); 85 base::ResetAndReturn(&read_cb_).Run(kOk, DecoderBuffer::CreateEOSBuffer());
84 } 86 }
85 87
86 void FakeTextTrackStream::Stop() { 88 void FakeTextTrackStream::Stop() {
87 stopping_ = true; 89 stopping_ = true;
88 if (!read_cb_.is_null()) 90 if (!read_cb_.is_null())
89 AbortPendingRead(); 91 AbortPendingRead();
90 } 92 }
91 93
92 } // namespace media 94 } // namespace media
OLDNEW
« no previous file with comments | « media/base/bind_to_current_loop.h ('k') | media/base/serial_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698