Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1667)

Unified Diff: mojo/runner/desktop/launcher_process.cc

Issue 1440053002: Remove duplication between Mandoline and mojo_runner main functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/runner/desktop/launcher_process.h ('k') | mojo/runner/desktop/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/desktop/launcher_process.cc
diff --git a/mojo/runner/desktop/launcher_process.cc b/mojo/runner/desktop/launcher_process.cc
index 295aaa591f49d9029df193fce2c32c748d2df166..4fa69560cfc334dbb2142227f1f2975f4d1be9d4 100644
--- a/mojo/runner/desktop/launcher_process.cc
+++ b/mojo/runner/desktop/launcher_process.cc
@@ -15,8 +15,6 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/synchronization/waitable_event.h"
-#include "base/trace_event/trace_event.h"
-#include "components/tracing/trace_config_file.h"
#include "mojo/runner/context.h"
#include "mojo/runner/switches.h"
#include "mojo/shell/switches.h"
@@ -24,8 +22,7 @@
namespace mojo {
namespace runner {
-int LauncherProcessMain(int argc, char** argv) {
- mojo::runner::Tracer tracer;
+int LauncherProcessMain(const GURL& mojo_url, const base::Closure& callback) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kMojoSingleProcess) &&
!command_line->HasSwitch("gtest_list_tests"))
@@ -41,14 +38,20 @@ int LauncherProcessMain(int argc, char** argv) {
base::MessageLoop message_loop;
base::FilePath shell_dir;
PathService::Get(base::DIR_MODULE, &shell_dir);
- if (!shell_context.Init(shell_dir)) {
+ if (!shell_context.Init(shell_dir))
return 0;
- }
- message_loop.PostTask(
- FROM_HERE,
- base::Bind(&Context::RunCommandLineApplication,
- base::Unretained(&shell_context), base::Closure()));
+ if (mojo_url.is_empty()) {
+ message_loop.PostTask(
+ FROM_HERE,
+ base::Bind(&Context::RunCommandLineApplication,
+ base::Unretained(&shell_context), base::Closure()));
+ } else {
+ message_loop.PostTask(FROM_HERE,
+ base::Bind(&mojo::runner::Context::Run,
+ base::Unretained(&shell_context),
+ mojo_url));
+ }
message_loop.Run();
// Must be called before |message_loop| is destroyed.
« no previous file with comments | « mojo/runner/desktop/launcher_process.h ('k') | mojo/runner/desktop/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698