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

Unified Diff: content/browser/child_process_launcher_helper_android.cc

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Fixed analysis. 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
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 = [&region, &files_to_register](int key, int fd) {
- if (fd != -1)
- files_to_register->ShareWithRegion(key, fd, region);
- };
- maybe_register(
- kV8NativesDataDescriptor,
- gin::V8Initializer::GetOpenNativesFileForChildProcesses(&region));
- maybe_register(
- kV8SnapshotDataDescriptor32,
- gin::V8Initializer::GetOpenSnapshotFileForChildProcesses(&region, true));
- maybe_register(
- kV8SnapshotDataDescriptor64,
- gin::V8Initializer::GetOpenSnapshotFileForChildProcesses(&region, 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(&region);
- 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

Powered by Google App Engine
This is Rietveld 408576698