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

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

Issue 10686005: Add methods to add DataPack from open files (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « ui/aura/test/test_aura_initializer.cc ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/data_pack.h
diff --git a/ui/base/resource/data_pack.h b/ui/base/resource/data_pack.h
index 3c032536a81d827a1c81a29e867fe3cedcf8da3e..4a265e5924e9d5dc953ce87e4f3aa36128ca7e0b 100644
--- a/ui/base/resource/data_pack.h
+++ b/ui/base/resource/data_pack.h
@@ -14,6 +14,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/platform_file.h"
#include "base/string_piece.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_handle.h"
@@ -37,7 +38,10 @@ class UI_EXPORT DataPack : public ResourceHandle {
virtual ~DataPack();
// Load a pack file from |path|, returning false on error.
- bool Load(const FilePath& path);
+ bool LoadFromPath(const FilePath& path);
+
+ // Loads a pack file from |file|, returning false on error.
+ bool LoadFromFile(base::PlatformFile file);
// Writes a pack file containing |resources| to |path|. If there are any
// text resources to be written, their encoding must already agree to the
@@ -57,6 +61,9 @@ class UI_EXPORT DataPack : public ResourceHandle {
virtual ui::ScaleFactor GetScaleFactor() const OVERRIDE;
private:
+ // Does the actual loading of a pack file. Called by Load and LoadFromFile.
+ bool LoadImpl();
+
// The memory-mapped data.
scoped_ptr<file_util::MemoryMappedFile> mmap_;
« no previous file with comments | « ui/aura/test/test_aura_initializer.cc ('k') | ui/base/resource/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698