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

Side by Side Diff: net/quic/p2p/quic_p2p_session.cc

Issue 1809863002: Update some callers to use more direct ways of constructing IPAddress from well known literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/p2p/quic_p2p_session.h" 5 #include "net/quic/p2p/quic_p2p_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 13 matching lines...) Expand all
24 : QuicSession(connection.release(), config), 24 : QuicSession(connection.release(), config),
25 socket_(std::move(socket)), 25 socket_(std::move(socket)),
26 crypto_stream_(new QuicP2PCryptoStream(this, crypto_config)), 26 crypto_stream_(new QuicP2PCryptoStream(this, crypto_config)),
27 read_buffer_(new IOBuffer(static_cast<size_t>(kMaxPacketSize))) { 27 read_buffer_(new IOBuffer(static_cast<size_t>(kMaxPacketSize))) {
28 DCHECK(config.negotiated()); 28 DCHECK(config.negotiated());
29 29
30 // Non-null IP address needs to be passed here because QuicConnection uses 30 // Non-null IP address needs to be passed here because QuicConnection uses
31 // ToString() to format addresses for logging and ToString() is not allowed 31 // ToString() to format addresses for logging and ToString() is not allowed
32 // for empty addresses. 32 // for empty addresses.
33 // TODO(sergeyu): Fix QuicConnection and remove SetSelfAddress() call below. 33 // TODO(sergeyu): Fix QuicConnection and remove SetSelfAddress() call below.
34 this->connection()->SetSelfAddress(IPEndPoint(IPAddress(0, 0, 0, 0), 0)); 34 this->connection()->SetSelfAddress(IPEndPoint(IPAddress::IPv4AllZeros(), 0));
35 } 35 }
36 36
37 QuicP2PSession::~QuicP2PSession() {} 37 QuicP2PSession::~QuicP2PSession() {}
38 38
39 void QuicP2PSession::Initialize() { 39 void QuicP2PSession::Initialize() {
40 QuicSession::Initialize(); 40 QuicSession::Initialize();
41 crypto_stream_->Connect(); 41 crypto_stream_->Connect();
42 DoReadLoop(OK); 42 DoReadLoop(OK);
43 } 43 }
44 44
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return result; 124 return result;
125 } 125 }
126 126
127 QuicEncryptedPacket packet(read_buffer_->data(), result); 127 QuicEncryptedPacket packet(read_buffer_->data(), result);
128 connection()->ProcessUdpPacket(connection()->self_address(), 128 connection()->ProcessUdpPacket(connection()->self_address(),
129 connection()->peer_address(), packet); 129 connection()->peer_address(), packet);
130 return OK; 130 return OK;
131 } 131 }
132 132
133 } // namespace net 133 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698