| Index: ash/shell/content_client/shell_content_browser_client.cc
|
| diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc
|
| index f7787872c6553b6570cb119b5157fefb24b6fe16..6a7ac5b7fdf81b7e27a24315385b49f941d1310d 100644
|
| --- a/ash/shell/content_client/shell_content_browser_client.cc
|
| +++ b/ash/shell/content_client/shell_content_browser_client.cc
|
| @@ -5,14 +5,21 @@
|
| #include "ash/shell/content_client/shell_content_browser_client.h"
|
|
|
| #include "ash/shell/content_client/shell_browser_main_parts.h"
|
| +#include "content/public/common/content_descriptors.h"
|
| #include "content/shell/browser/shell_browser_context.h"
|
| +#include "gin/public/isolate_holder.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
|
|
| namespace ash {
|
| namespace shell {
|
|
|
| ShellContentBrowserClient::ShellContentBrowserClient()
|
| - : shell_browser_main_parts_(NULL) {
|
| + :
|
| +#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) {
|
| }
|
|
|
| ShellContentBrowserClient::~ShellContentBrowserClient() {
|
| @@ -34,6 +41,27 @@ net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
|
| request_interceptors.Pass());
|
| }
|
|
|
| +#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
| +void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
|
| + const base::CommandLine& command_line,
|
| + int child_process_id,
|
| + content::FileDescriptorInfo* mappings) {
|
| +#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
|
| + if (v8_snapshot_fd_.get() == -1 && v8_natives_fd_.get() == -1) {
|
| + int v8_natives_fd = -1;
|
| + int v8_snapshot_fd = -1;
|
| + if (gin::IsolateHolder::MapV8FilesForChildProcesses(&v8_natives_fd,
|
| + &v8_snapshot_fd)) {
|
| + v8_natives_fd_.reset(v8_natives_fd);
|
| + v8_snapshot_fd_.reset(v8_snapshot_fd);
|
| + }
|
| + }
|
| + mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
|
| + mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
|
| +#endif // V8_USE_EXTERNAL_STARTUP_DATA
|
| +}
|
| +#endif // OS_POSIX && !OS_MACOSX
|
| +
|
| content::ShellBrowserContext* ShellContentBrowserClient::browser_context() {
|
| return shell_browser_main_parts_->browser_context();
|
| }
|
|
|