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

Side by Side Diff: components/cronet/android/url_request_adapter.cc

Issue 643693003: Fix compilation error due to removal of implicit scoped_refptr to ptr conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | components/cronet/android/wrapped_channel_upload_element_reader.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "url_request_adapter.h" 5 #include "url_request_adapter.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // Reads all available data or starts an asynchronous read. 204 // Reads all available data or starts an asynchronous read.
205 void URLRequestAdapter::Read() { 205 void URLRequestAdapter::Read() {
206 while (true) { 206 while (true) {
207 if (read_buffer_->RemainingCapacity() == 0) { 207 if (read_buffer_->RemainingCapacity() == 0) {
208 int new_capacity = read_buffer_->capacity() + kBufferSizeIncrement; 208 int new_capacity = read_buffer_->capacity() + kBufferSizeIncrement;
209 read_buffer_->SetCapacity(new_capacity); 209 read_buffer_->SetCapacity(new_capacity);
210 } 210 }
211 211
212 int bytes_read; 212 int bytes_read;
213 if (url_request_->Read( 213 if (url_request_->Read(read_buffer_.get(),
214 read_buffer_, read_buffer_->RemainingCapacity(), &bytes_read)) { 214 read_buffer_->RemainingCapacity(),
215 &bytes_read)) {
215 if (bytes_read == 0) { 216 if (bytes_read == 0) {
216 OnRequestSucceeded(); 217 OnRequestSucceeded();
217 break; 218 break;
218 } 219 }
219 220
220 VLOG(1) << "Synchronously read: " << bytes_read << " bytes"; 221 VLOG(1) << "Synchronously read: " << bytes_read << " bytes";
221 OnBytesRead(bytes_read); 222 OnBytesRead(bytes_read);
222 } else if (url_request_->status().status() == 223 } else if (url_request_->status().status() ==
223 net::URLRequestStatus::IO_PENDING) { 224 net::URLRequestStatus::IO_PENDING) {
224 if (bytes_read_ != 0) { 225 if (bytes_read_ != 0) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 291
291 delegate_->OnBytesRead(this); 292 delegate_->OnBytesRead(this);
292 delegate_->OnRequestFinished(this); 293 delegate_->OnRequestFinished(this);
293 } 294 }
294 295
295 unsigned char* URLRequestAdapter::Data() const { 296 unsigned char* URLRequestAdapter::Data() const {
296 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer()); 297 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer());
297 } 298 }
298 299
299 } // namespace cronet 300 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/wrapped_channel_upload_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698