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

Side by Side Diff: net/base/upload_file_element_reader.h

Issue 11419034: net: Move ownership of UploadDataStream from URLRequestHttpJob to URLRequest (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove a local variable Created 8 years 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 | « net/base/upload_element_reader.cc ('k') | net/base/upload_file_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 (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 #ifndef NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ 5 #ifndef NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
6 #define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ 6 #define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 17 matching lines...) Expand all
28 }; 28 };
29 29
30 typedef scoped_ptr_malloc<FileStream, FileStreamDeleter> ScopedFileStreamPtr; 30 typedef scoped_ptr_malloc<FileStream, FileStreamDeleter> ScopedFileStreamPtr;
31 31
32 UploadFileElementReader(const FilePath& path, 32 UploadFileElementReader(const FilePath& path,
33 uint64 range_offset, 33 uint64 range_offset,
34 uint64 range_length, 34 uint64 range_length,
35 const base::Time& expected_modification_time); 35 const base::Time& expected_modification_time);
36 virtual ~UploadFileElementReader(); 36 virtual ~UploadFileElementReader();
37 37
38 const FilePath& path() const { return path_; }
39 uint64 range_offset() const { return range_offset_; }
40 uint64 range_length() const { return range_length_; }
41 const base::Time& expected_modification_time() const {
42 return expected_modification_time_;
43 }
44
38 // UploadElementReader overrides: 45 // UploadElementReader overrides:
46 virtual const UploadFileElementReader* AsFileReader() const OVERRIDE;
39 virtual int Init(const CompletionCallback& callback) OVERRIDE; 47 virtual int Init(const CompletionCallback& callback) OVERRIDE;
40 virtual int InitSync() OVERRIDE; 48 virtual int InitSync() OVERRIDE;
41 virtual uint64 GetContentLength() const OVERRIDE; 49 virtual uint64 GetContentLength() const OVERRIDE;
42 virtual uint64 BytesRemaining() const OVERRIDE; 50 virtual uint64 BytesRemaining() const OVERRIDE;
43 virtual int Read(IOBuffer* buf, 51 virtual int Read(IOBuffer* buf,
44 int buf_length, 52 int buf_length,
45 const CompletionCallback& callback) OVERRIDE; 53 const CompletionCallback& callback) OVERRIDE;
46 virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE; 54 virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE;
47 55
48 private: 56 private:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 uint64 content_length_; 91 uint64 content_length_;
84 uint64 bytes_remaining_; 92 uint64 bytes_remaining_;
85 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; 93 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_;
86 94
87 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); 95 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader);
88 }; 96 };
89 97
90 } // namespace net 98 } // namespace net
91 99
92 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ 100 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_
OLDNEW
« no previous file with comments | « net/base/upload_element_reader.cc ('k') | net/base/upload_file_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698