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

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

Issue 1105163004: Revert of [media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « media/cast/test/utility/tap_proxy.cc ('k') | media/cast/test/utility/udp_proxy_main.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 <math.h> 5 #include <math.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <vector> 7 #include <vector>
8 8
9 #include "media/cast/test/utility/udp_proxy.h" 9 #include "media/cast/test/utility/udp_proxy.h"
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/single_thread_task_runner.h"
14 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
15 #include "base/thread_task_runner_handle.h"
16 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
17 #include "base/time/default_tick_clock.h" 15 #include "base/time/default_tick_clock.h"
18 #include "net/base/io_buffer.h" 16 #include "net/base/io_buffer.h"
19 #include "net/base/net_errors.h" 17 #include "net/base/net_errors.h"
20 #include "net/udp/udp_server_socket.h" 18 #include "net/udp/udp_server_socket.h"
21 19
22 namespace media { 20 namespace media {
23 namespace cast { 21 namespace cast {
24 namespace test { 22 namespace test {
25 23
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 LOG(ERROR) << "Failed to write packet."; 734 LOG(ERROR) << "Failed to write packet.";
737 } 735 }
738 } 736 }
739 737
740 private: 738 private:
741 void Start(base::WaitableEvent* start_event, 739 void Start(base::WaitableEvent* start_event,
742 net::NetLog* net_log) { 740 net::NetLog* net_log) {
743 socket_.reset(new net::UDPServerSocket(net_log, net::NetLog::Source())); 741 socket_.reset(new net::UDPServerSocket(net_log, net::NetLog::Source()));
744 BuildPipe(&to_dest_pipe_, new PacketSender(this, &destination_)); 742 BuildPipe(&to_dest_pipe_, new PacketSender(this, &destination_));
745 BuildPipe(&from_dest_pipe_, new PacketSender(this, &return_address_)); 743 BuildPipe(&from_dest_pipe_, new PacketSender(this, &return_address_));
746 to_dest_pipe_->InitOnIOThread(base::ThreadTaskRunnerHandle::Get(), 744 to_dest_pipe_->InitOnIOThread(base::MessageLoopProxy::current(),
747 &tick_clock_); 745 &tick_clock_);
748 from_dest_pipe_->InitOnIOThread(base::ThreadTaskRunnerHandle::Get(), 746 from_dest_pipe_->InitOnIOThread(base::MessageLoopProxy::current(),
749 &tick_clock_); 747 &tick_clock_);
750 748
751 VLOG(0) << "From:" << local_port_.ToString(); 749 VLOG(0) << "From:" << local_port_.ToString();
752 if (!destination_is_mutable_) 750 if (!destination_is_mutable_)
753 VLOG(0) << "To:" << destination_.ToString(); 751 VLOG(0) << "To:" << destination_.ToString();
754 752
755 CHECK_GE(socket_->Listen(local_port_), 0); 753 CHECK_GE(socket_->Listen(local_port_), 0);
756 754
757 start_event->Signal(); 755 start_event->Signal();
758 PollRead(); 756 PollRead();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 destination, 855 destination,
858 to_dest_pipe.Pass(), 856 to_dest_pipe.Pass(),
859 from_dest_pipe.Pass(), 857 from_dest_pipe.Pass(),
860 net_log)); 858 net_log));
861 return ret.Pass(); 859 return ret.Pass();
862 } 860 }
863 861
864 } // namespace test 862 } // namespace test
865 } // namespace cast 863 } // namespace cast
866 } // namespace media 864 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/utility/tap_proxy.cc ('k') | media/cast/test/utility/udp_proxy_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698