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

Unified Diff: mojo/shell/run.cc

Issue 305013015: Mojo: (Mostly) factor out command-line switches from the shell's load code path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « mojo/shell/run.h ('k') | no next file » | 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 34cdfc89ba76db2df225c29b928d1fc6fbda2e06..6a47e27088a02c09bb5b29a36e9d3014ad46c020 100644
--- a/mojo/shell/run.cc
+++ b/mojo/shell/run.cc
@@ -4,40 +4,32 @@
#include "mojo/shell/run.h"
-#include "base/command_line.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
#include "mojo/service_manager/service_manager.h"
#include "mojo/shell/context.h"
#include "mojo/shell/keep_alive.h"
-#include "mojo/shell/switches.h"
-#include "url/gurl.h"
namespace mojo {
namespace shell {
-void Run(Context* context) {
+void Run(Context* context, const std::vector<GURL>& app_urls) {
KeepAlive keep_alive(context);
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
- base::CommandLine::StringVector args = command_line.GetArgs();
-
- if (args.empty()) {
- LOG(ERROR) << "No app path specified.";
+ if (app_urls.empty()) {
+ LOG(ERROR) << "No app path specified";
return;
}
- for (base::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.";
+ for (std::vector<GURL>::const_iterator it = app_urls.begin();
+ it != app_urls.end();
+ ++it) {
+ if (it->scheme() == "mojo" && context->mojo_origin().empty()) {
+ LOG(ERROR) << "mojo: URL passed with no origin specified";
return;
}
ScopedMessagePipeHandle no_handle;
context->service_manager()->ConnectToService(
- GURL(*it), std::string(), no_handle.Pass());
+ *it, std::string(), no_handle.Pass());
}
}
« no previous file with comments | « mojo/shell/run.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698