summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java6
-rw-r--r--chrome/browser/chrome_content_browser_client.cc20
-rw-r--r--chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi20
-rw-r--r--chrome/chrome.isolate1
-rw-r--r--chrome/chrome_android_paks.gypi10
-rw-r--r--chrome/chrome_tests.gypi20
-rw-r--r--chrome/chrome_tests_unit.gypi17
-rw-r--r--chrome/installer/mini_installer.gyp6
-rw-r--r--chrome/interactive_ui_tests.isolate1
-rw-r--r--chrome/js_unittest_rules.gypi10
-rw-r--r--chrome/sync_integration_tests.isolate1
-rw-r--r--chrome/unit_tests.isolate1
12 files changed, 113 insertions, 0 deletions
diff --git a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java
index 17ae832..9df9aea 100644
--- a/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java
+++ b/chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellApplication.java
@@ -31,12 +31,18 @@ public class ChromeShellApplication extends ChromiumApplication {
* for its operation. We used to link the data statically to our binary,
* but don't do that any more and need to install along with pak files.
* See src/third_party/icu/README.chromium.
+ *
+ * V8's initial snapshot used to be statically linked to the binary, but
+ * now it's loaded from external files. Therefore we need to install such
+ * snapshots (natives_blob.bin and snapshot.bin) along with pak files.
*/
private static final String[] CHROME_MANDATORY_PAKS = {
"en-US.pak",
"resources.pak",
"chrome_100_percent.pak",
"icudtl.dat",
+ "natives_blob.bin",
+ "snapshot_blob.bin"
};
private static final String COMMAND_LINE_FILE = "/data/local/tmp/chrome-shell-command-line";
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 446e560a..f7fd810 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2503,6 +2503,26 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
mappings->Transfer(kAndroidICUDataDescriptor,
base::ScopedFD(icudata_file.TakePlatformFile()));
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA
+ base::FilePath v8_data_path;
+ PathService::Get(base::DIR_ANDROID_APP_DATA, &v8_data_path);
+ DCHECK(!v8_data_path.empty());
+
+ int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
+ base::FilePath v8_natives_data_path =
+ v8_data_path.AppendASCII("natives_blob.bin");
+ base::FilePath v8_snapshot_data_path =
+ v8_data_path.AppendASCII("snapshot_blob.bin");
+ base::File v8_natives_data_file(v8_natives_data_path, file_flags);
+ base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
+ DCHECK(v8_natives_data_file.IsValid());
+ DCHECK(v8_snapshot_data_file.IsValid());
+ mappings->Transfer(kV8NativesDataDescriptor,
+ base::ScopedFD(v8_natives_data_file.TakePlatformFile()));
+ mappings->Transfer(kV8SnapshotDataDescriptor,
+ base::ScopedFD(v8_snapshot_data_file.TakePlatformFile()));
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+
#else
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi b/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi
index c4a1e9a..e9c9f61 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox_tests.gypi
@@ -45,6 +45,15 @@
'rule_name': 'js2webui',
'extension': 'unitjs',
'msvs_external_rule': 1,
+ 'variables': {
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'external_v8': 'y',
+ }, {
+ 'external_v8': 'n',
+ }],
+ ],
+ },
'inputs': [
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
@@ -65,6 +74,7 @@
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
'--deps_js', '<(chromevox_test_deps_js_file)',
+ '--external', '<(external_v8)',
'<(mock_js)',
'<(test_api_js)',
'<(js2gtest)',
@@ -80,6 +90,15 @@
'rule_name': 'js2extension',
'extension': 'extjs',
'msvs_external_rule': 1,
+ 'variables': {
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'external_v8': 'y',
+ }, {
+ 'external_v8': 'n',
+ }],
+ ],
+ },
'inputs': [
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
@@ -98,6 +117,7 @@
'python',
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
+ '--external', '<(external_v8)',
'<(mock_js)',
'<(test_api_js)',
'<(js2gtest)',
diff --git a/chrome/chrome.isolate b/chrome/chrome.isolate
index 5457f64..54e18dc 100644
--- a/chrome/chrome.isolate
+++ b/chrome/chrome.isolate
@@ -94,5 +94,6 @@
],
'includes': [
'angle.isolate',
+ '../gin/v8.isolate',
],
}
diff --git a/chrome/chrome_android_paks.gypi b/chrome/chrome_android_paks.gypi
index 90f0238..574d5cc 100644
--- a/chrome/chrome_android_paks.gypi
+++ b/chrome/chrome_android_paks.gypi
@@ -109,6 +109,16 @@
'<(chrome_android_pak_output_folder)/icudtl.dat',
],
}],
+ ['v8_use_external_startup_data==1', {
+ 'chrome_android_pak_input_resources': [
+ '<(PRODUCT_DIR)/natives_blob.bin',
+ '<(PRODUCT_DIR)/snapshot_blob.bin',
+ ],
+ 'chrome_android_pak_output_resources': [
+ '<(chrome_android_pak_output_folder)/natives_blob.bin',
+ '<(chrome_android_pak_output_folder)/snapshot_blob.bin',
+ ],
+ }],
],
},
}
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 7822385..d89d00b 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1880,6 +1880,15 @@
'rule_name': 'js2webui',
'extension': 'js',
'msvs_external_rule': 1,
+ 'variables': {
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'external_v8': 'y',
+ }, {
+ 'external_v8': 'n',
+ }],
+ ],
+ },
'inputs': [
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
@@ -1895,6 +1904,7 @@
'action': [
'python',
'<@(_inputs)',
+ '--external', '<(external_v8)',
'webui',
'<(RULE_INPUT_PATH)',
'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
@@ -2450,6 +2460,15 @@
'rule_name': 'js2webui',
'extension': 'js',
'msvs_external_rule': 1,
+ 'variables': {
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'external_v8': 'y',
+ }, {
+ 'external_v8': 'n',
+ }],
+ ],
+ },
'inputs': [
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
@@ -2466,6 +2485,7 @@
'python',
'<@(_inputs)',
'webui',
+ '--external', '<(external_v8)',
'<(RULE_INPUT_PATH)',
'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
'<@(_outputs)',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index c98c284..8457225 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -2851,6 +2851,23 @@
'variables': {
'test_suite_name': 'unit_tests',
'android_manifest_path': 'test/android/unit_tests_apk/AndroidManifest.xml',
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'additional_input_paths': [
+ '<(PRODUCT_DIR)/natives_blob.bin',
+ '<(PRODUCT_DIR)/snapshot_blob.bin',
+ ],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/unit_tests_apk/assets',
+ 'files': [
+ '<(PRODUCT_DIR)/natives_blob.bin',
+ '<(PRODUCT_DIR)/snapshot_blob.bin',
+ ],
+ },
+ ],
+ }],
+ ],
},
'includes': [ '../build/apk_test.gypi' ],
},
diff --git a/chrome/installer/mini_installer.gyp b/chrome/installer/mini_installer.gyp
index c2bb835..e6b0ca7 100644
--- a/chrome/installer/mini_installer.gyp
+++ b/chrome/installer/mini_installer.gyp
@@ -224,6 +224,12 @@
'<(PRODUCT_DIR)/icudtl.dat',
],
}],
+ ['v8_use_external_startup_data == 1', {
+ 'inputs': [
+ '<(PRODUCT_DIR)/natives_blob.bin',
+ '<(PRODUCT_DIR)/snapshot_blob.bin',
+ ],
+ }],
],
'inputs': [
'<(create_installer_archive_py_path)',
diff --git a/chrome/interactive_ui_tests.isolate b/chrome/interactive_ui_tests.isolate
index df3893d..066c007 100644
--- a/chrome/interactive_ui_tests.isolate
+++ b/chrome/interactive_ui_tests.isolate
@@ -122,5 +122,6 @@
],
'includes': [
'../base/base.isolate',
+ '../gin/v8.isolate',
],
}
diff --git a/chrome/js_unittest_rules.gypi b/chrome/js_unittest_rules.gypi
index 27901f1c..b3dff9c 100644
--- a/chrome/js_unittest_rules.gypi
+++ b/chrome/js_unittest_rules.gypi
@@ -54,6 +54,15 @@
'rule_name': 'js2unit',
'extension': 'gtestjs',
'msvs_external_rule': 1,
+ 'variables': {
+ 'conditions': [
+ ['v8_use_external_startup_data==1', {
+ 'external_v8': 'y',
+ }, {
+ 'external_v8': 'n',
+ }],
+ ],
+ },
'inputs': [
'<(gypv8sh)',
'<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
@@ -69,6 +78,7 @@
'action': [
'python',
'<@(_inputs)',
+ '--external', '<(external_v8)',
'unit',
'<(RULE_INPUT_PATH)',
'chrome/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).<(_extension)',
diff --git a/chrome/sync_integration_tests.isolate b/chrome/sync_integration_tests.isolate
index 4c01825..3c5e0e1 100644
--- a/chrome/sync_integration_tests.isolate
+++ b/chrome/sync_integration_tests.isolate
@@ -98,5 +98,6 @@
],
'includes': [
'../base/base.isolate',
+ '../gin/v8.isolate',
],
}
diff --git a/chrome/unit_tests.isolate b/chrome/unit_tests.isolate
index 2a5814f..a78618a 100644
--- a/chrome/unit_tests.isolate
+++ b/chrome/unit_tests.isolate
@@ -139,5 +139,6 @@
],
'includes': [
'../base/base.isolate',
+ '../gin/v8.isolate',
],
}