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

Side by Side Diff: media/cast/test/utility/in_process_receiver.cc

Issue 2253943004: 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
« no previous file with comments | « media/cast/test/simulator.cc ('k') | media/cdm/simple_cdm_allocator.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cast/test/utility/in_process_receiver.h" 5 #include "media/cast/test/utility/in_process_receiver.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 void InProcessReceiver::StartOnMainThread() { 93 void InProcessReceiver::StartOnMainThread() {
94 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 94 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
95 95
96 DCHECK(!transport_ && !cast_receiver_); 96 DCHECK(!transport_ && !cast_receiver_);
97 97
98 transport_ = CastTransport::Create( 98 transport_ = CastTransport::Create(
99 cast_environment_->Clock(), base::TimeDelta(), 99 cast_environment_->Clock(), base::TimeDelta(),
100 base::WrapUnique(new InProcessReceiver::TransportClient(this)), 100 base::WrapUnique(new InProcessReceiver::TransportClient(this)),
101 base::WrapUnique(new UdpTransport( 101 base::MakeUnique<UdpTransport>(
102 nullptr, cast_environment_->GetTaskRunner(CastEnvironment::MAIN), 102 nullptr, cast_environment_->GetTaskRunner(CastEnvironment::MAIN),
103 local_end_point_, remote_end_point_, 103 local_end_point_, remote_end_point_,
104 base::Bind(&InProcessReceiver::UpdateCastTransportStatus, 104 base::Bind(&InProcessReceiver::UpdateCastTransportStatus,
105 base::Unretained(this)))), 105 base::Unretained(this))),
106 cast_environment_->GetTaskRunner(CastEnvironment::MAIN)); 106 cast_environment_->GetTaskRunner(CastEnvironment::MAIN));
107 107
108 cast_receiver_ = CastReceiver::Create( 108 cast_receiver_ = CastReceiver::Create(
109 cast_environment_, audio_config_, video_config_, transport_.get()); 109 cast_environment_, audio_config_, video_config_, transport_.get());
110 110
111 PullNextAudioFrame(); 111 PullNextAudioFrame();
112 PullNextVideoFrame(); 112 PullNextVideoFrame();
113 } 113 }
114 114
115 void InProcessReceiver::GotAudioFrame(std::unique_ptr<AudioBus> audio_frame, 115 void InProcessReceiver::GotAudioFrame(std::unique_ptr<AudioBus> audio_frame,
(...skipping 28 matching lines...) Expand all
144 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr())); 144 &InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr()));
145 } 145 }
146 146
147 void InProcessReceiver::ReceivePacket(std::unique_ptr<Packet> packet) { 147 void InProcessReceiver::ReceivePacket(std::unique_ptr<Packet> packet) {
148 // TODO(Hubbe): Make an InsertPacket method instead. 148 // TODO(Hubbe): Make an InsertPacket method instead.
149 cast_receiver_->ReceivePacket(std::move(packet)); 149 cast_receiver_->ReceivePacket(std::move(packet));
150 } 150 }
151 151
152 } // namespace cast 152 } // namespace cast
153 } // namespace media 153 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/simulator.cc ('k') | media/cdm/simple_cdm_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698