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/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int result); | 70 int result); |
71 | 71 |
72 // This method is used to implement Read(). | 72 // This method is used to implement Read(). |
73 void OnReadCompleted(ScopedFileStreamPtr file_stream, | 73 void OnReadCompleted(ScopedFileStreamPtr file_stream, |
74 const CompletionCallback& callback, | 74 const CompletionCallback& callback, |
75 int result); | 75 int result); |
76 | 76 |
77 // Sets an value to override the result for GetContentLength(). | 77 // Sets an value to override the result for GetContentLength(). |
78 // Used for tests. | 78 // Used for tests. |
79 struct NET_EXPORT_PRIVATE ScopedOverridingContentLengthForTests { | 79 struct NET_EXPORT_PRIVATE ScopedOverridingContentLengthForTests { |
80 ScopedOverridingContentLengthForTests(uint64 value); | 80 explicit ScopedOverridingContentLengthForTests(uint64 value); |
81 ~ScopedOverridingContentLengthForTests(); | 81 ~ScopedOverridingContentLengthForTests(); |
82 }; | 82 }; |
83 | 83 |
84 const FilePath path_; | 84 const FilePath path_; |
85 const uint64 range_offset_; | 85 const uint64 range_offset_; |
86 const uint64 range_length_; | 86 const uint64 range_length_; |
87 const base::Time expected_modification_time_; | 87 const base::Time expected_modification_time_; |
88 ScopedFileStreamPtr file_stream_; | 88 ScopedFileStreamPtr file_stream_; |
89 uint64 content_length_; | 89 uint64 content_length_; |
90 uint64 bytes_remaining_; | 90 uint64 bytes_remaining_; |
(...skipping 29 matching lines...) Expand all Loading... |
120 scoped_ptr<FileStream> file_stream_; | 120 scoped_ptr<FileStream> file_stream_; |
121 uint64 content_length_; | 121 uint64 content_length_; |
122 uint64 bytes_remaining_; | 122 uint64 bytes_remaining_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReaderSync); | 124 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReaderSync); |
125 }; | 125 }; |
126 | 126 |
127 } // namespace net | 127 } // namespace net |
128 | 128 |
129 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ | 129 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ |
OLD | NEW |