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

Side by Side Diff: net/base/upload_data_stream.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/base/upload_data_stream.h" 5 #include "net/base/upload_data_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/upload_bytes_element_reader.h" 10 #include "net/base/upload_bytes_element_reader.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 if (reader->BytesRemaining() == 0) { 183 if (reader->BytesRemaining() == 0) {
184 ++element_index_; 184 ++element_index_;
185 continue; 185 continue;
186 } 186 }
187 187
188 if (buf->BytesRemaining() == 0) 188 if (buf->BytesRemaining() == 0)
189 break; 189 break;
190 190
191 int result = reader->Read( 191 int result = reader->Read(
192 buf, 192 buf.get(),
193 buf->BytesRemaining(), 193 buf->BytesRemaining(),
194 base::Bind(base::IgnoreResult(&UploadDataStream::ResumePendingRead), 194 base::Bind(base::IgnoreResult(&UploadDataStream::ResumePendingRead),
195 weak_ptr_factory_.GetWeakPtr(), 195 weak_ptr_factory_.GetWeakPtr(),
196 buf, 196 buf,
197 callback)); 197 callback));
198 if (result == ERR_IO_PENDING) { 198 if (result == ERR_IO_PENDING) {
199 DCHECK(!callback.is_null()); 199 DCHECK(!callback.is_null());
200 return ERR_IO_PENDING; 200 return ERR_IO_PENDING;
201 } 201 }
202 ProcessReadResult(buf, result); 202 ProcessReadResult(buf, result);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 DCHECK_NE(ERR_IO_PENDING, result); 255 DCHECK_NE(ERR_IO_PENDING, result);
256 DCHECK(!read_failed_); 256 DCHECK(!read_failed_);
257 257
258 if (result >= 0) 258 if (result >= 0)
259 buf->DidConsume(result); 259 buf->DidConsume(result);
260 else 260 else
261 read_failed_ = true; 261 read_failed_ = true;
262 } 262 }
263 263
264 } // namespace net 264 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_bytes_element_reader_unittest.cc ('k') | net/base/upload_data_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698