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

Unified Diff: ui/base/resource/data_pack.h

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: Move Region to MemoryMappedFile 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: ui/base/resource/data_pack.h
diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h
index 4d9d4bbdc2f9eea9012b20a0a25af8de09626a0d..2eeb1b2183e022d85a477037e317e2f84be7f67b 100644
--- a/ui/base/resource/data_pack.h
+++ b/ui/base/resource/data_pack.h
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/files/file.h"
+#include "base/files/memory_mapped_file.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "ui/base/layout.h"
@@ -21,7 +22,6 @@
namespace base {
class FilePath;
-class MemoryMappedFile;
class RefCountedStaticMemory;
}
@@ -38,6 +38,10 @@ class UI_BASE_EXPORT DataPack : public ResourceHandle {
// Loads a pack file from |file|, returning false on error.
bool LoadFromFile(base::File file);
+ // Loads a pack file from |region| of |file|, returning false on error.
+ bool LoadFromFileRegion(base::File file,
+ const base::MemoryMappedFile::Region& region);
+
// Writes a pack file containing |resources| to |path|. If there are any
// text resources to be written, their encoding must already agree to the
// |textEncodingType| specified. If no text resources are present, please

Powered by Google App Engine
This is Rietveld 408576698