OLD | NEW |
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/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 virtual ~UploadFileElementReader(); | 35 virtual ~UploadFileElementReader(); |
36 | 36 |
37 const base::FilePath& path() const { return path_; } | 37 const base::FilePath& path() const { return path_; } |
38 uint64 range_offset() const { return range_offset_; } | 38 uint64 range_offset() const { return range_offset_; } |
39 uint64 range_length() const { return range_length_; } | 39 uint64 range_length() const { return range_length_; } |
40 const base::Time& expected_modification_time() const { | 40 const base::Time& expected_modification_time() const { |
41 return expected_modification_time_; | 41 return expected_modification_time_; |
42 } | 42 } |
43 | 43 |
44 // UploadElementReader overrides: | 44 // UploadElementReader overrides: |
45 virtual const UploadFileElementReader* AsFileReader() const OVERRIDE; | 45 virtual const UploadFileElementReader* AsFileReader() const override; |
46 virtual int Init(const CompletionCallback& callback) OVERRIDE; | 46 virtual int Init(const CompletionCallback& callback) override; |
47 virtual uint64 GetContentLength() const OVERRIDE; | 47 virtual uint64 GetContentLength() const override; |
48 virtual uint64 BytesRemaining() const OVERRIDE; | 48 virtual uint64 BytesRemaining() const override; |
49 virtual int Read(IOBuffer* buf, | 49 virtual int Read(IOBuffer* buf, |
50 int buf_length, | 50 int buf_length, |
51 const CompletionCallback& callback) OVERRIDE; | 51 const CompletionCallback& callback) override; |
52 | 52 |
53 private: | 53 private: |
54 FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); | 54 FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); |
55 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, | 55 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, |
56 UploadFileSmallerThanLength); | 56 UploadFileSmallerThanLength); |
57 | 57 |
58 // Resets this instance to the uninitialized state. | 58 // Resets this instance to the uninitialized state. |
59 void Reset(); | 59 void Reset(); |
60 | 60 |
61 // These methods are used to implement Init(). | 61 // These methods are used to implement Init(). |
(...skipping 22 matching lines...) Expand all Loading... |
84 uint64 content_length_; | 84 uint64 content_length_; |
85 uint64 bytes_remaining_; | 85 uint64 bytes_remaining_; |
86 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; | 86 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); | 88 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace net | 91 } // namespace net |
92 | 92 |
93 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ | 93 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ |
OLD | NEW |