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

Side by Side Diff: media/cast/net/udp_transport.cc

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for ChromeOS Created 4 years, 10 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 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/net/udp_transport.h" 5 #include "media/cast/net/udp_transport.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 #include "net/base/io_buffer.h" 16 #include "net/base/io_buffer.h"
17 #include "net/base/net_errors.h" 17 #include "net/base/net_errors.h"
18 #include "net/base/rand_callback.h" 18 #include "net/base/rand_callback.h"
19 19
20 namespace media { 20 namespace media {
21 namespace cast { 21 namespace cast {
22 22
23 namespace { 23 namespace {
24 const int kMaxPacketSize = 1500; 24 const int kMaxPacketSize = 1500;
25 25
26 bool IsEmpty(const net::IPEndPoint& addr) { 26 bool IsEmpty(const net::IPEndPoint& addr) {
27 net::IPAddressNumber empty_addr(addr.address().size()); 27 net::IPAddressNumber empty_addr(addr.address().size());
28 return std::equal( 28 return std::equal(empty_addr.begin(), empty_addr.end(),
29 empty_addr.begin(), empty_addr.end(), addr.address().begin()) && 29 addr.address().bytes().begin()) &&
30 !addr.port(); 30 !addr.port();
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 34
35 UdpTransport::UdpTransport( 35 UdpTransport::UdpTransport(
36 net::NetLog* net_log, 36 net::NetLog* net_log,
37 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy, 37 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy,
38 const net::IPEndPoint& local_end_point, 38 const net::IPEndPoint& local_end_point,
39 const net::IPEndPoint& remote_end_point, 39 const net::IPEndPoint& remote_end_point,
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 ScheduleReceiveNextPacket(); 271 ScheduleReceiveNextPacket();
272 272
273 if (!cb.is_null()) { 273 if (!cb.is_null()) {
274 cb.Run(); 274 cb.Run();
275 } 275 }
276 } 276 }
277 277
278 } // namespace cast 278 } // namespace cast
279 } // namespace media 279 } // namespace media
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/logger.cc ('k') | mojo/services/network/net_address_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698