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

Unified Diff: mojo/runner/desktop/main_helper.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/main_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/desktop/main_helper.cc
diff --git a/mandoline/app/desktop/main.cc b/mojo/runner/desktop/main_helper.cc
similarity index 50%
copy from mandoline/app/desktop/main.cc
copy to mojo/runner/desktop/main_helper.cc
index 989d8ec482d6bf043e873c0e7679179bdf07b800..8f850f5e095211e3906379d92a890bf95fb02aa2 100644
--- a/mandoline/app/desktop/main.cc
+++ b/mojo/runner/desktop/main_helper.cc
@@ -2,23 +2,44 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "mojo/runner/desktop/main_helper.h"
+
+
#include "base/at_exit.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/debug/debugger.h"
#include "base/debug/stack_trace.h"
+#include "base/files/file_path.h"
+#include "base/logging.h"
#include "base/process/launch.h"
-#include "mandoline/app/desktop/launcher_process.h"
+#include "base/stl_util.h"
+#include "base/strings/string_split.h"
+#include "base/strings/utf_string_conversions.h"
+#include "mojo/runner/desktop/launcher_process.h"
#include "mojo/runner/host/child_process.h"
#include "mojo/runner/host/switches.h"
#include "mojo/runner/init.h"
-int main(int argc, char** argv) {
+#if defined(OS_WIN)
+#include <windows.h>
+#elif (OS_POSIX)
+#include <unistd.h>
+#endif
+
+namespace mojo {
+namespace runner {
+
+int RunnerMain(int argc, char** argv,
+ const GURL& mojo_url,
+ const base::Closure& callback) {
base::CommandLine::Init(argc, argv);
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
base::AtExitManager at_exit;
- mojo::runner::InitializeLogging();
- mojo::runner::WaitForDebuggerIfNecessary();
+ InitializeLogging();
+ WaitForDebuggerIfNecessary();
#if !defined(OFFICIAL_BUILD)
base::debug::EnableInProcessStackDumping();
@@ -28,7 +49,10 @@ int main(int argc, char** argv) {
#endif
if (command_line.HasSwitch(switches::kChildProcess))
- return mojo::runner::ChildProcessMain();
+ return ChildProcessMain();
- return mandoline::LauncherProcessMain(argc, argv);
+ return LauncherProcessMain(mojo_url, callback);
}
+
+} // namespace runner
+} // namespace mojo
« no previous file with comments | « mojo/runner/desktop/main_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698