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

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

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 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
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/tools/quic/quic_client_session_test.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 (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/socket.h> 10 #include <sys/socket.h>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void QuicClient::StartConnect() { 194 void QuicClient::StartConnect() {
195 DCHECK(initialized_); 195 DCHECK(initialized_);
196 DCHECK(!connected()); 196 DCHECK(!connected());
197 197
198 QuicPacketWriter* writer = CreateQuicPacketWriter(); 198 QuicPacketWriter* writer = CreateQuicPacketWriter();
199 199
200 DummyPacketWriterFactory factory(writer); 200 DummyPacketWriterFactory factory(writer);
201 201
202 session_.reset(new QuicClientSession( 202 session_.reset(new QuicClientSession(
203 config_, 203 config_,
204 new QuicConnection(GenerateConnectionId(), 204 new QuicConnection(GenerateConnectionId(), server_address_, helper_.get(),
205 server_address_,
206 helper_.get(),
207 factory, 205 factory,
208 /* owns_writer= */ false, 206 /* owns_writer= */ false, Perspective::IS_CLIENT,
209 /* is_server= */ false, 207 server_id_.is_https(), supported_versions_)));
210 server_id_.is_https(),
211 supported_versions_)));
212 208
213 // Reset |writer_| after |session_| so that the old writer outlives the old 209 // Reset |writer_| after |session_| so that the old writer outlives the old
214 // session. 210 // session.
215 if (writer_.get() != writer) { 211 if (writer_.get() != writer) {
216 writer_.reset(writer); 212 writer_.reset(writer);
217 } 213 }
218 session_->InitializeSession(server_id_, &crypto_config_); 214 session_->InitializeSession(server_id_, &crypto_config_);
219 session_->CryptoConnect(); 215 session_->CryptoConnect();
220 } 216 }
221 217
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 QuicEncryptedPacket packet(buf, bytes_read, false); 396 QuicEncryptedPacket packet(buf, bytes_read, false);
401 397
402 IPEndPoint client_address(client_ip, client_address_.port()); 398 IPEndPoint client_address(client_ip, client_address_.port());
403 session_->connection()->ProcessUdpPacket( 399 session_->connection()->ProcessUdpPacket(
404 client_address, server_address, packet); 400 client_address, server_address, packet);
405 return true; 401 return true;
406 } 402 }
407 403
408 } // namespace tools 404 } // namespace tools
409 } // namespace net 405 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.cc ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698