| 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 QuicSpdyClientStream* stream = | 260 auto* stream = static_cast<QuicSpdyClientStream*>( |
| 261 session_->CreateOutgoingDynamicStream(kDefaultPriority); | 261 FLAGS_quic_reloadable_flag_quic_refactor_stream_creation |
| 262 ? session_->MaybeCreateOutgoingDynamicStream(kDefaultPriority) |
| 263 : session_->CreateOutgoingDynamicStream(kDefaultPriority)); |
| 262 if (stream) { | 264 if (stream) { |
| 263 stream->set_visitor(this); | 265 stream->set_visitor(this); |
| 264 } | 266 } |
| 265 return stream; | 267 return stream; |
| 266 } | 268 } |
| 267 | 269 |
| 268 bool QuicClientBase::WaitForEvents() { | 270 bool QuicClientBase::WaitForEvents() { |
| 269 DCHECK(connected()); | 271 DCHECK(connected()); |
| 270 | 272 |
| 271 RunEventLoop(); | 273 RunEventLoop(); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 487 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 486 return latest_response_body_; | 488 return latest_response_body_; |
| 487 } | 489 } |
| 488 | 490 |
| 489 const string& QuicClientBase::latest_response_trailers() const { | 491 const string& QuicClientBase::latest_response_trailers() const { |
| 490 QUIC_BUG_IF(!store_response_) << "Response not stored!"; | 492 QUIC_BUG_IF(!store_response_) << "Response not stored!"; |
| 491 return latest_response_trailers_; | 493 return latest_response_trailers_; |
| 492 } | 494 } |
| 493 | 495 |
| 494 } // namespace net | 496 } // namespace net |
| OLD | NEW |