summaryrefslogtreecommitdiffstats
path: root/mojo/shell/standalone
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-27 00:53:31 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-27 08:54:21 +0000
commitc6eb8ad71579f9945976e5b4b4915f084388e5ae (patch)
treee52c8143199b096bbb8b91f4445e0778702d6371 /mojo/shell/standalone
parent2d1f2621d8e6dd10feba6cab380fb46d60cb3098 (diff)
downloadchromium_src-c6eb8ad71579f9945976e5b4b4915f084388e5ae.zip
chromium_src-c6eb8ad71579f9945976e5b4b4915f084388e5ae.tar.gz
chromium_src-c6eb8ad71579f9945976e5b4b4915f084388e5ae.tar.bz2
Change Mojo URLs to structured names.
type:path Remove GURLs from all over the place. This eliminates the need to register Mojo and Exe schemes. BUG= CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Review URL: https://codereview.chromium.org/1743473002 Cr-Commit-Position: refs/heads/master@{#378130}
Diffstat (limited to 'mojo/shell/standalone')
-rw-r--r--mojo/shell/standalone/context.cc26
-rw-r--r--mojo/shell/standalone/context.h5
-rw-r--r--mojo/shell/standalone/desktop/launcher_process.h2
-rw-r--r--mojo/shell/standalone/desktop/main_helper.h3
4 files changed, 18 insertions, 18 deletions
diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc
index e6ecd09..3ef38cb 100644
--- a/mojo/shell/standalone/context.cc
+++ b/mojo/shell/standalone/context.cc
@@ -22,6 +22,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -35,12 +36,12 @@
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
#include "mojo/shell/application_loader.h"
#include "mojo/shell/connect_params.h"
+#include "mojo/shell/public/cpp/names.h"
#include "mojo/shell/runner/host/in_process_native_runner.h"
#include "mojo/shell/runner/host/out_of_process_native_runner.h"
#include "mojo/shell/standalone/tracer.h"
#include "mojo/shell/switches.h"
#include "mojo/util/filename_util.h"
-#include "url/gurl.h"
namespace mojo {
namespace shell {
@@ -90,8 +91,8 @@ scoped_ptr<base::Thread> CreateIOThread(const char* name) {
return thread;
}
-void OnInstanceQuit(const GURL& url, const Identity& identity) {
- if (url == identity.url())
+void OnInstanceQuit(const std::string& name, const Identity& identity) {
+ if (name == identity.name())
base::MessageLoop::current()->QuitWhenIdle();
}
@@ -156,7 +157,7 @@ void Context::Init(scoped_ptr<InitParams> init_params) {
if (init_params)
app_catalog = std::move(init_params->app_catalog);
application_manager_.reset(new ApplicationManager(std::move(runner_factory),
- blocking_pool_.get(), true,
+ blocking_pool_.get(),
std::move(app_catalog)));
shell::mojom::InterfaceProviderPtr tracing_remote_interfaces;
@@ -165,7 +166,7 @@ void Context::Init(scoped_ptr<InitParams> init_params) {
scoped_ptr<ConnectParams> params(new ConnectParams);
params->set_source(CreateShellIdentity());
- params->set_target(Identity(GURL("mojo:tracing"), std::string(),
+ params->set_target(Identity("mojo:tracing", std::string(),
mojom::Connector::kUserInherit));
params->set_remote_interfaces(GetProxy(&tracing_remote_interfaces));
params->set_local_interfaces(std::move(tracing_local_interfaces));
@@ -219,24 +220,29 @@ void Context::RunCommandLineApplication() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
base::CommandLine::StringVector args = command_line->GetArgs();
for (size_t i = 0; i < args.size(); ++i) {
- GURL possible_app(args[i]);
- if (possible_app.SchemeIs("mojo")) {
+#if defined(OS_WIN)
+ std::string possible_app = base::WideToUTF8(args[i]);
+#else
+ std::string possible_app = args[i];
+#endif
+ if (GetNameType(possible_app) == "mojo") {
Run(possible_app);
break;
}
}
}
-void Context::Run(const GURL& url) {
+void Context::Run(const std::string& name) {
application_manager_->SetInstanceQuitCallback(
- base::Bind(&OnInstanceQuit, url));
+ base::Bind(&OnInstanceQuit, name));
shell::mojom::InterfaceProviderPtr remote_interfaces;
shell::mojom::InterfaceProviderPtr local_interfaces;
scoped_ptr<ConnectParams> params(new ConnectParams);
params->set_source(CreateShellIdentity());
- params->set_target(Identity(url, std::string(), mojom::Connector::kUserRoot));
+ params->set_target(Identity(name, std::string(),
+ mojom::Connector::kUserRoot));
params->set_remote_interfaces(GetProxy(&remote_interfaces));
params->set_local_interfaces(std::move(local_interfaces));
application_manager_->Connect(std::move(params));
diff --git a/mojo/shell/standalone/context.h b/mojo/shell/standalone/context.h
index b4e3768..2b729a9 100644
--- a/mojo/shell/standalone/context.h
+++ b/mojo/shell/standalone/context.h
@@ -14,7 +14,6 @@
#include "mojo/edk/embedder/process_delegate.h"
#include "mojo/shell/application_manager.h"
#include "mojo/shell/standalone/tracer.h"
-#include "url/gurl.h"
namespace base {
class SingleThreadTaskRunner;
@@ -62,8 +61,8 @@ class Context : public edk::ProcessDelegate {
// edk::ProcessDelegate:
void OnShutdownComplete() override;
- // Runs the app specified by |url|.
- void Run(const GURL& url);
+ // Runs the app specified by |name|.
+ void Run(const std::string& name);
scoped_refptr<base::SingleThreadTaskRunner> shell_runner_;
scoped_ptr<base::Thread> io_thread_;
diff --git a/mojo/shell/standalone/desktop/launcher_process.h b/mojo/shell/standalone/desktop/launcher_process.h
index 8c32775..54ec2957 100644
--- a/mojo/shell/standalone/desktop/launcher_process.h
+++ b/mojo/shell/standalone/desktop/launcher_process.h
@@ -7,8 +7,6 @@
#include "base/callback_forward.h"
-class GURL;
-
namespace mojo {
namespace shell {
diff --git a/mojo/shell/standalone/desktop/main_helper.h b/mojo/shell/standalone/desktop/main_helper.h
index 644f19e..a2b5fcf 100644
--- a/mojo/shell/standalone/desktop/main_helper.h
+++ b/mojo/shell/standalone/desktop/main_helper.h
@@ -5,9 +5,6 @@
#ifndef MOJO_SHELL_STANDALONE_DESKTOP_MAIN_HELPER_H
#define MOJO_SHELL_STANDALONE_DESKTOP_MAIN_HELPER_H
-#include "base/callback.h"
-#include "url/gurl.h"
-
namespace mojo {
namespace shell {