Index: base/files/file.h |
diff --git a/base/files/file.h b/base/files/file.h |
index 1913bc7f6c408c8e1e3840da712895ff2fd88259..9bd70ed2d845cb001cbeb8d74639a2354f7dfc96 100644 |
--- a/base/files/file.h |
+++ b/base/files/file.h |
@@ -155,6 +155,26 @@ class BASE_EXPORT File { |
base::Time creation_time; |
}; |
+ // Used to hold information about a region [offset + size] of a file. |
+ struct BASE_EXPORT Region { |
+ static const Region kWholeFile; |
+ |
+ Region(int64 offset, int64 size); |
+ |
+ bool operator==(const Region& other) const; |
+ |
+ // Start of the region (measured in bytes from the beginning of the file). |
+ int64 offset; |
Primiano Tucci (use gerrit)
2014/07/23 23:17:38
I'm a bit on the fence of this, w.r.t. keeping the
willchan no longer on Chromium
2014/07/25 21:21:23
I think Region should be a dumb struct. Whatever f
|
+ |
+ // Length of the region in bytes. |
+ int64 size; |
+ |
+ private: |
+ // This ctor is used only by kWholeFile, to construct a zero-sized Region |
+ // (which is forbidden by the public ctor) and uniquely identify kWholeFile. |
+ Region(); |
+ }; |
+ |
File(); |
// Creates or opens the given file. This will fail with 'access denied' if the |