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

Unified Diff: media/cast/test/utility/tap_proxy.cc

Issue 1905763002: Convert //media/cast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/test/utility/standalone_cast_environment.cc ('k') | media/cast/test/utility/udp_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/test/utility/tap_proxy.cc
diff --git a/media/cast/test/utility/tap_proxy.cc b/media/cast/test/utility/tap_proxy.cc
index 57166a8ddf327dfdf95dea14416298cc74151093..a54c1763b7c45925c18b3c44d704ce01f9348de2 100644
--- a/media/cast/test/utility/tap_proxy.cc
+++ b/media/cast/test/utility/tap_proxy.cc
@@ -46,7 +46,7 @@ class SendToFDPipe : public PacketPipe {
public:
explicit SendToFDPipe(int fd) : fd_(fd) {
}
- void Send(scoped_ptr<Packet> packet) final {
+ void Send(std::unique_ptr<Packet> packet) final {
while (1) {
int written = write(
fd_,
@@ -70,13 +70,13 @@ class SendToFDPipe : public PacketPipe {
class QueueManager : public base::MessageLoopForIO::Watcher {
public:
- QueueManager(int input_fd, int output_fd, scoped_ptr<PacketPipe> pipe)
+ QueueManager(int input_fd, int output_fd, std::unique_ptr<PacketPipe> pipe)
: input_fd_(input_fd), packet_pipe_(std::move(pipe)) {
CHECK(base::MessageLoopForIO::current()->WatchFileDescriptor(
input_fd_, true, base::MessageLoopForIO::WATCH_READ,
&read_socket_watcher_, this));
- scoped_ptr<PacketPipe> tmp(new SendToFDPipe(output_fd));
+ std::unique_ptr<PacketPipe> tmp(new SendToFDPipe(output_fd));
if (packet_pipe_) {
packet_pipe_->AppendToPipe(std::move(tmp));
} else {
@@ -90,7 +90,7 @@ class QueueManager : public base::MessageLoopForIO::Watcher {
// MessageLoopForIO::Watcher methods
void OnFileCanReadWithoutBlocking(int fd) final {
- scoped_ptr<Packet> packet(new Packet(kMaxPacketSize));
+ std::unique_ptr<Packet> packet(new Packet(kMaxPacketSize));
int nread = read(input_fd_,
reinterpret_cast<char*>(&packet->front()),
kMaxPacketSize);
@@ -107,7 +107,7 @@ class QueueManager : public base::MessageLoopForIO::Watcher {
private:
int input_fd_;
- scoped_ptr<PacketPipe> packet_pipe_;
+ std::unique_ptr<PacketPipe> packet_pipe_;
base::MessageLoopForIO::FileDescriptorWatcher read_socket_watcher_;
base::DefaultTickClock tick_clock_;
};
@@ -170,7 +170,7 @@ ByteCounter out_pipe_output_counter;
class ByteCounterPipe : public media::cast::test::PacketPipe {
public:
ByteCounterPipe(ByteCounter* counter) : counter_(counter) {}
- void Send(scoped_ptr<media::cast::Packet> packet) final {
+ void Send(std::unique_ptr<media::cast::Packet> packet) final {
counter_->Increment(packet->size());
pipe_->Send(std::move(packet));
}
@@ -178,13 +178,13 @@ class ByteCounterPipe : public media::cast::test::PacketPipe {
ByteCounter* counter_;
};
-void SetupByteCounters(scoped_ptr<media::cast::test::PacketPipe>* pipe,
+void SetupByteCounters(std::unique_ptr<media::cast::test::PacketPipe>* pipe,
ByteCounter* pipe_input_counter,
ByteCounter* pipe_output_counter) {
media::cast::test::PacketPipe* new_pipe =
new ByteCounterPipe(pipe_input_counter);
new_pipe->AppendToPipe(std::move(*pipe));
- new_pipe->AppendToPipe(scoped_ptr<media::cast::test::PacketPipe>(
+ new_pipe->AppendToPipe(std::unique_ptr<media::cast::test::PacketPipe>(
new ByteCounterPipe(pipe_output_counter)));
pipe->reset(new_pipe);
}
@@ -276,7 +276,7 @@ int main(int argc, char **argv) {
exit(1);
}
- scoped_ptr<media::cast::test::PacketPipe> in_pipe, out_pipe;
+ std::unique_ptr<media::cast::test::PacketPipe> in_pipe, out_pipe;
std::string network_type = argv[3];
if (network_type == "perfect") {
// No action needed.
« no previous file with comments | « media/cast/test/utility/standalone_cast_environment.cc ('k') | media/cast/test/utility/udp_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698