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

Side by Side Diff: net/quic/platform/api/quic_socket_address.cc

Issue 2874333002: Construct QuicSocketAddressImpl in QuicChromiumPacketReadder and pass it by const&. (Closed)
Patch Set: Created 3 years, 7 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 | « net/quic/platform/api/quic_socket_address.h ('k') | net/tools/quic/quic_simple_client.h » ('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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 "net/quic/platform/api/quic_socket_address.h" 5 #include "net/quic/platform/api/quic_socket_address.h"
6 6
7 using std::string; 7 using std::string;
8 8
9 namespace net { 9 namespace net {
10 10
11 QuicSocketAddress::QuicSocketAddress(QuicIpAddress address, uint16_t port) 11 QuicSocketAddress::QuicSocketAddress(QuicIpAddress address, uint16_t port)
12 : impl_(address.impl(), port) {} 12 : impl_(address.impl(), port) {}
13 13
14 QuicSocketAddress::QuicSocketAddress(const struct sockaddr_storage& saddr) 14 QuicSocketAddress::QuicSocketAddress(const struct sockaddr_storage& saddr)
15 : impl_(saddr) {} 15 : impl_(saddr) {}
16 16
17 QuicSocketAddress::QuicSocketAddress(const struct sockaddr& saddr) 17 QuicSocketAddress::QuicSocketAddress(const struct sockaddr& saddr)
18 : impl_(saddr) {} 18 : impl_(saddr) {}
19 19
20 QuicSocketAddress::QuicSocketAddress(const QuicSocketAddressImpl& impl) 20 QuicSocketAddress::QuicSocketAddress(const QuicSocketAddressImpl& impl)
21 : impl_(impl) {} 21 : impl_(impl) {}
22 22
23 bool operator==(QuicSocketAddress lhs, QuicSocketAddress rhs) { 23 bool operator==(const QuicSocketAddress& lhs, const QuicSocketAddress& rhs) {
24 return lhs.impl_ == rhs.impl_; 24 return lhs.impl_ == rhs.impl_;
25 } 25 }
26 26
27 bool operator!=(QuicSocketAddress lhs, QuicSocketAddress rhs) { 27 bool operator!=(const QuicSocketAddress& lhs, const QuicSocketAddress& rhs) {
28 return lhs.impl_ != rhs.impl_; 28 return lhs.impl_ != rhs.impl_;
29 } 29 }
30 30
31 bool QuicSocketAddress::IsInitialized() const { 31 bool QuicSocketAddress::IsInitialized() const {
32 return impl_.IsInitialized(); 32 return impl_.IsInitialized();
33 } 33 }
34 34
35 string QuicSocketAddress::ToString() const { 35 string QuicSocketAddress::ToString() const {
36 return impl_.ToString(); 36 return impl_.ToString();
37 } 37 }
(...skipping 12 matching lines...) Expand all
50 50
51 uint16_t QuicSocketAddress::port() const { 51 uint16_t QuicSocketAddress::port() const {
52 return impl_.port(); 52 return impl_.port();
53 } 53 }
54 54
55 sockaddr_storage QuicSocketAddress::generic_address() const { 55 sockaddr_storage QuicSocketAddress::generic_address() const {
56 return impl_.generic_address(); 56 return impl_.generic_address();
57 } 57 }
58 58
59 } // namespace net 59 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/platform/api/quic_socket_address.h ('k') | net/tools/quic/quic_simple_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698