Index: app/resource_bundle_mac.mm |
diff --git a/app/resource_bundle_mac.mm b/app/resource_bundle_mac.mm |
index 6696617cd1c5b66aa2fe8b979072949a17b2348f..b3066026b8f809db4e20fab5fbdfc99c82f0726f 100644 |
--- a/app/resource_bundle_mac.mm |
+++ b/app/resource_bundle_mac.mm |
@@ -71,18 +71,16 @@ void ResourceBundle::LoadThemeResources() { |
DCHECK(theme_data_) << "failed to load theme.pak"; |
} |
-/* static */ |
-bool ResourceBundle::LoadResourceBytes(DataHandle module, int resource_id, |
- std::vector<unsigned char>* bytes) { |
+// static |
+RefCountedStaticMemory* ResourceBundle::LoadResourceBytes( |
+ DataHandle module, int resource_id) { |
DCHECK(module); |
- base::StringPiece data; |
- if (!module->Get(resource_id, &data)) |
- return false; |
- |
- bytes->resize(data.length()); |
- memcpy(&(bytes->front()), data.data(), data.length()); |
+ base::StringPiece bytes; |
+ if (!module->Get(resource_id, &bytes)) |
+ return NULL; |
- return true; |
+ return new RefCountedStaticMemory( |
+ reinterpret_cast<const unsigned char*>(bytes.data()), bytes.length()); |
} |
base::StringPiece ResourceBundle::GetRawDataResource(int resource_id) { |