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

Side by Side Diff: net/tools/quic/quic_client.cc

Issue 393953009: Moving the work currently done in the QuicSession constructor to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tools/quic/quic_client.h" 5 #include "net/tools/quic/quic_client.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <netinet/in.h> 8 #include <netinet/in.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/epoll.h> 10 #include <sys/epoll.h>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 bool QuicClient::StartConnect() { 184 bool QuicClient::StartConnect() {
185 DCHECK(initialized_); 185 DCHECK(initialized_);
186 DCHECK(!connected()); 186 DCHECK(!connected());
187 187
188 QuicPacketWriter* writer = CreateQuicPacketWriter(); 188 QuicPacketWriter* writer = CreateQuicPacketWriter();
189 if (writer_.get() != writer) { 189 if (writer_.get() != writer) {
190 writer_.reset(writer); 190 writer_.reset(writer);
191 } 191 }
192 192
193 session_.reset(new QuicClientSession( 193 session_.reset(new QuicClientSession(
194 server_id_,
195 config_, 194 config_,
196 new QuicConnection(GenerateConnectionId(), server_address_, helper_.get(), 195 new QuicConnection(GenerateConnectionId(), server_address_, helper_.get(),
197 writer_.get(), false, supported_versions_), 196 writer_.get(), false, supported_versions_)));
198 &crypto_config_)); 197 session_->InitializeSession(server_id_, &crypto_config_);
199 return session_->CryptoConnect(); 198 return session_->CryptoConnect();
200 } 199 }
201 200
202 bool QuicClient::EncryptionBeingEstablished() { 201 bool QuicClient::EncryptionBeingEstablished() {
203 return !session_->IsEncryptionEstablished() && 202 return !session_->IsEncryptionEstablished() &&
204 session_->connection()->connected(); 203 session_->connection()->connected();
205 } 204 }
206 205
207 void QuicClient::Disconnect() { 206 void QuicClient::Disconnect() {
208 DCHECK(initialized_); 207 DCHECK(initialized_);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 QuicEncryptedPacket packet(buf, bytes_read, false); 342 QuicEncryptedPacket packet(buf, bytes_read, false);
344 343
345 IPEndPoint client_address(client_ip, client_address_.port()); 344 IPEndPoint client_address(client_ip, client_address_.port());
346 session_->connection()->ProcessUdpPacket( 345 session_->connection()->ProcessUdpPacket(
347 client_address, server_address, packet); 346 client_address, server_address, packet);
348 return true; 347 return true;
349 } 348 }
350 349
351 } // namespace tools 350 } // namespace tools
352 } // namespace net 351 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698