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

Unified Diff: base/data_pack.h

Issue 338027: Modify DataPacks so they can return RefCountedStaticMemory objects. (Closed)
Patch Set: Rewrite GetStaticMemory Created 11 years, 2 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/data_pack.h
diff --git a/base/data_pack.h b/base/data_pack.h
index 02a38490602792971a44dcb7174b9fe834389906..7c9abde941e25ace46890b14da027e0d072fc55c 100644
--- a/base/data_pack.h
+++ b/base/data_pack.h
@@ -10,6 +10,7 @@
#define BASE_DATA_PACK_H_
#include "base/basictypes.h"
+#include "base/ref_counted_memory.h"
#include "base/scoped_ptr.h"
namespace file_util {
@@ -32,7 +33,12 @@ class DataPack {
// Get resource by id |resource_id|, filling in |data|.
// The data is owned by the DataPack object and should not be modified.
// Returns false if the resource id isn't found.
- bool Get(uint32_t resource_id, StringPiece* data);
+ bool GetStringPiece(uint32_t resource_id, StringPiece* data);
+
+ // Like GetStringPiece(), but returns a reference to memory. This interface
+ // is used for image data, while the StringPiece interface is usually used
+ // for localization strings.
+ RefCountedStaticMemory* GetStaticMemory(uint32_t resource_id);
private:
// The memory-mapped data.
« no previous file with comments | « app/resource_bundle_mac.mm ('k') | base/data_pack.cc » ('j') | base/data_pack.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698