summaryrefslogtreecommitdiffstats
path: root/mojo/shell/standalone
diff options
context:
space:
mode:
authorsky <sky@chromium.org>2016-02-19 15:17:21 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-19 23:18:47 +0000
commit730034908c8b53bdcb6faaeb50b234bb23825091 (patch)
treef805353138348a1f9a4f6ed459889b4ae6e5bf4a /mojo/shell/standalone
parentc286900cc4499a48baab0d86dd96edbbe5fb1eff (diff)
downloadchromium_src-730034908c8b53bdcb6faaeb50b234bb23825091.zip
chromium_src-730034908c8b53bdcb6faaeb50b234bb23825091.tar.gz
chromium_src-730034908c8b53bdcb6faaeb50b234bb23825091.tar.bz2
Adds back qualifier support to the shell
This also adds the ability to add command line switches to child processes. BUG=581539 TEST=none R=ben@chromium.org Review URL: https://codereview.chromium.org/1714183003 Cr-Commit-Position: refs/heads/master@{#376567}
Diffstat (limited to 'mojo/shell/standalone')
-rw-r--r--mojo/shell/standalone/context.cc5
-rw-r--r--mojo/shell/standalone/context.h9
2 files changed, 12 insertions, 2 deletions
diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc
index 787304c..d1f3323 100644
--- a/mojo/shell/standalone/context.cc
+++ b/mojo/shell/standalone/context.cc
@@ -33,6 +33,7 @@
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
#include "mojo/shell/application_loader.h"
#include "mojo/shell/connect_to_application_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/switches.h"
@@ -123,8 +124,8 @@ void Context::Init(const base::FilePath& shell_file_root) {
runner_factory.reset(
new InProcessNativeRunnerFactory(task_runners_->blocking_pool()));
} else {
- runner_factory.reset(
- new OutOfProcessNativeRunnerFactory(task_runners_->blocking_pool()));
+ runner_factory.reset(new OutOfProcessNativeRunnerFactory(
+ task_runners_->blocking_pool(), command_line_switches_));
}
application_manager_.reset(new ApplicationManager(
std::move(runner_factory), task_runners_->blocking_pool(), true));
diff --git a/mojo/shell/standalone/context.h b/mojo/shell/standalone/context.h
index f87b82c..2b2adcb 100644
--- a/mojo/shell/standalone/context.h
+++ b/mojo/shell/standalone/context.h
@@ -7,12 +7,14 @@
#include <set>
#include <string>
+#include <vector>
#include "base/callback_forward.h"
#include "base/macros.h"
#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/scoped_user_data_dir.h"
#include "mojo/shell/standalone/task_runners.h"
#include "mojo/shell/standalone/tracer.h"
@@ -20,6 +22,7 @@
namespace mojo {
namespace shell {
+struct CommandLineSwitch;
class NativeApplicationLoader;
// The "global" context for the shell's main process.
@@ -30,6 +33,11 @@ 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;
+ }
+
// This must be called with a message loop set up for the current thread,
// which must remain alive until after Shutdown() is called.
void Init(const base::FilePath& shell_file_root);
@@ -68,6 +76,7 @@ class Context : public edk::ProcessDelegate {
scoped_ptr<ApplicationManager> application_manager_;
base::Closure app_complete_callback_;
base::Time main_entry_time_;
+ std::vector<CommandLineSwitch> command_line_switches_;
DISALLOW_COPY_AND_ASSIGN(Context);
};