| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 params.url, | 335 params.url, |
| 336 nullptr, | 336 nullptr, |
| 337 gfx::Size())->web_contents()); | 337 gfx::Size())->web_contents()); |
| 338 } | 338 } |
| 339 | 339 |
| 340 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 340 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 341 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 341 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 342 const base::CommandLine& command_line, | 342 const base::CommandLine& command_line, |
| 343 int child_process_id, | 343 int child_process_id, |
| 344 FileDescriptorInfo* mappings) { | 344 FileDescriptorInfo* mappings) { |
| 345 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 345 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) && !defined(OS_ANDROID) |
| 346 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) { | 346 if (v8_natives_fd_.get() == -1 || v8_snapshot_fd_.get() == -1) { |
| 347 int v8_natives_fd = -1; | 347 int v8_natives_fd = -1; |
| 348 int v8_snapshot_fd = -1; | 348 int v8_snapshot_fd = -1; |
| 349 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd, | 349 if (gin::V8Initializer::OpenV8FilesForChildProcesses(&v8_natives_fd, |
| 350 &v8_snapshot_fd)) { | 350 &v8_snapshot_fd)) { |
| 351 v8_natives_fd_.reset(v8_natives_fd); | 351 v8_natives_fd_.reset(v8_natives_fd); |
| 352 v8_snapshot_fd_.reset(v8_snapshot_fd); | 352 v8_snapshot_fd_.reset(v8_snapshot_fd); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1); | 355 DCHECK(v8_natives_fd_.get() != -1 && v8_snapshot_fd_.get() != -1); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 ShellBrowserContext* | 425 ShellBrowserContext* |
| 426 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( | 426 ShellContentBrowserClient::ShellBrowserContextForBrowserContext( |
| 427 BrowserContext* content_browser_context) { | 427 BrowserContext* content_browser_context) { |
| 428 if (content_browser_context == browser_context()) | 428 if (content_browser_context == browser_context()) |
| 429 return browser_context(); | 429 return browser_context(); |
| 430 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); | 430 DCHECK_EQ(content_browser_context, off_the_record_browser_context()); |
| 431 return off_the_record_browser_context(); | 431 return off_the_record_browser_context(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace content | 434 } // namespace content |
| OLD | NEW |