| Index: content/shell/browser/shell_content_browser_client.cc
|
| diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
|
| index 4a2e95c26a0ef851819e97116967a9a2042f8656..574b66b42a16c0c79e05f10658a8533b0916d69d 100644
|
| --- a/content/shell/browser/shell_content_browser_client.cc
|
| +++ b/content/shell/browser/shell_content_browser_client.cc
|
| @@ -34,7 +34,6 @@
|
| #include "content/shell/common/shell_messages.h"
|
| #include "content/shell/common/shell_switches.h"
|
| #include "content/shell/renderer/layout_test/blink_test_helpers.h"
|
| -#include "gin/v8_initializer.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -129,12 +128,7 @@ void ShellContentBrowserClient::SetSwapProcessesForRedirect(bool swap) {
|
| }
|
|
|
| ShellContentBrowserClient::ShellContentBrowserClient()
|
| - :
|
| -#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
| - v8_natives_fd_(-1),
|
| - v8_snapshot_fd_(-1),
|
| -#endif // OS_POSIX && !OS_MACOSX
|
| - shell_browser_main_parts_(NULL) {
|
| + : shell_browser_main_parts_(NULL) {
|
| DCHECK(!g_browser_client);
|
| g_browser_client = this;
|
| }
|
| @@ -338,24 +332,29 @@ void ShellContentBrowserClient::OpenURL(
|
| }
|
|
|
| #if defined(OS_POSIX) && !defined(OS_MACOSX)
|
| +
|
| void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
|
| const base::CommandLine& command_line,
|
| int child_process_id,
|
| - FileDescriptorInfo* mappings) {
|
| + FileDescriptorInfo* mappings
|
| +#if defined(OS_ANDROID)
|
| + , std::map<int, base::MemoryMappedFile::Region>* regions
|
| +#endif
|
| + ) {
|
| #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
| - if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) {
|
| - int v8_natives_fd = -1;
|
| - int v8_snapshot_fd = -1;
|
| - if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd,
|
| - &v8_snapshot_fd)) {
|
| - v8_natives_fd_.reset(v8_natives_fd);
|
| - v8_snapshot_fd_.reset(v8_snapshot_fd);
|
| - }
|
| + if (!v8_files_.IsLoaded()) {
|
| + gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_files_);
|
| }
|
| - DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1);
|
| - mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
|
| - mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
|
| -#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
| + DCHECK(v8_files_.IsLoaded());
|
| + mappings->Share(kV8NativesDataDescriptor, v8_files_.natives_fd.get());
|
| + mappings->Share(kV8SnapshotDataDescriptor, v8_files_.snapshot_fd.get());
|
| +#if defined(OS_ANDROID)
|
| + regions->insert(
|
| + std::make_pair(kV8NativesDataDescriptor, v8_files_.natives_region));
|
| + regions->insert(
|
| + std::make_pair(kV8SnapshotDataDescriptor, v8_files_.snapshot_region));
|
| +#endif // defined(OS_ANDROID)
|
| +#endif // V8_USE_EXTERNAL_STARTUP_DATA && !defined(OS_ANDROID)
|
|
|
| #if defined(OS_ANDROID)
|
| int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
|
|
|