| OLD | NEW |
| 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 "net/quic/core/crypto/quic_random.h" | 7 #include "net/quic/core/crypto/quic_random.h" |
| 8 #include "net/quic/core/quic_server_id.h" | 8 #include "net/quic/core/quic_server_id.h" |
| 9 #include "net/quic/core/spdy_utils.h" | 9 #include "net/quic/core/spdy_utils.h" |
| 10 #include "net/quic/platform/api/quic_flags.h" | 10 #include "net/quic/platform/api/quic_flags.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 250 } |
| 251 while (WaitForEvents()) { | 251 while (WaitForEvents()) { |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 QuicSpdyClientStream* QuicClientBase::CreateClientStream() { | 255 QuicSpdyClientStream* QuicClientBase::CreateClientStream() { |
| 256 if (!connected()) { | 256 if (!connected()) { |
| 257 return nullptr; | 257 return nullptr; |
| 258 } | 258 } |
| 259 | 259 |
| 260 auto* stream = static_cast<QuicSpdyClientStream*>( | 260 QuicSpdyClientStream* stream = |
| 261 FLAGS_quic_reloadable_flag_quic_refactor_stream_creation | 261 session_->CreateOutgoingDynamicStream(kDefaultPriority); |
| 262 ? session_->MaybeCreateOutgoingDynamicStream(kDefaultPriority) | |
| 263 : session_->CreateOutgoingDynamicStream(kDefaultPriority)); | |
| 264 if (stream) { | 262 if (stream) { |
| 265 stream->set_visitor(this); | 263 stream->set_visitor(this); |
| 266 } | 264 } |
| 267 return stream; | 265 return stream; |
| 268 } | 266 } |
| 269 | 267 |
| 270 bool QuicClientBase::WaitForEvents() { | 268 bool QuicClientBase::WaitForEvents() { |
| 271 DCHECK(connected()); | 269 DCHECK(connected()); |
| 272 | 270 |
| 273 RunEventLoop(); | 271 RunEventLoop(); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 485 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 488 return latest_response_body_; | 486 return latest_response_body_; |
| 489 } | 487 } |
| 490 | 488 |
| 491 const string& QuicClientBase::latest_response_trailers() const { | 489 const string& QuicClientBase::latest_response_trailers() const { |
| 492 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 490 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 493 return latest_response_trailers_; | 491 return latest_response_trailers_; |
| 494 } | 492 } |
| 495 | 493 |
| 496 } // namespace net | 494 } // namespace net |
| OLD | NEW |