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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 1969313005: [headless] Embed pak file into binary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated years in copyright Created 3 years, 10 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/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « ui/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698