Chromium Code Reviews| Index: base/files/file.cc |
| diff --git a/base/files/file.cc b/base/files/file.cc |
| index ea8dbf27ac1770d88fc6ce933a4bdd331820d2d9..543a7bf89fe63518d952870f5674087c0881371d 100644 |
| --- a/base/files/file.cc |
| +++ b/base/files/file.cc |
| @@ -16,6 +16,23 @@ File::Info::Info() |
| File::Info::~Info() { |
| } |
| +File::Region::Region(int64 offset, int64 size) : offset(offset), size(size) { |
| + DCHECK_GE(offset, 0); |
| + DCHECK_GE(size, 0); |
| +} |
| + |
| +File::Region::~Region() { |
| +} |
| + |
| +bool File::Region::IsWholeFile() const { |
|
willchan no longer on Chromium
2014/07/21 23:55:40
Hmmm...what happens when |size| == the length of t
Primiano Tucci (use gerrit)
2014/07/22 10:32:01
Good point, let me spend one minute to explain the
willchan no longer on Chromium
2014/07/22 20:45:47
We chatted about this offline. Primiano explained
|
| + return offset == 0 && size == std::numeric_limits<int64>::max(); |
| +} |
| + |
| +// static |
| +File::Region File::Region::WholeFile() { |
| + return File::Region(0, std::numeric_limits<int64>::max()); |
| +} |
| + |
| File::File() |
| : error_details_(FILE_ERROR_FAILED), |
| created_(false), |