Skip to content

Commit

Permalink
Enable multiprocess by default on desktop Mandoline.
Browse files Browse the repository at this point in the history
This also turns on the new EDK by default (we see hangs with the old one) and disables the sandbox while a recent regression is tracked down.

BUG=478251,546644

Review URL: https://codereview.chromium.org/1406403004

Cr-Commit-Position: refs/heads/master@{#357360}
  • Loading branch information
jam authored and Commit bot committed Nov 2, 2015
1 parent b50320c commit 8627a07
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions mandoline/app/desktop/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ executable("mandoline") {
"//mojo/package_manager",
"//mojo/runner:lib",
"//mojo/runner:register_local_aliases_fwd",
"//mojo/shell",
]

data_deps = [
Expand Down
14 changes: 9 additions & 5 deletions mandoline/app/desktop/launcher_process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@
#include "mojo/runner/context.h"
#include "mojo/runner/switches.h"
#include "mojo/runner/tracer.h"
#include "mojo/shell/switches.h"

namespace mandoline {

int LauncherProcessMain(int argc, char** argv) {
mojo::runner::Tracer tracer;
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
command_line->AppendSwitch("use-new-edk");
// http://crbug.com/546644
command_line->AppendSwitch(switches::kMojoNoSandbox);

bool trace_startup = command_line.HasSwitch(switches::kTraceStartup);
bool trace_startup = command_line->HasSwitch(switches::kTraceStartup);
if (trace_startup) {
tracer.Start(
command_line.GetSwitchValueASCII(switches::kTraceStartup),
command_line.GetSwitchValueASCII(switches::kTraceStartupDuration),
command_line->GetSwitchValueASCII(switches::kTraceStartup),
command_line->GetSwitchValueASCII(switches::kTraceStartupDuration),
"mandoline.trace");
}

Expand Down
4 changes: 2 additions & 2 deletions mojo/package_manager/package_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ bool PackageManagerImpl::ShouldHandleWithContentHandler(
// Why doesn't that happen when running different apps? Because
// your_thing.mojo!base::AtExitManager and
// my_thing.mojo!base::AtExitManager are different symbols.
bool use_real_qualifier = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableMultiprocess);
bool use_real_qualifier = !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMojoSingleProcess);

GURL content_handler_url;
// The response begins with a #!mojo <content-handler-url>.
Expand Down
6 changes: 3 additions & 3 deletions mojo/runner/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ bool Context::Init() {
RegisterLocalAliases(package_manager_);

scoped_ptr<shell::NativeRunnerFactory> runner_factory;
if (command_line.HasSwitch(switches::kEnableMultiprocess))
runner_factory.reset(new OutOfProcessNativeRunnerFactory(this));
else
if (command_line.HasSwitch(switches::kMojoSingleProcess))
runner_factory.reset(new InProcessNativeRunnerFactory(this));
else
runner_factory.reset(new OutOfProcessNativeRunnerFactory(this));
application_manager_.reset(new shell::ApplicationManager(
make_scoped_ptr(package_manager_), runner_factory.Pass(),
task_runners_->blocking_pool()));
Expand Down
8 changes: 3 additions & 5 deletions mojo/shell/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ namespace switches {
// If set apps downloaded are not deleted.
const char kDontDeleteOnDownload[] = "dont-delete-on-download";

// Load apps in separate processes.
// TODO(vtl): Work in progress; doesn't work. Flip this to "disable" (or maybe
// change it to "single-process") when it works.
const char kEnableMultiprocess[] = "enable-multiprocess";

// Disables the sandbox for debugging. (Why the Mojo prefix on the constant?
// Because otherwise we conflict with content.)
const char kMojoNoSandbox[] = "no-sandbox";

// Load apps in a single processes.
const char kMojoSingleProcess[] = "single-process";

// If set apps downloaded are saved in with a predictable filename, to help
// remote debugging: when gdb is used through gdbserver, it needs to be able to
// find locally any loaded library. For this, gdb use the filename of the
Expand Down
2 changes: 1 addition & 1 deletion mojo/shell/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace switches {
// All switches in alphabetical order. The switches should be documented
// alongside the definition of their values in the .cc file.
extern const char kDontDeleteOnDownload[];
extern const char kEnableMultiprocess[];
extern const char kMojoNoSandbox[];
extern const char kMojoSingleProcess[];
extern const char kPredictableAppFilenames[];
extern const char kUseUpdater[];

Expand Down

0 comments on commit 8627a07

Please sign in to comment.