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

Unified Diff: mojo/shell/shell.cc

Issue 25895002: Simple shell that loads a dll and calls an entrypoint function passing in a handle to a pipe create… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exports to template instantiations Created 7 years, 2 months 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
Index: mojo/shell/shell.cc
diff --git a/mojo/shell/shell.cc b/mojo/shell/shell.cc
new file mode 100644
index 0000000000000000000000000000000000000000..72f697f232c2910b6e76cb49401c824ca8dea65b
--- /dev/null
+++ b/mojo/shell/shell.cc
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "base/logging.h"
+#include "base/message_loop/message_loop.h"
+#include "mojo/shell/app_container.h"
+#include "mojo/shell/switches.h"
+#include "mojo/system/core_impl.h"
+
+int main(int argc, char** argv) {
+ base::AtExitManager at_exit;
+ CommandLine::Init(argc, argv);
+
+ mojo::system::CoreImpl::Init();
+
+ base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
+
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (!command_line.HasSwitch(switches::kApp)) {
+ LOG(ERROR) << "No app path specified.";
+ return 0;
+ }
+
+ scoped_ptr<mojo::shell::AppContainer> container(
+ new mojo::shell::AppContainer);
+ container->LaunchApp(command_line.GetSwitchValuePath(switches::kApp));
+ message_loop.Run();
+ return 0;
+}
« build/all.gyp ('K') | « mojo/shell/sample_app.cc ('k') | mojo/shell/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698