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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 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 | Annotate | Revision Log
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/http/http_response_body_drainer.h" 5 #include "net/http/http_response_body_drainer.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 81 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
82 82
83 return rv; 83 return rv;
84 } 84 }
85 85
86 int HttpResponseBodyDrainer::DoDrainResponseBody() { 86 int HttpResponseBodyDrainer::DoDrainResponseBody() {
87 next_state_ = STATE_DRAIN_RESPONSE_BODY_COMPLETE; 87 next_state_ = STATE_DRAIN_RESPONSE_BODY_COMPLETE;
88 88
89 return stream_->ReadResponseBody( 89 return stream_->ReadResponseBody(
90 read_buf_, read_size_ - total_read_, 90 read_buf_.get(),
91 read_size_ - total_read_,
91 base::Bind(&HttpResponseBodyDrainer::OnIOComplete, 92 base::Bind(&HttpResponseBodyDrainer::OnIOComplete,
92 base::Unretained(this))); 93 base::Unretained(this)));
93 } 94 }
94 95
95 int HttpResponseBodyDrainer::DoDrainResponseBodyComplete(int result) { 96 int HttpResponseBodyDrainer::DoDrainResponseBodyComplete(int result) {
96 DCHECK_NE(ERR_IO_PENDING, result); 97 DCHECK_NE(ERR_IO_PENDING, result);
97 98
98 if (result < 0) 99 if (result < 0)
99 return result; 100 return result;
100 101
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 stream_->Close(true /* no keep-alive */); 136 stream_->Close(true /* no keep-alive */);
136 } else { 137 } else {
137 DCHECK_EQ(OK, result); 138 DCHECK_EQ(OK, result);
138 stream_->Close(false /* keep-alive */); 139 stream_->Close(false /* keep-alive */);
139 } 140 }
140 141
141 delete this; 142 delete this;
142 } 143 }
143 144
144 } // namespace net 145 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool_spdy3_unittest.cc ('k') | net/http/http_response_body_drainer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698