Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: base/files/file.cc

Issue 394313002: Add support for loading pak files from arbitrary file regions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove IsWholeFile, use kWholeFile; other nits Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/files/file.cc
diff --git a/base/files/file.cc b/base/files/file.cc
index ea8dbf27ac1770d88fc6ce933a4bdd331820d2d9..56db7a488c97b85abcdd676a79f3f0309741abdf 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -7,6 +7,8 @@
namespace base {
+const File::Region File::Region::kWholeFile;
+
File::Info::Info()
: size(0),
is_directory(false),
@@ -16,6 +18,18 @@ File::Info::Info()
File::Info::~Info() {
}
+File::Region::Region() : offset(0), size(0) {
Primiano Tucci (use gerrit) 2014/07/23 23:17:38 This is a private ctor and can be used only by kWh
willchan no longer on Chromium 2014/07/25 21:21:23 Sounds great.
+}
+
+File::Region::Region(int64 offset, int64 size) : offset(offset), size(size) {
+ DCHECK_GE(offset, 0);
+ DCHECK_GT(size, 0);
+}
+
+bool File::Region::operator==(const File::Region& other) const {
+ return other.offset == offset && other.size == size;
+}
+
File::File()
: error_details_(FILE_ERROR_FAILED),
created_(false),
« base/files/file.h ('K') | « base/files/file.h ('k') | base/files/memory_mapped_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698