diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-16 01:38:11 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-16 01:39:20 +0000 |
commit | e0ff1aa695ce0a987ea073ef9e144577cceb33f1 (patch) | |
tree | 5c4e539b4b298e89e6459f45510435cecf0ac0fe /extensions/shell/app | |
parent | 8c264f9ff1658480979b89265cd37cee72883c6f (diff) | |
download | chromium_src-e0ff1aa695ce0a987ea073ef9e144577cceb33f1.zip chromium_src-e0ff1aa695ce0a987ea073ef9e144577cceb33f1.tar.gz chromium_src-e0ff1aa695ce0a987ea073ef9e144577cceb33f1.tar.bz2 |
Add NaCl support to app_shell
Perform NaCl initialization during app_shell's startup path similar to
how Chrome initializes it.
* Refactor some of the lazy background page impulse code into ProcessManager so it can be shared with Chrome
BUG=400577
TEST=manual tests of app_shell, existing ProcessManager unit tests and browser tests
Review URL: https://codereview.chromium.org/437503004
Cr-Commit-Position: refs/heads/master@{#290082}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/shell/app')
-rw-r--r-- | extensions/shell/app/DEPS | 1 | ||||
-rw-r--r-- | extensions/shell/app/shell_main_delegate.cc | 19 | ||||
-rw-r--r-- | extensions/shell/app/shell_main_delegate.h | 2 |
3 files changed, 22 insertions, 0 deletions
diff --git a/extensions/shell/app/DEPS b/extensions/shell/app/DEPS index b9b52a1..5b7cd97 100644 --- a/extensions/shell/app/DEPS +++ b/extensions/shell/app/DEPS @@ -1,6 +1,7 @@ include_rules = [ "+extensions/shell", "+chromeos", + "+components/nacl", "+content/public/app", "+content/public/browser", "+sandbox", diff --git a/extensions/shell/app/shell_main_delegate.cc b/extensions/shell/app/shell_main_delegate.cc index c49319e..1fae2d7 100644 --- a/extensions/shell/app/shell_main_delegate.cc +++ b/extensions/shell/app/shell_main_delegate.cc @@ -22,6 +22,12 @@ #include "chromeos/chromeos_paths.h" #endif +#if !defined(DISABLE_NACL) +#include "components/nacl/common/nacl_paths.h" +#include "components/nacl/common/nacl_switches.h" +#include "components/nacl/zygote/nacl_fork_delegate_linux.h" +#endif + namespace { void InitLogging() { @@ -54,6 +60,9 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { #if defined(OS_CHROMEOS) chromeos::RegisterPathProvider(); #endif +#if !defined(DISABLE_NACL) + nacl::RegisterPathProvider(); +#endif extensions::RegisterPathProvider(); return false; } @@ -83,6 +92,13 @@ ShellMainDelegate::CreateContentRendererClient() { return renderer_client_.get(); } +void ShellMainDelegate::ZygoteStarting( + ScopedVector<content::ZygoteForkDelegate>* delegates) { +#if !defined(DISABLE_NACL) + nacl::AddNaClZygoteForkDelegates(delegates); +#endif +} + scoped_ptr<ShellRendererMainDelegate> ShellMainDelegate::CreateShellRendererMainDelegate() { return scoped_ptr<ShellRendererMainDelegate>(); @@ -104,6 +120,9 @@ bool ShellMainDelegate::ProcessNeedsResourceBundle( return process_type.empty() || process_type == switches::kZygoteProcess || process_type == switches::kRendererProcess || +#if !defined(DISABLE_NACL) + process_type == switches::kNaClLoaderProcess || +#endif process_type == switches::kUtilityProcess; } diff --git a/extensions/shell/app/shell_main_delegate.h b/extensions/shell/app/shell_main_delegate.h index 7e120f4..b9999cc 100644 --- a/extensions/shell/app/shell_main_delegate.h +++ b/extensions/shell/app/shell_main_delegate.h @@ -31,6 +31,8 @@ class ShellMainDelegate : public content::ContentMainDelegate { virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; virtual content::ContentRendererClient* CreateContentRendererClient() OVERRIDE; + virtual void ZygoteStarting( + ScopedVector<content::ZygoteForkDelegate>* delegates) OVERRIDE; protected: // The created object is owned by this object. |