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

Side by Side Diff: chromecast/media/cma/base/multi_demuxer_stream_adapter_unittest.cc

Issue 2258493003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::Unretained(this)), 83 base::Unretained(this)),
84 base::TimeDelta::FromSeconds(5)); 84 base::TimeDelta::FromSeconds(5));
85 85
86 media_task_runner_factory_ = new BalancedMediaTaskRunnerFactory( 86 media_task_runner_factory_ = new BalancedMediaTaskRunnerFactory(
87 base::TimeDelta::FromMilliseconds(kMaxPtsDiffMs)); 87 base::TimeDelta::FromMilliseconds(kMaxPtsDiffMs));
88 88
89 coded_frame_providers_.clear(); 89 coded_frame_providers_.clear();
90 frame_received_count_ = 0; 90 frame_received_count_ = 0;
91 91
92 for (auto* stream : demuxer_streams_) { 92 for (auto* stream : demuxer_streams_) {
93 coded_frame_providers_.push_back(base::WrapUnique( 93 coded_frame_providers_.push_back(base::MakeUnique<DemuxerStreamAdapter>(
94 new DemuxerStreamAdapter(base::ThreadTaskRunnerHandle::Get(), 94 base::ThreadTaskRunnerHandle::Get(), media_task_runner_factory_,
95 media_task_runner_factory_, stream))); 95 stream));
96 } 96 }
97 running_stream_count_ = coded_frame_providers_.size(); 97 running_stream_count_ = coded_frame_providers_.size();
98 98
99 // read each stream 99 // read each stream
100 for (auto* code_frame_provider : coded_frame_providers_) { 100 for (auto* code_frame_provider : coded_frame_providers_) {
101 auto read_cb = base::Bind(&MultiDemuxerStreamAdaptersTest::OnNewFrame, 101 auto read_cb = base::Bind(&MultiDemuxerStreamAdaptersTest::OnNewFrame,
102 base::Unretained(this), 102 base::Unretained(this),
103 code_frame_provider); 103 code_frame_provider);
104 104
105 base::Closure task = base::Bind(&CodedFrameProvider::Read, 105 base::Closure task = base::Bind(&CodedFrameProvider::Read,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 total_expected_frames_ = frame_count_short + frame_count_long; 159 total_expected_frames_ = frame_count_short + frame_count_long;
160 160
161 std::unique_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); 161 std::unique_ptr<base::MessageLoop> message_loop(new base::MessageLoop());
162 message_loop->PostTask(FROM_HERE, 162 message_loop->PostTask(FROM_HERE,
163 base::Bind(&MultiDemuxerStreamAdaptersTest::Start, 163 base::Bind(&MultiDemuxerStreamAdaptersTest::Start,
164 base::Unretained(this))); 164 base::Unretained(this)));
165 message_loop->Run(); 165 message_loop->Run();
166 } 166 }
167 } // namespace media 167 } // namespace media
168 } // namespace chromecast 168 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cdm/cast_cdm_proxy.cc ('k') | chromecast/media/cma/pipeline/audio_video_pipeline_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698