Index: ui/base/resource/resource_bundle.cc |
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc |
index d2e4c51de325a5826acf60bed572aa04649eabc9..10064e0b2c65d4cc89d2ce4f2bfa82737f29b929 100644 |
--- a/ui/base/resource/resource_bundle.cc |
+++ b/ui/base/resource/resource_bundle.cc |
@@ -269,6 +269,16 @@ void ResourceBundle::AddDataPackFromFile(base::File file, |
scale_factor); |
} |
+void ResourceBundle::AddDataPackFromBuffer(base::StringPiece buffer, |
+ ScaleFactor scale_factor) { |
+ std::unique_ptr<DataPack> data_pack(new DataPack(scale_factor)); |
+ if (data_pack->LoadFromBuffer(buffer)) { |
+ AddDataPack(data_pack.release()); |
+ } else { |
+ LOG(ERROR) << "Failed to load data pack from buffer"; |
+ } |
+} |
+ |
void ResourceBundle::AddDataPackFromFileRegion( |
base::File file, |
const base::MemoryMappedFile::Region& region, |