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

Unified Diff: headless/BUILD.gn

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 | « build/args/headless.gn ('k') | headless/headless.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/BUILD.gn
diff --git a/headless/BUILD.gn b/headless/BUILD.gn
index 7f155ee2e080e1c520781bb5822be8ac047a6ac9..c951aa580453262bbd328b07f1882562f451b04a 100644
--- a/headless/BUILD.gn
+++ b/headless/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
+import("//headless/headless.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
@@ -10,6 +11,10 @@ import("//tools/grit/repack.gni")
config("headless_implementation") {
defines = [ "HEADLESS_IMPLEMENTATION" ]
+
+ if (headless_use_embedded_resources) {
+ defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ]
+ }
}
group("headless") {
@@ -60,6 +65,39 @@ repack("pak") {
output = "$root_out_dir/headless_lib.pak"
}
+action("embed_resources") {
+ # TODO(altimin): Consider zipping file here, it can reduce size up to 80%.
+ script = "//headless/lib/embed_data.py"
+
+ inputs = [
+ "$root_out_dir/headless_lib.pak",
+ ]
+
+ outputs = [
+ "$root_gen_dir/headless/embedded_resource_pak.cc",
+ "$root_gen_dir/headless/embedded_resource_pak.h",
+ ]
+
+ args = [
+ "--data_file",
+ rebase_path("$root_out_dir/headless_lib.pak"),
+ "--gendir",
+ rebase_path("$root_gen_dir"),
+ "--header_file",
+ "headless/embedded_resource_pak.h",
+ "--source_file",
+ "headless/embedded_resource_pak.cc",
+ "--namespace",
+ "headless",
+ "--variable_name",
+ "kHeadlessResourcePak",
+ ]
+
+ deps = [
+ ":pak",
+ ]
+}
+
grit("resources") {
source = "lib/resources/headless_lib_resources.grd"
outputs = [
@@ -228,7 +266,6 @@ static_library("headless_lib") {
deps = [
":gen_devtools_client_api",
- ":pak",
"//base",
"//components/security_state/content",
"//components/security_state/core",
@@ -247,6 +284,16 @@ static_library("headless_lib") {
"//url",
]
+ if (headless_use_embedded_resources) {
+ deps += [ ":embed_resources" ]
+ sources += [
+ "$root_gen_dir/headless/embedded_resource_pak.cc",
+ "$root_gen_dir/headless/embedded_resource_pak.h",
+ ]
+ } else {
+ deps += [ ":pak" ]
+ }
+
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
« no previous file with comments | « build/args/headless.gn ('k') | headless/headless.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698