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

Side by Side Diff: net/http/bidirectional_stream.cc

Issue 1992953004: [Cronet] Make delaying sending request headers explicit in bidirectional stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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/http/bidirectional_stream.h" 5 #include "net/http/bidirectional_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 BidirectionalStream::Delegate::Delegate() {} 60 BidirectionalStream::Delegate::Delegate() {}
61 61
62 void BidirectionalStream::Delegate::OnStreamReady() {} 62 void BidirectionalStream::Delegate::OnStreamReady() {}
63 63
64 BidirectionalStream::Delegate::~Delegate() {} 64 BidirectionalStream::Delegate::~Delegate() {}
65 65
66 BidirectionalStream::BidirectionalStream( 66 BidirectionalStream::BidirectionalStream(
67 std::unique_ptr<BidirectionalStreamRequestInfo> request_info, 67 std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
68 HttpNetworkSession* session, 68 HttpNetworkSession* session,
69 bool disable_auto_flush, 69 bool delay_headers_until_next_send_data,
70 Delegate* delegate) 70 Delegate* delegate)
71 : BidirectionalStream(std::move(request_info), 71 : BidirectionalStream(std::move(request_info),
72 session, 72 session,
73 disable_auto_flush, 73 delay_headers_until_next_send_data,
74 delegate, 74 delegate,
75 base::WrapUnique(new base::Timer(false, false))) {} 75 base::WrapUnique(new base::Timer(false, false))) {}
76 76
77 BidirectionalStream::BidirectionalStream( 77 BidirectionalStream::BidirectionalStream(
78 std::unique_ptr<BidirectionalStreamRequestInfo> request_info, 78 std::unique_ptr<BidirectionalStreamRequestInfo> request_info,
79 HttpNetworkSession* session, 79 HttpNetworkSession* session,
80 bool disable_auto_flush, 80 bool delay_headers_until_next_send_data,
81 Delegate* delegate, 81 Delegate* delegate,
82 std::unique_ptr<base::Timer> timer) 82 std::unique_ptr<base::Timer> timer)
83 : request_info_(std::move(request_info)), 83 : request_info_(std::move(request_info)),
84 net_log_(BoundNetLog::Make(session->net_log(), 84 net_log_(BoundNetLog::Make(session->net_log(),
85 NetLog::SOURCE_BIDIRECTIONAL_STREAM)), 85 NetLog::SOURCE_BIDIRECTIONAL_STREAM)),
86 session_(session), 86 session_(session),
87 disable_auto_flush_(disable_auto_flush), 87 delay_headers_until_next_send_data_(delay_headers_until_next_send_data),
88 delegate_(delegate), 88 delegate_(delegate),
89 timer_(std::move(timer)) { 89 timer_(std::move(timer)) {
90 DCHECK(delegate_); 90 DCHECK(delegate_);
91 DCHECK(request_info_); 91 DCHECK(request_info_);
92 92
93 SSLConfig server_ssl_config; 93 SSLConfig server_ssl_config;
94 session->ssl_config_service()->GetSSLConfig(&server_ssl_config); 94 session->ssl_config_service()->GetSSLConfig(&server_ssl_config);
95 session->GetAlpnProtos(&server_ssl_config.alpn_protos); 95 session->GetAlpnProtos(&server_ssl_config.alpn_protos);
96 session->GetNpnProtos(&server_ssl_config.npn_protos); 96 session->GetNpnProtos(&server_ssl_config.npn_protos);
97 97
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 void BidirectionalStream::OnBidirectionalStreamImplReady( 273 void BidirectionalStream::OnBidirectionalStreamImplReady(
274 const SSLConfig& used_ssl_config, 274 const SSLConfig& used_ssl_config,
275 const ProxyInfo& used_proxy_info, 275 const ProxyInfo& used_proxy_info,
276 BidirectionalStreamImpl* stream) { 276 BidirectionalStreamImpl* stream) {
277 DCHECK(!stream_impl_); 277 DCHECK(!stream_impl_);
278 278
279 stream_request_.reset(); 279 stream_request_.reset();
280 stream_impl_.reset(stream); 280 stream_impl_.reset(stream);
281 stream_impl_->Start(request_info_.get(), net_log_, disable_auto_flush_, this, 281 stream_impl_->Start(request_info_.get(), net_log_,
282 delay_headers_until_next_send_data_, this,
282 std::move(timer_)); 283 std::move(timer_));
283 } 284 }
284 285
285 void BidirectionalStream::OnWebSocketHandshakeStreamReady( 286 void BidirectionalStream::OnWebSocketHandshakeStreamReady(
286 const SSLConfig& used_ssl_config, 287 const SSLConfig& used_ssl_config,
287 const ProxyInfo& used_proxy_info, 288 const ProxyInfo& used_proxy_info,
288 WebSocketHandshakeStreamBase* stream) { 289 WebSocketHandshakeStreamBase* stream) {
289 NOTREACHED(); 290 NOTREACHED();
290 } 291 }
291 292
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 const ProxyInfo& used_proxy_info, 333 const ProxyInfo& used_proxy_info,
333 HttpStream* stream) { 334 HttpStream* stream) {
334 DCHECK(stream_request_); 335 DCHECK(stream_request_);
335 336
336 delegate_->OnFailed(ERR_HTTPS_PROXY_TUNNEL_RESPONSE); 337 delegate_->OnFailed(ERR_HTTPS_PROXY_TUNNEL_RESPONSE);
337 } 338 }
338 339
339 void BidirectionalStream::OnQuicBroken() {} 340 void BidirectionalStream::OnQuicBroken() {}
340 341
341 } // namespace net 342 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698