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

Unified Diff: mojo/shell/run.cc

Issue 93793009: Implement ServiceManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow Android to be built Created 7 years 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/shell/network_delegate.cc ('k') | mojo/shell/service_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/run.cc
diff --git a/mojo/shell/run.cc b/mojo/shell/run.cc
index a7c3f337f25ef5c028c00f63317c743e73a1a0fc..5e0f2145079c67ff5efbd8448a2d3b0df18b6fab 100644
--- a/mojo/shell/run.cc
+++ b/mojo/shell/run.cc
@@ -7,7 +7,8 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
-#include "mojo/shell/app_container.h"
+#include "mojo/shell/context.h"
+#include "mojo/shell/service_manager.h"
#include "mojo/shell/switches.h"
#include "url/gurl.h"
@@ -16,15 +17,26 @@ namespace shell {
void Run(Context* context) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kApp)) {
+ CommandLine::StringVector args = command_line.GetArgs();
+
+ if (args.empty()) {
LOG(ERROR) << "No app path specified.";
base::MessageLoop::current()->Quit();
return;
}
- AppContainer* container = new AppContainer(context);
- container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp)));
- // TODO(abarth): Currently we leak |container|.
+ for (CommandLine::StringVector::const_iterator it = args.begin();
+ it != args.end(); ++it) {
+ GURL url(*it);
+ if (url.scheme() == "mojo" && !command_line.HasSwitch(switches::kOrigin)) {
+ LOG(ERROR) << "mojo: url passed with no --origin specified.";
+ base::MessageLoop::current()->Quit();
+ return;
+ }
+ ScopedMessagePipeHandle no_handle;
+ context->service_manager()->Connect(GURL(*it), no_handle.Pass());
+ }
+ // TODO(davemoore): Currently we leak |service_manager|.
}
} // namespace shell
« no previous file with comments | « mojo/shell/network_delegate.cc ('k') | mojo/shell/service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698