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

Side by Side Diff: net/spdy/spdy_http_stream.cc

Issue 10910268: net: Make UploadDataStream::Read() asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_parser.cc ('k') | net/url_request/url_request.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/spdy/spdy_http_stream.h" 5 #include "net/spdy/spdy_http_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 10
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 callback_.Reset(); 276 callback_.Reset();
277 if (stream_) 277 if (stream_)
278 stream_->Cancel(); 278 stream_->Cancel();
279 } 279 }
280 280
281 int SpdyHttpStream::SendData() { 281 int SpdyHttpStream::SendData() {
282 CHECK(request_body_stream_.get()); 282 CHECK(request_body_stream_.get());
283 CHECK_EQ(0, request_body_buf_->BytesRemaining()); 283 CHECK_EQ(0, request_body_buf_->BytesRemaining());
284 284
285 // Read the data from the request body stream. 285 // Read the data from the request body stream.
286 const int bytes_read = request_body_stream_->Read( 286 const int bytes_read = request_body_stream_->ReadSync(
287 raw_request_body_buf_, raw_request_body_buf_->size()); 287 raw_request_body_buf_, raw_request_body_buf_->size());
288 DCHECK(!waiting_for_chunk_ || bytes_read != ERR_IO_PENDING); 288 DCHECK(!waiting_for_chunk_ || bytes_read != ERR_IO_PENDING);
289 289
290 if (request_body_stream_->is_chunked() && bytes_read == ERR_IO_PENDING) { 290 if (request_body_stream_->is_chunked() && bytes_read == ERR_IO_PENDING) {
291 waiting_for_chunk_ = true; 291 waiting_for_chunk_ = true;
292 return ERR_IO_PENDING; 292 return ERR_IO_PENDING;
293 } 293 }
294 294
295 waiting_for_chunk_ = false; 295 waiting_for_chunk_ = false;
296 296
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 bool SpdyHttpStream::IsSpdyHttpStream() const { 542 bool SpdyHttpStream::IsSpdyHttpStream() const {
543 return true; 543 return true;
544 } 544 }
545 545
546 void SpdyHttpStream::Drain(HttpNetworkSession* session) { 546 void SpdyHttpStream::Drain(HttpNetworkSession* session) {
547 Close(false); 547 Close(false);
548 delete this; 548 delete this;
549 } 549 }
550 550
551 } // namespace net 551 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_parser.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698