Chromium Code Reviews| Index: base/data_pack.cc |
| diff --git a/base/data_pack.cc b/base/data_pack.cc |
| index 46f3cb4924e0e6af2a775b6f46f55ec0ebe93910..a9e07a413cf10b8af876e015b3040ed342e00365 100644 |
| --- a/base/data_pack.cc |
| +++ b/base/data_pack.cc |
| @@ -89,7 +89,7 @@ bool DataPack::Load(const FilePath& path) { |
| return true; |
| } |
| -bool DataPack::Get(uint32_t resource_id, StringPiece* data) { |
| +bool DataPack::GetStringPiece(uint32_t resource_id, StringPiece* data) { |
| // It won't be hard to make this endian-agnostic, but it's not worth |
| // bothering to do right now. |
| #if defined(__BYTE_ORDER) |
| @@ -113,4 +113,14 @@ bool DataPack::Get(uint32_t resource_id, StringPiece* data) { |
| return true; |
| } |
| +RefCountedStaticMemory* DataPack::GetStaticMemory(uint32_t resource_id) { |
| + base::StringPiece piece; |
| + if (!GetStringPiece(resource_id, &piece)) { |
| + return NULL; |
| + } |
|
Evan Martin
2009/10/26 23:57:42
curlies not necessary here
|
| + |
| + return new RefCountedStaticMemory( |
| + reinterpret_cast<const unsigned char*>(piece.data()), piece.length()); |
| +} |
| + |
| } // namespace base |