diff options
author | sky <sky@chromium.org> | 2016-02-23 15:18:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-23 23:21:09 +0000 |
commit | d6439eceec0ac412e5ce440847609a4d807e0f90 (patch) | |
tree | 2d98d90e8650bd485ec41fec9d4950e6f8ce61c5 /mojo/shell/standalone | |
parent | 11daa8bde0d19cf459ab49808e4aad6cecd768b6 (diff) | |
download | chromium_src-d6439eceec0ac412e5ce440847609a4d807e0f90.zip chromium_src-d6439eceec0ac412e5ce440847609a4d807e0f90.tar.gz chromium_src-d6439eceec0ac412e5ce440847609a4d807e0f90.tar.bz2 |
Adds ability for chrome to behave as mojo_runner
This adds the arg use_mash that is only true on chromeos. Once
compiled with use_mash if you supply --mash to chrome it'll start the
shell inside chrome.
I haven't wired chrome up to start in this environment. Will do that
next.
BUG=581539
TEST=none
R=ben@chromium.org
Review URL: https://codereview.chromium.org/1722743002
Cr-Commit-Position: refs/heads/master@{#377113}
Diffstat (limited to 'mojo/shell/standalone')
-rw-r--r-- | mojo/shell/standalone/context.cc | 6 | ||||
-rw-r--r-- | mojo/shell/standalone/context.h | 13 |
2 files changed, 8 insertions, 11 deletions
diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc index a04d259..2c49e73 100644 --- a/mojo/shell/standalone/context.cc +++ b/mojo/shell/standalone/context.cc @@ -34,7 +34,6 @@ #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" #include "mojo/shell/application_loader.h" #include "mojo/shell/connect_params.h" -#include "mojo/shell/runner/host/command_line_switch.h" #include "mojo/shell/runner/host/in_process_native_runner.h" #include "mojo/shell/runner/host/out_of_process_native_runner.h" #include "mojo/shell/standalone/tracer.h" @@ -99,7 +98,8 @@ void OnInstanceQuit(const GURL& url, const Identity& identity) { Context::Context() : io_thread_(CreateIOThread("io_thread")), - main_entry_time_(base::Time::Now()) {} + main_entry_time_(base::Time::Now()), + native_runner_delegate_(nullptr) {} Context::~Context() { DCHECK(!base::MessageLoop::current()); @@ -145,7 +145,7 @@ void Context::Init(const base::FilePath& shell_file_root) { new InProcessNativeRunnerFactory(blocking_pool_.get())); } else { runner_factory.reset(new OutOfProcessNativeRunnerFactory( - blocking_pool_.get(), command_line_switches_)); + blocking_pool_.get(), native_runner_delegate_)); } application_manager_.reset(new ApplicationManager( std::move(runner_factory), blocking_pool_.get(), true)); diff --git a/mojo/shell/standalone/context.h b/mojo/shell/standalone/context.h index 19df61a..e9af8fb 100644 --- a/mojo/shell/standalone/context.h +++ b/mojo/shell/standalone/context.h @@ -5,8 +5,6 @@ #ifndef MOJO_SHELL_STANDALONE_CONTEXT_H_ #define MOJO_SHELL_STANDALONE_CONTEXT_H_ -#include <vector> - #include "base/callback_forward.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -15,7 +13,6 @@ #include "base/time/time.h" #include "mojo/edk/embedder/process_delegate.h" #include "mojo/shell/application_manager.h" -#include "mojo/shell/runner/host/command_line_switch.h" #include "mojo/shell/standalone/tracer.h" #include "url/gurl.h" @@ -25,7 +22,7 @@ class SingleThreadTaskRunner; namespace mojo { namespace shell { -struct CommandLineSwitch; +class NativeRunnerDelegate; // The "global" context for the shell's main process. class Context : public edk::ProcessDelegate { @@ -35,9 +32,8 @@ class Context : public edk::ProcessDelegate { static void EnsureEmbedderIsInitialized(); - void set_command_line_switches( - const std::vector<CommandLineSwitch>& command_line_switches) { - command_line_switches_ = command_line_switches; + void set_native_runner_delegate(NativeRunnerDelegate* delegate) { + native_runner_delegate_ = delegate; } // This must be called with a message loop set up for the current thread, @@ -70,7 +66,8 @@ class Context : public edk::ProcessDelegate { Tracer tracer_; scoped_ptr<ApplicationManager> application_manager_; base::Time main_entry_time_; - std::vector<CommandLineSwitch> command_line_switches_; + + NativeRunnerDelegate* native_runner_delegate_; DISALLOW_COPY_AND_ASSIGN(Context); }; |