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

Side by Side Diff: net/base/upload_bytes_element_reader.cc

Issue 10913179: net: Make UploadDataStream::Init() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed argument order Created 8 years, 3 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/base/upload_bytes_element_reader.h ('k') | net/base/upload_data_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 (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_bytes_element_reader.h" 5 #include "net/base/upload_bytes_element_reader.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 UploadBytesElementReader::UploadBytesElementReader(const char* bytes, 12 UploadBytesElementReader::UploadBytesElementReader(const char* bytes,
13 int bytes_length) 13 int bytes_length)
14 : bytes_(bytes), 14 : bytes_(bytes),
15 bytes_length_(bytes_length), 15 bytes_length_(bytes_length),
16 offset_(0) { 16 offset_(0) {
17 } 17 }
18 18
19 UploadBytesElementReader::~UploadBytesElementReader() { 19 UploadBytesElementReader::~UploadBytesElementReader() {
20 } 20 }
21 21
22 int UploadBytesElementReader::Init(const CompletionCallback& callback) {
23 return OK;
24 }
25
22 int UploadBytesElementReader::InitSync() { 26 int UploadBytesElementReader::InitSync() {
23 return OK; 27 return OK;
24 } 28 }
25 29
26 uint64 UploadBytesElementReader::GetContentLength() const { 30 uint64 UploadBytesElementReader::GetContentLength() const {
27 return bytes_length_; 31 return bytes_length_;
28 } 32 }
29 33
30 uint64 UploadBytesElementReader::BytesRemaining() const { 34 uint64 UploadBytesElementReader::BytesRemaining() const {
31 return bytes_length_ - offset_; 35 return bytes_length_ - offset_;
(...skipping 13 matching lines...) Expand all
45 49
46 offset_ += num_bytes_to_read; 50 offset_ += num_bytes_to_read;
47 return num_bytes_to_read; 51 return num_bytes_to_read;
48 } 52 }
49 53
50 bool UploadBytesElementReader::IsInMemory() const { 54 bool UploadBytesElementReader::IsInMemory() const {
51 return true; 55 return true;
52 } 56 }
53 57
54 } // namespace net 58 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_bytes_element_reader.h ('k') | net/base/upload_data_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698