summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorrmcilroy <rmcilroy@chromium.org>2015-04-10 00:52:17 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-10 07:52:54 +0000
commit537203ed6059030168776d50fefdd6c9a7bf677a (patch)
treef0268445519cbb48a55758b55f6486cbb43b373b /ash
parent821c1b2ad26cc690c984996d1fa12c71473373fa (diff)
downloadchromium_src-537203ed6059030168776d50fefdd6c9a7bf677a.zip
chromium_src-537203ed6059030168776d50fefdd6c9a7bf677a.tar.gz
chromium_src-537203ed6059030168776d50fefdd6c9a7bf677a.tar.bz2
Use command line to signal whether a child process was passed V8 snapshot files via file descriptor
BUG=466917 Review URL: https://codereview.chromium.org/1071173002 Cr-Commit-Position: refs/heads/master@{#324600}
Diffstat (limited to 'ash')
-rw-r--r--ash/shell/content_client/shell_content_browser_client.cc17
-rw-r--r--ash/shell/content_client/shell_content_browser_client.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc
index 7f956ec..51b0107 100644
--- a/ash/shell/content_client/shell_content_browser_client.cc
+++ b/ash/shell/content_client/shell_content_browser_client.cc
@@ -5,7 +5,9 @@
#include "ash/shell/content_client/shell_content_browser_client.h"
#include "ash/shell/content_client/shell_browser_main_parts.h"
+#include "base/command_line.h"
#include "content/public/common/content_descriptors.h"
+#include "content/public/common/content_switches.h"
#include "content/shell/browser/shell_browser_context.h"
#include "gin/v8_initializer.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -41,6 +43,21 @@ net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
request_interceptors.Pass());
}
+void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
+ base::CommandLine* command_line,
+ int child_process_id) {
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
+ std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+ if (process_type != switches::kZygoteProcess) {
+ command_line->AppendSwitch(::switches::kV8NativesPassedByFD);
+ command_line->AppendSwitch(::switches::kV8SnapshotPassedByFD);
+ }
+#endif // V8_USE_EXTERNAL_STARTUP_DATA
+#endif // OS_POSIX && !OS_MACOSX
+}
+
#if defined(OS_POSIX) && !defined(OS_MACOSX)
void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
diff --git a/ash/shell/content_client/shell_content_browser_client.h b/ash/shell/content_client/shell_content_browser_client.h
index df62338..9ee3373 100644
--- a/ash/shell/content_client/shell_content_browser_client.h
+++ b/ash/shell/content_client/shell_content_browser_client.h
@@ -33,6 +33,8 @@ class ShellContentBrowserClient : public content::ContentBrowserClient {
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) override;
+ void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
+ int child_process_id) override;
#if defined(OS_POSIX) && !defined(OS_MACOSX)
void GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,