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

Side by Side Diff: components/cronet/ios/cronet_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: correct a typo Created 4 years, 6 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 | « components/cronet/ios/cronet_bidirectional_stream.h ('k') | net/http/bidirectional_stream.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/cronet/ios/cronet_bidirectional_stream.h" 5 #include "components/cronet/ios/cronet_bidirectional_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void CronetBidirectionalStream::Destroy() { 107 void CronetBidirectionalStream::Destroy() {
108 // Destroy could be called from any thread, including network thread (if 108 // Destroy could be called from any thread, including network thread (if
109 // posting task to executor throws an exception), but is posted, so |this| 109 // posting task to executor throws an exception), but is posted, so |this|
110 // is valid until calling task is complete. 110 // is valid until calling task is complete.
111 environment_->PostToNetworkThread( 111 environment_->PostToNetworkThread(
112 FROM_HERE, base::Bind(&CronetBidirectionalStream::DestroyOnNetworkThread, 112 FROM_HERE, base::Bind(&CronetBidirectionalStream::DestroyOnNetworkThread,
113 base::Unretained(this))); 113 base::Unretained(this)));
114 } 114 }
115 115
116 void CronetBidirectionalStream::OnStreamReady() { 116 void CronetBidirectionalStream::OnStreamReady(bool /*request_headers_sent*/) {
117 DCHECK(environment_->IsOnNetworkThread()); 117 DCHECK(environment_->IsOnNetworkThread());
118 DCHECK(write_state_ == STARTED); 118 DCHECK(write_state_ == STARTED);
119 write_state_ = WAITING_FOR_WRITE; 119 write_state_ = WAITING_FOR_WRITE;
120 if (write_end_of_stream_) 120 if (write_end_of_stream_)
121 write_state_ = WRITING_DONE; 121 write_state_ = WRITING_DONE;
122 delegate_->OnStreamReady(); 122 delegate_->OnStreamReady();
123 } 123 }
124 124
125 void CronetBidirectionalStream::OnHeadersReceived( 125 void CronetBidirectionalStream::OnHeadersReceived(
126 const net::SpdyHeaderBlock& response_headers) { 126 const net::SpdyHeaderBlock& response_headers) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void CronetBidirectionalStream::MaybeOnSucceded() { 266 void CronetBidirectionalStream::MaybeOnSucceded() {
267 DCHECK(environment_->IsOnNetworkThread()); 267 DCHECK(environment_->IsOnNetworkThread());
268 if (read_state_ == READING_DONE && write_state_ == WRITING_DONE) { 268 if (read_state_ == READING_DONE && write_state_ == WRITING_DONE) {
269 read_state_ = write_state_ = SUCCESS; 269 read_state_ = write_state_ = SUCCESS;
270 bidi_stream_.reset(); 270 bidi_stream_.reset();
271 delegate_->OnSucceeded(); 271 delegate_->OnSucceeded();
272 } 272 }
273 } 273 }
274 274
275 } // namespace cronet 275 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/ios/cronet_bidirectional_stream.h ('k') | net/http/bidirectional_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698