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 BASE_FILES_FILE_H_ | 5 #ifndef BASE_FILES_FILE_H_ |
6 #define BASE_FILES_FILE_H_ | 6 #define BASE_FILES_FILE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 // The last modified time of a file. | 148 // The last modified time of a file. |
149 base::Time last_modified; | 149 base::Time last_modified; |
150 | 150 |
151 // The last accessed time of a file. | 151 // The last accessed time of a file. |
152 base::Time last_accessed; | 152 base::Time last_accessed; |
153 | 153 |
154 // The creation time of a file. | 154 // The creation time of a file. |
155 base::Time creation_time; | 155 base::Time creation_time; |
156 }; | 156 }; |
157 | 157 |
158 // Used to hold information about a region [offset + size] of a file. | |
159 struct BASE_EXPORT Region { | |
willchan no longer on Chromium
2014/07/21 23:55:40
Why is this a property of the file as opposed to t
willchan no longer on Chromium
2014/07/22 20:45:47
Can you address this comment?
Primiano Tucci (use gerrit)
2014/07/23 23:17:38
I'm on the fence on this.
On your side: yes, the r
willchan no longer on Chromium
2014/07/25 21:21:23
I think that you raise an interesting point that m
Primiano Tucci (use gerrit)
2014/07/28 12:52:11
I was looking again at this code with fresh mind,
willchan no longer on Chromium
2014/07/28 14:52:16
Hm, well this require refactoring all uses today o
| |
160 static Region WholeFile(); | |
161 | |
162 Region(int64 offset, int64 size); | |
163 ~Region(); | |
164 | |
165 // Whether the region intends to cover the entire file. | |
willchan no longer on Chromium
2014/07/21 23:55:40
What's the intended behavior when a file is mapped
Primiano Tucci (use gerrit)
2014/07/23 23:17:38
I think we discussed this offline and kWholeFile s
| |
166 bool IsWholeFile() const; | |
167 | |
168 // Start of the region (measured in bytes from the beginning of the file). | |
169 int64 offset; | |
170 | |
171 // Length of the region. | |
172 int64 size; | |
173 }; | |
174 | |
158 File(); | 175 File(); |
159 | 176 |
160 // Creates or opens the given file. This will fail with 'access denied' if the | 177 // Creates or opens the given file. This will fail with 'access denied' if the |
161 // |name| contains path traversal ('..') components. | 178 // |name| contains path traversal ('..') components. |
162 File(const FilePath& name, uint32 flags); | 179 File(const FilePath& name, uint32 flags); |
163 | 180 |
164 // Takes ownership of |platform_file|. | 181 // Takes ownership of |platform_file|. |
165 explicit File(PlatformFile platform_file); | 182 explicit File(PlatformFile platform_file); |
166 | 183 |
167 // Creates an object with a specific error_details code. | 184 // Creates an object with a specific error_details code. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 #endif | 321 #endif |
305 | 322 |
306 Error error_details_; | 323 Error error_details_; |
307 bool created_; | 324 bool created_; |
308 bool async_; | 325 bool async_; |
309 }; | 326 }; |
310 | 327 |
311 } // namespace base | 328 } // namespace base |
312 | 329 |
313 #endif // BASE_FILES_FILE_H_ | 330 #endif // BASE_FILES_FILE_H_ |
OLD | NEW |