Index: content/browser/child_process_launcher_helper_android.cc |
diff --git a/content/browser/child_process_launcher_helper_android.cc b/content/browser/child_process_launcher_helper_android.cc |
index 5a241753ea9c867916810b264c6c052a99f2d7c6..bdeec73ac3f1e1e7b717444b26f86114a436982c 100644 |
--- a/content/browser/child_process_launcher_helper_android.cc |
+++ b/content/browser/child_process_launcher_helper_android.cc |
@@ -6,6 +6,7 @@ |
#include <memory> |
+#include "base/android/apk_assets.h" |
#include "base/i18n/icu_util.h" |
#include "base/logging.h" |
#include "base/metrics/field_trial.h" |
@@ -92,29 +93,10 @@ ChildProcessLauncherHelper::GetFilesToMap() { |
CreateDefaultPosixFilesToMap(*command_line(), child_process_id(), |
mojo_client_handle()); |
-#if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
- base::MemoryMappedFile::Region region; |
- auto maybe_register = [®ion, &files_to_register](int key, int fd) { |
- if (fd != -1) |
- files_to_register->ShareWithRegion(key, fd, region); |
- }; |
- maybe_register( |
- kV8NativesDataDescriptor, |
- gin::V8Initializer::GetOpenNativesFileForChildProcesses(®ion)); |
- maybe_register( |
- kV8SnapshotDataDescriptor32, |
- gin::V8Initializer::GetOpenSnapshotFileForChildProcesses(®ion, true)); |
- maybe_register( |
- kV8SnapshotDataDescriptor64, |
- gin::V8Initializer::GetOpenSnapshotFileForChildProcesses(®ion, false)); |
- |
- command_line()->AppendSwitch(::switches::kV8NativesPassedByFD); |
- command_line()->AppendSwitch(::switches::kV8SnapshotPassedByFD); |
-#endif // defined(V8_USE_EXTERNAL_STARTUP_DATA) |
- |
#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
- int fd = base::i18n::GetIcuDataFileHandle(®ion); |
- files_to_register->ShareWithRegion(kAndroidICUDataDescriptor, fd, region); |
+ base::MemoryMappedFile::Region icu_region; |
+ int fd = base::i18n::GetIcuDataFileHandle(&icu_region); |
+ files_to_register->ShareWithRegion(kAndroidICUDataDescriptor, fd, icu_region); |
#endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
return files_to_register; |
@@ -179,5 +161,13 @@ void ChildProcessLauncherHelper::SetProcessBackgroundedOnLauncherThread( |
SetChildProcessInForeground(process.Handle(), !background); |
} |
+// static |
+base::File ChildProcessLauncherHelper::OpenFile( |
+ const base::FilePath& path, |
+ base::MemoryMappedFile::Region* region) { |
+ base::File file(base::android::OpenApkAsset(path.value(), region)); |
+ return file; |
+} |
+ |
} // namespace internal |
} // namespace content |