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

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

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage Created 4 years 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/tools/quic/quic_client_base.h ('k') | net/tools/quic/quic_client_bin.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/tools/quic/quic_client_base.h" 5 #include "net/tools/quic/quic_client_base.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/quic/core/crypto/quic_random.h" 8 #include "net/quic/core/crypto/quic_random.h"
9 #include "net/quic/core/quic_server_id.h" 9 #include "net/quic/core/quic_server_id.h"
10 #include "net/quic/core/spdy_utils.h" 10 #include "net/quic/core/spdy_utils.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 301
302 void QuicClientBase::WaitForStreamToClose(QuicStreamId id) { 302 void QuicClientBase::WaitForStreamToClose(QuicStreamId id) {
303 DCHECK(connected()); 303 DCHECK(connected());
304 304
305 while (connected() && !session_->IsClosedStream(id)) { 305 while (connected() && !session_->IsClosedStream(id)) {
306 WaitForEvents(); 306 WaitForEvents();
307 } 307 }
308 } 308 }
309 309
310 void QuicClientBase::WaitForCryptoHandshakeConfirmed() { 310 bool QuicClientBase::WaitForCryptoHandshakeConfirmed() {
311 DCHECK(connected()); 311 DCHECK(connected());
312 312
313 while (connected() && !session_->IsCryptoHandshakeConfirmed()) { 313 while (connected() && !session_->IsCryptoHandshakeConfirmed()) {
314 WaitForEvents(); 314 WaitForEvents();
315 } 315 }
316
317 // If the handshake fails due to a timeout, the connection will be closed.
318 LOG_IF(ERROR, !connected()) << "Handshake with server failed.";
319 return connected();
316 } 320 }
317 321
318 bool QuicClientBase::connected() const { 322 bool QuicClientBase::connected() const {
319 return session_.get() && session_->connection() && 323 return session_.get() && session_->connection() &&
320 session_->connection()->connected(); 324 session_->connection()->connected();
321 } 325 }
322 326
323 bool QuicClientBase::goaway_received() const { 327 bool QuicClientBase::goaway_received() const {
324 return session_ != nullptr && session_->goaway_received(); 328 return session_ != nullptr && session_->goaway_received();
325 } 329 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 QUIC_BUG_IF(!store_response_) << "Response not stored!"; 476 QUIC_BUG_IF(!store_response_) << "Response not stored!";
473 return latest_response_body_; 477 return latest_response_body_;
474 } 478 }
475 479
476 const string& QuicClientBase::latest_response_trailers() const { 480 const string& QuicClientBase::latest_response_trailers() const {
477 QUIC_BUG_IF(!store_response_) << "Response not stored!"; 481 QUIC_BUG_IF(!store_response_) << "Response not stored!";
478 return latest_response_trailers_; 482 return latest_response_trailers_;
479 } 483 }
480 484
481 } // namespace net 485 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_base.h ('k') | net/tools/quic/quic_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698