Commit 194a8f4a authored by aa's avatar aa Committed by Commit bot

Change mojo URLs from mojo://mojo_foo to mojo://foo.

The real changes are in mojo_url_resolver*.

The rest are renames that were generated with the following commands:

git grep -l 'mojo:mojo_' | xargs perl -pi -e 's|mojo:mojo_|mojo:|g'
git grep -l 'mojo://mojo_' | xargs perl -pi -e 's|mojo://mojo_|mojo://|g'
git cl format

Review URL: https://codereview.chromium.org/668483002

Cr-Commit-Position: refs/heads/master@{#300206}
parent 5c407cf0
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
// services and then prints a brief summary of the response. // services and then prints a brief summary of the response.
// //
// To run it using mojo_js_standalone (don't forget the quotes): // To run it using mojo_js_standalone (don't forget the quotes):
// mojo_shell 'mojo://mojo_js_standalone THIS_DIR/main.js' // mojo_shell 'mojo://js_standalone THIS_DIR/main.js'
// //
// To run it using mojo_js_content handler this file must be specified as // To run it using mojo_js_content handler this file must be specified as
// a URL. For example: // a URL. For example:
// (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) & // (cd YOUR_DIR/mojo/apps/js; python -m SimpleHTTPServer ) &
// mojo_shell \ // mojo_shell \
// --content-handlers=application/javascript,mojo://mojo_js_content_handler \ // --content-handlers=application/javascript,mojo://js_content_handler \
// http://localhost:8000/test.js // http://localhost:8000/test.js
define("test", [ define("test", [
...@@ -26,7 +26,7 @@ define("test", [ ...@@ -26,7 +26,7 @@ define("test", [
], function(mojo, core, connection, support, net, loader, console) { ], function(mojo, core, connection, support, net, loader, console) {
var networkService = mojo.connectToService( var networkService = mojo.connectToService(
"mojo:mojo_network_service", net.NetworkService); "mojo:network_service", net.NetworkService);
var urlLoaderPipe = core.createMessagePipe(); var urlLoaderPipe = core.createMessagePipe();
networkService.createURLLoader(urlLoaderPipe.handle1); networkService.createURLLoader(urlLoaderPipe.handle1);
......
...@@ -205,7 +205,7 @@ void SurfaceBinding::PerViewManagerState::Init() { ...@@ -205,7 +205,7 @@ void SurfaceBinding::PerViewManagerState::Init() {
DCHECK(!surfaces_service_.get()); DCHECK(!surfaces_service_.get());
ServiceProviderPtr surfaces_service_provider; ServiceProviderPtr surfaces_service_provider;
shell_->ConnectToApplication("mojo:mojo_surfaces_service", shell_->ConnectToApplication("mojo:surfaces_service",
GetProxy(&surfaces_service_provider)); GetProxy(&surfaces_service_provider));
ConnectToService(surfaces_service_provider.get(), &surfaces_service_); ConnectToService(surfaces_service_provider.get(), &surfaces_service_);
// base::Unretained is ok here as we block until the call is received. // base::Unretained is ok here as we block until the call is received.
...@@ -221,8 +221,8 @@ void SurfaceBinding::PerViewManagerState::Init() { ...@@ -221,8 +221,8 @@ void SurfaceBinding::PerViewManagerState::Init() {
surface_.set_client(surface_client_.get()); surface_.set_client(surface_client_.get());
ServiceProviderPtr gpu_service_provider; ServiceProviderPtr gpu_service_provider;
// TODO(jamesr): Should be mojo:mojo_gpu_service // TODO(jamesr): Should be mojo:gpu_service
shell_->ConnectToApplication("mojo:mojo_native_viewport_service", shell_->ConnectToApplication("mojo:native_viewport_service",
GetProxy(&gpu_service_provider)); GetProxy(&gpu_service_provider));
ConnectToService(gpu_service_provider.get(), &gpu_); ConnectToService(gpu_service_provider.get(), &gpu_);
} }
......
...@@ -84,7 +84,7 @@ class ExampleApptest : public Apptest { ...@@ -84,7 +84,7 @@ class ExampleApptest : public Apptest {
} }
virtual void SetUp() override { virtual void SetUp() override {
Apptest::SetUp(); Apptest::SetUp();
application_impl()->ConnectToService("mojo:mojo_example_service", application_impl()->ConnectToService("mojo:example_service",
&example_service_); &example_service_);
example_service_.set_client(&example_client_); example_service_.set_client(&example_client_);
} }
...@@ -144,7 +144,7 @@ MojoResult MojoMain(MojoHandle shell_handle) { ...@@ -144,7 +144,7 @@ MojoResult MojoMain(MojoHandle shell_handle) {
// Construct an ApplicationImpl just for the GTEST commandline arguments. // Construct an ApplicationImpl just for the GTEST commandline arguments.
// GTEST command line arguments are supported amid application arguments: // GTEST command line arguments are supported amid application arguments:
// mojo_shell 'mojo:mojo_example_apptest arg1 --gtest_filter=foo arg2' // mojo_shell 'mojo:example_apptest arg1 --gtest_filter=foo arg2'
mojo::ApplicationDelegate dummy_application_delegate; mojo::ApplicationDelegate dummy_application_delegate;
mojo::ApplicationImpl app(&dummy_application_delegate, shell_handle); mojo::ApplicationImpl app(&dummy_application_delegate, shell_handle);
MOJO_CHECK(app.WaitForInitialize()); MOJO_CHECK(app.WaitForInitialize());
......
...@@ -23,7 +23,7 @@ class ViewManagerInit : public mojo::ApplicationDelegate { ...@@ -23,7 +23,7 @@ class ViewManagerInit : public mojo::ApplicationDelegate {
virtual void Initialize(mojo::ApplicationImpl* app) override { virtual void Initialize(mojo::ApplicationImpl* app) override {
context_.reset(new mojo::ViewManagerContext(app)); context_.reset(new mojo::ViewManagerContext(app));
context_->Embed("mojo:mojo_aura_demo"); context_->Embed("mojo:aura_demo");
} }
private: private:
......
...@@ -45,11 +45,11 @@ BitmapUploader::BitmapUploader(View* view) ...@@ -45,11 +45,11 @@ BitmapUploader::BitmapUploader(View* view)
void BitmapUploader::Init(Shell* shell) { void BitmapUploader::Init(Shell* shell) {
ServiceProviderPtr surfaces_service_provider; ServiceProviderPtr surfaces_service_provider;
shell->ConnectToApplication("mojo:mojo_surfaces_service", shell->ConnectToApplication("mojo:surfaces_service",
GetProxy(&surfaces_service_provider)); GetProxy(&surfaces_service_provider));
ConnectToService(surfaces_service_provider.get(), &surfaces_service_); ConnectToService(surfaces_service_provider.get(), &surfaces_service_);
ServiceProviderPtr gpu_service_provider; ServiceProviderPtr gpu_service_provider;
shell->ConnectToApplication("mojo:mojo_native_viewport_service", shell->ConnectToApplication("mojo:native_viewport_service",
GetProxy(&gpu_service_provider)); GetProxy(&gpu_service_provider));
ConnectToService(gpu_service_provider.get(), &gpu_service_); ConnectToService(gpu_service_provider.get(), &gpu_service_);
......
...@@ -169,7 +169,7 @@ class Browser : public ApplicationDelegate, ...@@ -169,7 +169,7 @@ class Browser : public ApplicationDelegate,
view_manager_client_factory_.reset( view_manager_client_factory_.reset(
new ViewManagerClientFactory(shell_, this)); new ViewManagerClientFactory(shell_, this));
views_init_.reset(new ViewsInit); views_init_.reset(new ViewsInit);
app->ConnectToService("mojo:mojo_window_manager", &window_manager_); app->ConnectToService("mojo:window_manager", &window_manager_);
} }
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
......
...@@ -18,7 +18,7 @@ class DemoLauncher : public mojo::ApplicationDelegate { ...@@ -18,7 +18,7 @@ class DemoLauncher : public mojo::ApplicationDelegate {
private: private:
virtual void Initialize(mojo::ApplicationImpl* app) override { virtual void Initialize(mojo::ApplicationImpl* app) override {
context_.reset(new mojo::ViewManagerContext(app)); context_.reset(new mojo::ViewManagerContext(app));
context_->Embed("mojo:mojo_window_manager"); context_->Embed("mojo:window_manager");
} }
scoped_ptr<mojo::ViewManagerContext> context_; scoped_ptr<mojo::ViewManagerContext> context_;
......
...@@ -26,7 +26,7 @@ class ResponsePrinter { ...@@ -26,7 +26,7 @@ class ResponsePrinter {
class EchoClientDelegate : public ApplicationDelegate { class EchoClientDelegate : public ApplicationDelegate {
public: public:
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_echo_service", &echo_service_); app->ConnectToService("mojo:echo_service", &echo_service_);
echo_service_->EchoString("hello world", ResponsePrinter()); echo_service_->EchoString("hello world", ResponsePrinter());
} }
......
...@@ -100,7 +100,7 @@ class Connection { ...@@ -100,7 +100,7 @@ class Connection {
class HttpServerApp : public ApplicationDelegate { class HttpServerApp : public ApplicationDelegate {
public: public:
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_network_service", &network_service_); app->ConnectToService("mojo:network_service", &network_service_);
Start(); Start();
} }
......
...@@ -203,7 +203,7 @@ class MediaViewer ...@@ -203,7 +203,7 @@ class MediaViewer
control_view_(NULL), control_view_(NULL),
content_view_(NULL), content_view_(NULL),
control_panel_(this) { control_panel_(this) {
handler_map_["image/png"] = "mojo:mojo_png_viewer"; handler_map_["image/png"] = "mojo:png_viewer";
} }
virtual ~MediaViewer() { virtual ~MediaViewer() {
......
...@@ -26,7 +26,7 @@ namespace mojo { ...@@ -26,7 +26,7 @@ namespace mojo {
namespace examples { namespace examples {
namespace { namespace {
const char kEmbeddedAppURL[] = "mojo:mojo_embedded_app"; const char kEmbeddedAppURL[] = "mojo:embedded_app";
} }
class NestingApp; class NestingApp;
......
...@@ -38,11 +38,11 @@ class PepperContainerApp: public ApplicationDelegate, ...@@ -38,11 +38,11 @@ class PepperContainerApp: public ApplicationDelegate,
virtual ~PepperContainerApp() {} virtual ~PepperContainerApp() {}
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_); app->ConnectToService("mojo:native_viewport_service", &viewport_);
viewport_.set_client(this); viewport_.set_client(this);
// TODO(jamesr): Should be mojo:mojo_gpu_service // TODO(jamesr): Should be mojo:gpu_service
app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_); app->ConnectToService("mojo:native_viewport_service", &gpu_service_);
SizePtr size(Size::New()); SizePtr size(Size::New());
size->width = 800; size->width = 800;
......
...@@ -32,11 +32,11 @@ class SampleApp : public mojo::ApplicationDelegate, ...@@ -32,11 +32,11 @@ class SampleApp : public mojo::ApplicationDelegate,
} }
virtual void Initialize(mojo::ApplicationImpl* app) override { virtual void Initialize(mojo::ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_); app->ConnectToService("mojo:native_viewport_service", &viewport_);
viewport_.set_client(this); viewport_.set_client(this);
// TODO(jamesr): Should be mojo:mojo_gpu_service // TODO(jamesr): Should be mojo:gpu_service
app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_); app->ConnectToService("mojo:native_viewport_service", &gpu_service_);
mojo::SizePtr size(mojo::Size::New()); mojo::SizePtr size(mojo::Size::New());
size->width = 800; size->width = 800;
......
...@@ -21,7 +21,7 @@ class ChildApp : public ApplicationDelegate, public InterfaceFactory<Child> { ...@@ -21,7 +21,7 @@ class ChildApp : public ApplicationDelegate, public InterfaceFactory<Child> {
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
surfaces_service_connection_ = surfaces_service_connection_ =
app->ConnectToApplication("mojo:mojo_surfaces_service"); app->ConnectToApplication("mojo:surfaces_service");
} }
// ApplicationDelegate implementation. // ApplicationDelegate implementation.
......
...@@ -23,9 +23,9 @@ class ChildGLApp : public ApplicationDelegate, public InterfaceFactory<Child> { ...@@ -23,9 +23,9 @@ class ChildGLApp : public ApplicationDelegate, public InterfaceFactory<Child> {
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
surfaces_service_connection_ = surfaces_service_connection_ =
app->ConnectToApplication("mojo:mojo_surfaces_service"); app->ConnectToApplication("mojo:surfaces_service");
// TODO(jamesr): Should be mojo:mojo_gpu_service // TODO(jamesr): Should be mojo:gpu_service
app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_); app->ConnectToService("mojo:native_viewport_service", &gpu_service_);
} }
// ApplicationDelegate implementation. // ApplicationDelegate implementation.
......
...@@ -36,12 +36,10 @@ class SurfacesApp : public ApplicationDelegate, ...@@ -36,12 +36,10 @@ class SurfacesApp : public ApplicationDelegate,
// ApplicationDelegate implementation // ApplicationDelegate implementation
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
ApplicationConnection* connection) override { ApplicationConnection* connection) override {
connection->ConnectToService("mojo:mojo_native_viewport_service", connection->ConnectToService("mojo:native_viewport_service", &viewport_);
&viewport_);
viewport_.set_client(this); viewport_.set_client(this);
connection->ConnectToService("mojo:mojo_surfaces_service", connection->ConnectToService("mojo:surfaces_service", &surfaces_service_);
&surfaces_service_);
surfaces_service_->CreateSurfaceConnection(base::Bind( surfaces_service_->CreateSurfaceConnection(base::Bind(
&SurfacesApp::SurfaceConnectionCreated, base::Unretained(this))); &SurfacesApp::SurfaceConnectionCreated, base::Unretained(this)));
...@@ -53,9 +51,8 @@ class SurfacesApp : public ApplicationDelegate, ...@@ -53,9 +51,8 @@ class SurfacesApp : public ApplicationDelegate,
viewport_->Show(); viewport_->Show();
child_size_ = gfx::Size(size_.width() / 3, size_.height() / 2); child_size_ = gfx::Size(size_.width() / 3, size_.height() / 2);
connection->ConnectToService("mojo:mojo_surfaces_child_app", &child_one_); connection->ConnectToService("mojo:surfaces_child_app", &child_one_);
connection->ConnectToService("mojo:mojo_surfaces_child_gl_app", connection->ConnectToService("mojo:surfaces_child_gl_app", &child_two_);
&child_two_);
child_one_->ProduceFrame(Color::From(SK_ColorBLUE), child_one_->ProduceFrame(Color::From(SK_ColorBLUE),
Size::From(child_size_), Size::From(child_size_),
base::Bind(&SurfacesApp::ChildOneProducedFrame, base::Bind(&SurfacesApp::ChildOneProducedFrame,
......
...@@ -71,7 +71,7 @@ class ResponsePrinter { ...@@ -71,7 +71,7 @@ class ResponsePrinter {
class WGetApp : public ApplicationDelegate { class WGetApp : public ApplicationDelegate {
public: public:
virtual void Initialize(ApplicationImpl* app) override { virtual void Initialize(ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_network_service", &network_service_); app->ConnectToService("mojo:network_service", &network_service_);
Start(app->args()); Start(app->args());
} }
......
...@@ -120,7 +120,7 @@ void DebugPanel::Layout(views::View* view) { ...@@ -120,7 +120,7 @@ void DebugPanel::Layout(views::View* view) {
void DebugPanel::ButtonPressed(views::Button* sender, const ui::Event& event) { void DebugPanel::ButtonPressed(views::Button* sender, const ui::Event& event) {
if (sender == colored_square_) { if (sender == colored_square_) {
Navigate("mojo://mojo_embedded_app/"); Navigate("mojo://embedded_app/");
} else if (sender == close_last_) { } else if (sender == close_last_) {
delegate_->CloseTopWindow(); delegate_->CloseTopWindow();
} else if (sender == cross_app_) { } else if (sender == cross_app_) {
......
...@@ -160,8 +160,8 @@ class KeyboardManager : public KeyboardClient, ...@@ -160,8 +160,8 @@ class KeyboardManager : public KeyboardClient,
view_ = View::Create(view_manager); view_ = View::Create(view_manager);
view_->SetBounds(bounds); view_->SetBounds(bounds);
parent->AddChild(view_); parent->AddChild(view_);
view_->Embed("mojo:mojo_keyboard"); view_->Embed("mojo:keyboard");
application->ConnectToService("mojo:mojo_keyboard", &keyboard_service_); application->ConnectToService("mojo:keyboard", &keyboard_service_);
keyboard_service_.set_client(this); keyboard_service_.set_client(this);
parent->AddObserver(this); parent->AddObserver(this);
} }
...@@ -490,7 +490,7 @@ class WindowManager ...@@ -490,7 +490,7 @@ class WindowManager
bounds.Inset(kBorderInset, kBorderInset); bounds.Inset(kBorderInset, kBorderInset);
bounds.set_height(kTextfieldHeight); bounds.set_height(kTextfieldHeight);
launcher_ui_ = CreateWindow(bounds); launcher_ui_ = CreateWindow(bounds);
launcher_ui_->Embed("mojo:mojo_browser"); launcher_ui_->Embed("mojo:browser");
return launcher_ui_->view()->id(); return launcher_ui_->view()->id();
} }
......
...@@ -102,7 +102,7 @@ class WMFlowApp : public mojo::ApplicationDelegate, ...@@ -102,7 +102,7 @@ class WMFlowApp : public mojo::ApplicationDelegate,
// Expose some services to the embeddee... // Expose some services to the embeddee...
registry->AddService(&embedder_factory_); registry->AddService(&embedder_factory_);
scoped_ptr<mojo::ServiceProvider> imported = scoped_ptr<mojo::ServiceProvider> imported =
embed->Embed("mojo:mojo_wm_flow_embedded", registry.Pass()); embed->Embed("mojo:wm_flow_embedded", registry.Pass());
mojo::ConnectToService(imported.get(), &embeddee_); mojo::ConnectToService(imported.get(), &embeddee_);
embeddee_->HelloBack(base::Bind(&WMFlowApp::HelloBackAck, embeddee_->HelloBack(base::Bind(&WMFlowApp::HelloBackAck,
base::Unretained(this))); base::Unretained(this)));
...@@ -133,9 +133,7 @@ class WMFlowApp : public mojo::ApplicationDelegate, ...@@ -133,9 +133,7 @@ class WMFlowApp : public mojo::ApplicationDelegate,
printf("HelloBack() ack'ed\n"); printf("HelloBack() ack'ed\n");
} }
void OpenNewWindow() { void OpenNewWindow() { view_manager_context_->Embed("mojo:wm_flow_app"); }
view_manager_context_->Embed("mojo:mojo_wm_flow_app");
}
mojo::Shell* shell_; mojo::Shell* shell_;
int embed_count_; int embed_count_;
......
...@@ -23,8 +23,8 @@ class WMFlowInit : public mojo::ApplicationDelegate { ...@@ -23,8 +23,8 @@ class WMFlowInit : public mojo::ApplicationDelegate {
// Overridden from Application: // Overridden from Application:
virtual void Initialize(mojo::ApplicationImpl* app) override { virtual void Initialize(mojo::ApplicationImpl* app) override {
context_.reset(new mojo::ViewManagerContext(app)); context_.reset(new mojo::ViewManagerContext(app));
context_->Embed("mojo:mojo_wm_flow_wm"); context_->Embed("mojo:wm_flow_wm");
app->ConnectToApplication("mojo:mojo_wm_flow_app"); app->ConnectToApplication("mojo:wm_flow_app");
} }
scoped_ptr<mojo::ViewManagerContext> context_; scoped_ptr<mojo::ViewManagerContext> context_;
......
...@@ -52,8 +52,8 @@ class ClipboardStandaloneTest : public testing::Test { ...@@ -52,8 +52,8 @@ class ClipboardStandaloneTest : public testing::Test {
virtual void SetUp() override { virtual void SetUp() override {
test_helper_.Init(); test_helper_.Init();
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(GURL("mojo:clipboard"),
GURL("mojo:mojo_clipboard"), &clipboard_); &clipboard_);
} }
uint64_t GetSequenceNumber() { uint64_t GetSequenceNumber() {
......
...@@ -56,14 +56,14 @@ BlinkPlatformImpl::BlinkPlatformImpl(ApplicationImpl* app) ...@@ -56,14 +56,14 @@ BlinkPlatformImpl::BlinkPlatformImpl(ApplicationImpl* app)
shared_timer_fire_time_was_set_while_suspended_(false), shared_timer_fire_time_was_set_while_suspended_(false),
shared_timer_suspended_(0), shared_timer_suspended_(0),
current_thread_slot_(&DestroyCurrentThread) { current_thread_slot_(&DestroyCurrentThread) {
app->ConnectToService("mojo:mojo_network_service", &network_service_); app->ConnectToService("mojo:network_service", &network_service_);
CookieStorePtr cookie_store; CookieStorePtr cookie_store;
network_service_->GetCookieStore(GetProxy(&cookie_store)); network_service_->GetCookieStore(GetProxy(&cookie_store));
cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass())); cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass()));
ClipboardPtr clipboard; ClipboardPtr clipboard;
app->ConnectToService("mojo:mojo_clipboard", &clipboard); app->ConnectToService("mojo:clipboard", &clipboard);
clipboard_.reset(new WebClipboardImpl(clipboard.Pass())); clipboard_.reset(new WebClipboardImpl(clipboard.Pass()));
} }
......
...@@ -154,14 +154,14 @@ blink::WebStorageNamespace* HTMLDocumentView::createSessionStorageNamespace() { ...@@ -154,14 +154,14 @@ blink::WebStorageNamespace* HTMLDocumentView::createSessionStorageNamespace() {
void HTMLDocumentView::initializeLayerTreeView() { void HTMLDocumentView::initializeLayerTreeView() {
ServiceProviderPtr surfaces_service_provider; ServiceProviderPtr surfaces_service_provider;
shell_->ConnectToApplication("mojo:mojo_surfaces_service", shell_->ConnectToApplication("mojo:surfaces_service",
GetProxy(&surfaces_service_provider)); GetProxy(&surfaces_service_provider));
SurfacesServicePtr surfaces_service; SurfacesServicePtr surfaces_service;
ConnectToService(surfaces_service_provider.get(), &surfaces_service); ConnectToService(surfaces_service_provider.get(), &surfaces_service);
ServiceProviderPtr gpu_service_provider; ServiceProviderPtr gpu_service_provider;
// TODO(jamesr): Should be mojo:mojo_gpu_service // TODO(jamesr): Should be mojo:gpu_service
shell_->ConnectToApplication("mojo:mojo_native_viewport_service", shell_->ConnectToApplication("mojo:native_viewport_service",
GetProxy(&gpu_service_provider)); GetProxy(&gpu_service_provider));
GpuPtr gpu_service; GpuPtr gpu_service;
ConnectToService(gpu_service_provider.get(), &gpu_service); ConnectToService(gpu_service_provider.get(), &gpu_service);
......
...@@ -35,9 +35,9 @@ NativeViewportImpl::NativeViewportImpl(ApplicationImpl* app, bool is_headless) ...@@ -35,9 +35,9 @@ NativeViewportImpl::NativeViewportImpl(ApplicationImpl* app, bool is_headless)
widget_id_(0u), widget_id_(0u),
waiting_for_event_ack_(false), waiting_for_event_ack_(false),
weak_factory_(this) { weak_factory_(this) {
app->ConnectToService("mojo:mojo_surfaces_service", &surfaces_service_); app->ConnectToService("mojo:surfaces_service", &surfaces_service_);
// TODO(jamesr): Should be mojo_gpu_service // TODO(jamesr): Should be mojo_gpu_service
app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_); app->ConnectToService("mojo:native_viewport_service", &gpu_service_);
} }
NativeViewportImpl::~NativeViewportImpl() { NativeViewportImpl::~NativeViewportImpl() {
......
...@@ -212,7 +212,7 @@ class UDPSocketTest : public testing::Test { ...@@ -212,7 +212,7 @@ class UDPSocketTest : public testing::Test {
test_helper_.Init(); test_helper_.Init();
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(
GURL("mojo:mojo_network_service"), &network_service_); GURL("mojo:network_service"), &network_service_);
network_service_->CreateUDPSocket(GetProxy(&udp_socket_)); network_service_->CreateUDPSocket(GetProxy(&udp_socket_));
udp_socket_.set_client(&udp_socket_client_); udp_socket_.set_client(&udp_socket_client_);
......
...@@ -93,7 +93,7 @@ ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate, ...@@ -93,7 +93,7 @@ ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate,
Shell* shell) Shell* shell)
: connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) { : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) {
InterfacePtr<ServiceProvider> sp; InterfacePtr<ServiceProvider> sp;
shell->ConnectToApplication("mojo:mojo_window_manager", GetProxy(&sp)); shell->ConnectToApplication("mojo:window_manager", GetProxy(&sp));
ConnectToService(sp.get(), &window_manager_); ConnectToService(sp.get(), &window_manager_);
window_manager_.set_client(this); window_manager_.set_client(this);
} }
......
...@@ -15,8 +15,7 @@ void ConnectCallback(bool success) {} ...@@ -15,8 +15,7 @@ void ConnectCallback(bool success) {}
class ViewManagerContext::InternalState { class ViewManagerContext::InternalState {
public: public:
InternalState(ApplicationImpl* application_impl) { InternalState(ApplicationImpl* application_impl) {
application_impl->ConnectToService("mojo:mojo_view_manager", application_impl->ConnectToService("mojo:view_manager", &init_service_);
&init_service_);
} }
~InternalState() {} ~InternalState() {}
......
...@@ -316,7 +316,7 @@ class ViewManagerTest : public testing::Test { ...@@ -316,7 +316,7 @@ class ViewManagerTest : public testing::Test {
GURL(kEmbeddedApp1URL)); GURL(kEmbeddedApp1URL));
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(
GURL("mojo:mojo_view_manager"), &view_manager_init_); GURL("mojo:view_manager"), &view_manager_init_);
ASSERT_TRUE(EmbedRoot(view_manager_init_.get(), kWindowManagerURL)); ASSERT_TRUE(EmbedRoot(view_manager_init_.get(), kWindowManagerURL));
} }
......
...@@ -57,8 +57,7 @@ void TestServiceImpl::ConnectToAppAndGetTime( ...@@ -57,8 +57,7 @@ void TestServiceImpl::ConnectToAppAndGetTime(
void TestServiceImpl::StartTrackingRequests( void TestServiceImpl::StartTrackingRequests(
const mojo::Callback<void()>& callback) { const mojo::Callback<void()>& callback) {
TestRequestTrackerPtr tracker; TestRequestTrackerPtr tracker;
connection_->ConnectToService( connection_->ConnectToService("mojo:test_request_tracker_app", &tracker);
"mojo:mojo_test_request_tracker_app", &tracker);
tracking_.reset( tracking_.reset(
new TestRequestTrackerClientImpl(tracker.Pass(), Name_, callback)); new TestRequestTrackerClientImpl(tracker.Pass(), Name_, callback));
} }
......
...@@ -21,8 +21,7 @@ TestTimeServiceImpl::~TestTimeServiceImpl() { ...@@ -21,8 +21,7 @@ TestTimeServiceImpl::~TestTimeServiceImpl() {
void TestTimeServiceImpl::StartTrackingRequests( void TestTimeServiceImpl::StartTrackingRequests(
const mojo::Callback<void()>& callback) { const mojo::Callback<void()>& callback) {
TestRequestTrackerPtr tracker; TestRequestTrackerPtr tracker;
application_->ConnectToService( application_->ConnectToService("mojo:test_request_tracker_app", &tracker);
"mojo:mojo_test_request_tracker_app", &tracker);
tracking_.reset(new TestRequestTrackerClientImpl( tracking_.reset(new TestRequestTrackerClientImpl(
tracker.Pass(), Name_, callback)); tracker.Pass(), Name_, callback));
} }
......
...@@ -77,7 +77,7 @@ DisplayManager::DisplayManager( ...@@ -77,7 +77,7 @@ DisplayManager::DisplayManager(
size_(800, 600), size_(800, 600),
draw_timer_(false, false), draw_timer_(false, false),
weak_factory_(this) { weak_factory_(this) {
app_connection->ConnectToService("mojo:mojo_native_viewport_service", app_connection->ConnectToService("mojo:native_viewport_service",
&native_viewport_); &native_viewport_);
native_viewport_.set_client(this); native_viewport_.set_client(this);
native_viewport_->Create( native_viewport_->Create(
...@@ -85,8 +85,7 @@ DisplayManager::DisplayManager( ...@@ -85,8 +85,7 @@ DisplayManager::DisplayManager(
base::Bind(&DisplayManager::OnCreatedNativeViewport, base::Bind(&DisplayManager::OnCreatedNativeViewport,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
native_viewport_->Show(); native_viewport_->Show();
app_connection->ConnectToService("mojo:mojo_surfaces_service", app_connection->ConnectToService("mojo:surfaces_service", &surfaces_service_);
&surfaces_service_);
surfaces_service_->CreateSurfaceConnection(base::Bind( surfaces_service_->CreateSurfaceConnection(base::Bind(
&DisplayManager::OnSurfaceConnectionCreated, weak_factory_.GetWeakPtr())); &DisplayManager::OnSurfaceConnectionCreated, weak_factory_.GetWeakPtr()));
} }
......
...@@ -509,7 +509,7 @@ class ViewManagerTest : public testing::Test { ...@@ -509,7 +509,7 @@ class ViewManagerTest : public testing::Test {
std::vector<std::string> native_viewport_args; std::vector<std::string> native_viewport_args;
native_viewport_args.push_back(kUseTestConfig); native_viewport_args.push_back(kUseTestConfig);
test_helper_.application_manager()->SetArgsForURL( test_helper_.application_manager()->SetArgsForURL(
native_viewport_args, GURL("mojo:mojo_native_viewport_service")); native_viewport_args, GURL("mojo:native_viewport_service"));
printf("Setting args\n"); printf("Setting args\n");
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -527,7 +527,7 @@ class ViewManagerTest : public testing::Test { ...@@ -527,7 +527,7 @@ class ViewManagerTest : public testing::Test {
GURL(kTestServiceURL2)); GURL(kTestServiceURL2));
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(
GURL("mojo:mojo_view_manager"), &view_manager_init_); GURL("mojo:view_manager"), &view_manager_init_);
ASSERT_TRUE(InitEmbed(view_manager_init_.get(), kTestServiceURL, 1)); ASSERT_TRUE(InitEmbed(view_manager_init_.get(), kTestServiceURL, 1));
connection_ = ViewManagerProxy::WaitForInstance(); connection_ = ViewManagerProxy::WaitForInstance();
......
...@@ -203,16 +203,16 @@ class WindowManagerApiTest : public testing::Test { ...@@ -203,16 +203,16 @@ class WindowManagerApiTest : public testing::Test {
&WindowManagerApiTest::OnRootAdded, base::Unretained(this)))), &WindowManagerApiTest::OnRootAdded, base::Unretained(this)))),
GURL(kTestServiceURL)); GURL(kTestServiceURL));
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(
GURL("mojo:mojo_view_manager"), &view_manager_init_); GURL("mojo:view_manager"), &view_manager_init_);
ASSERT_TRUE(InitEmbed(view_manager_init_.get(), ASSERT_TRUE(
"mojo:mojo_core_window_manager")); InitEmbed(view_manager_init_.get(), "mojo:core_window_manager"));
ConnectToWindowManager(); ConnectToWindowManager();
} }
virtual void TearDown() override {} virtual void TearDown() override {}
void ConnectToWindowManager() { void ConnectToWindowManager() {
test_helper_.application_manager()->ConnectToService( test_helper_.application_manager()->ConnectToService(
GURL("mojo:mojo_core_window_manager"), &window_manager_); GURL("mojo:core_window_manager"), &window_manager_);
base::RunLoop connect_loop; base::RunLoop connect_loop;
window_manager_client_.reset(new TestWindowManagerClient(&connect_loop)); window_manager_client_.reset(new TestWindowManagerClient(&connect_loop));
window_manager_.set_client(window_manager_client()); window_manager_.set_client(window_manager_client());
......
...@@ -46,7 +46,7 @@ namespace { ...@@ -46,7 +46,7 @@ namespace {
// These mojo: URLs are loaded directly from the local filesystem. They // These mojo: URLs are loaded directly from the local filesystem. They
// correspond to shared libraries bundled alongside the mojo_shell. // correspond to shared libraries bundled alongside the mojo_shell.
const char* kLocalMojoURLs[] = { const char* kLocalMojoURLs[] = {
"mojo:mojo_network_service", "mojo:network_service",
}; };
// Used to ensure we only init once. // Used to ensure we only init once.
...@@ -69,8 +69,8 @@ static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; ...@@ -69,8 +69,8 @@ static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER;
void InitContentHandlers(DynamicApplicationLoader* loader, void InitContentHandlers(DynamicApplicationLoader* loader,
base::CommandLine* command_line) { base::CommandLine* command_line) {
// Default content handlers. // Default content handlers.
loader->RegisterContentHandler("image/png", GURL("mojo://mojo_png_viewer/")); loader->RegisterContentHandler("image/png", GURL("mojo://png_viewer/"));
loader->RegisterContentHandler("text/html", GURL("mojo://mojo_html_viewer/")); loader->RegisterContentHandler("text/html", GURL("mojo://html_viewer/"));
// Command-line-specified content handlers. // Command-line-specified content handlers.
std::string handlers_spec = command_line->GetSwitchValueASCII( std::string handlers_spec = command_line->GetSwitchValueASCII(
...@@ -212,7 +212,7 @@ void Context::Init() { ...@@ -212,7 +212,7 @@ void Context::Init() {
scoped_ptr<ApplicationLoader>(new UIApplicationLoader( scoped_ptr<ApplicationLoader>(new UIApplicationLoader(
scoped_ptr<ApplicationLoader>(new NativeViewportApplicationLoader()), scoped_ptr<ApplicationLoader>(new NativeViewportApplicationLoader()),
this)), this)),
GURL("mojo:mojo_native_viewport_service")); GURL("mojo:native_viewport_service"));
#endif #endif
if (command_line->HasSwitch(switches::kSpy)) { if (command_line->HasSwitch(switches::kSpy)) {
...@@ -234,7 +234,7 @@ void Context::Init() { ...@@ -234,7 +234,7 @@ void Context::Init() {
"network_service", "network_service",
base::MessageLoop::TYPE_IO)); base::MessageLoop::TYPE_IO));
application_manager_.SetLoaderForURL(loader.Pass(), application_manager_.SetLoaderForURL(loader.Pass(),
GURL("mojo:mojo_network_service")); GURL("mojo:network_service"));
} }
#endif #endif
......
...@@ -82,11 +82,11 @@ void Usage() { ...@@ -82,11 +82,11 @@ void Usage() {
<< " <mojo-app> ...\n\n" << " <mojo-app> ...\n\n"
<< "A <mojo-app> is a Mojo URL or a Mojo URL and arguments within " << "A <mojo-app> is a Mojo URL or a Mojo URL and arguments within "
<< "quotes.\n" << "quotes.\n"
<< "Example: mojo_shell \"mojo://mojo_js_standalone test.js\".\n" << "Example: mojo_shell \"mojo://js_standalone test.js\".\n"
<< "<url-lib-path> is searched for shared libraries named by mojo URLs.\n" << "<url-lib-path> is searched for shared libraries named by mojo URLs.\n"
<< "The value of <handlers> is a comma separated list like:\n" << "The value of <handlers> is a comma separated list like:\n"
<< "text/html,mojo://mojo_html_viewer," << "text/html,mojo://html_viewer,"
<< "application/javascript,mojo://mojo_js_content_handler\n"; << "application/javascript,mojo://js_content_handler\n";
} }
bool ConfigureURLMappings(const std::string& mappings, bool ConfigureURLMappings(const std::string& mappings,
......
...@@ -222,7 +222,7 @@ void DynamicApplicationLoader::Load( ...@@ -222,7 +222,7 @@ void DynamicApplicationLoader::Load(
if (!network_service_) { if (!network_service_) {
context_->application_manager()->ConnectToService( context_->application_manager()->ConnectToService(
GURL("mojo:mojo_network_service"), &network_service_); GURL("mojo:network_service"), &network_service_);
} }
loaders_.push_back(new NetworkLoader(resolved_url, loaders_.push_back(new NetworkLoader(resolved_url,
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_util.h"
#include "net/base/filename_util.h" #include "net/base/filename_util.h"
#include "url/url_util.h" #include "url/url_util.h"
...@@ -15,7 +16,14 @@ namespace mojo { ...@@ -15,7 +16,14 @@ namespace mojo {
namespace shell { namespace shell {
namespace { namespace {
std::string MakeSharedLibraryName(const std::string& host_name) { std::string MakeSharedLibraryName(std::string host_name) {
// TODO(aa): This should go away soon. In the Chromium repo, all the app
// target names start with "mojo_" by convention. But when we have an SDK,
// one would assume the libraries would have names that don't have this bit.
std::string prefix = "mojo_";
if (!StartsWithASCII(host_name, prefix, true))
host_name = prefix + host_name;
#if defined(OS_WIN) #if defined(OS_WIN)
return host_name + ".dll"; return host_name + ".dll";
#elif defined(OS_LINUX) || defined(OS_ANDROID) #elif defined(OS_LINUX) || defined(OS_ANDROID)
......
...@@ -19,11 +19,16 @@ TEST_F(MojoURLResolverTest, MojoURLsFallThrough) { ...@@ -19,11 +19,16 @@ TEST_F(MojoURLResolverTest, MojoURLsFallThrough) {
resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo")); resolver.AddCustomMapping(GURL("mojo:test"), GURL("mojo:foo"));
const GURL base_url("file:/base"); const GURL base_url("file:/base");
resolver.SetBaseURL(base_url); resolver.SetBaseURL(base_url);
const std::string resolved(resolver.Resolve(GURL("mojo:test")).spec()); std::string resolved(resolver.Resolve(GURL("mojo:test")).spec());
// Resolved must start with |base_url|. // Resolved must start with |base_url|.
EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size())); EXPECT_EQ(base_url.spec(), resolved.substr(0, base_url.spec().size()));
// And must contain foo (which is what test mapped to. // And must contain mojo_foo (we got mapped to foo, and all libraries are
EXPECT_NE(std::string::npos, resolved.find("foo")); // prefixed with mojo_).
EXPECT_NE(std::string::npos, resolved.find("mojo_foo"));
// Make sure we don't double-mojo.
resolved = resolver.Resolve(GURL("mojo:mojo_test")).spec();
EXPECT_EQ(std::string::npos, resolved.find("mojo:mojo_mojo_foo"));
} }
} // namespace } // namespace
......
...@@ -52,13 +52,10 @@ class ShellTestBaseTest : public ShellTestBase { ...@@ -52,13 +52,10 @@ class ShellTestBaseTest : public ShellTestBase {
return base::Bind(&ShellTestBaseTest::SetAndQuitImpl<T>, return base::Bind(&ShellTestBaseTest::SetAndQuitImpl<T>,
base::Unretained(this), val); base::Unretained(this), val);
} }
static GURL test_app_url() { static GURL test_app_url() { return GURL("mojo:test_app"); }
return GURL("mojo:mojo_test_app");
}
void GetReport(std::vector<ServiceReport>* report) { void GetReport(std::vector<ServiceReport>* report) {
ConnectToService(GURL("mojo:mojo_test_request_tracker_app"), ConnectToService(GURL("mojo:test_request_tracker_app"), &request_tracking_);
&request_tracking_);
request_tracking_->GetReport(base::Bind(&GetReportCallback, request_tracking_->GetReport(base::Bind(&GetReportCallback,
base::Unretained(message_loop()), base::Unretained(message_loop()),
base::Unretained(report))); base::Unretained(report)));
...@@ -227,13 +224,13 @@ TEST_F(ShellTestBaseTest, ConnectDifferentServicesInDifferentApps) { ...@@ -227,13 +224,13 @@ TEST_F(ShellTestBaseTest, ConnectDifferentServicesInDifferentApps) {
int64 time_message; int64 time_message;
TestServicePtr service; TestServicePtr service;
ConnectToService(test_app_url(), &service); ConnectToService(test_app_url(), &service);
service->ConnectToAppAndGetTime("mojo:mojo_test_request_tracker_app", service->ConnectToAppAndGetTime("mojo:test_request_tracker_app",
SetAndQuit<int64>(&time_message)); SetAndQuit<int64>(&time_message));
message_loop()->Run(); message_loop()->Run();
// Verify by hitting the TimeService in the request tracker app directly. // Verify by hitting the TimeService in the request tracker app directly.
TestTimeServicePtr time_service; TestTimeServicePtr time_service;
ConnectToService(GURL("mojo:mojo_test_request_tracker_app"), &time_service); ConnectToService(GURL("mojo:test_request_tracker_app"), &time_service);
int64 party_time; int64 party_time;
time_service->GetPartyTime(SetAndQuit<int64>(&party_time)); time_service->GetPartyTime(SetAndQuit<int64>(&party_time));
message_loop()->Run(); message_loop()->Run();
...@@ -278,7 +275,7 @@ TEST_F(ShellTestBaseTest, ConnectManyClientsAndServices) { ...@@ -278,7 +275,7 @@ TEST_F(ShellTestBaseTest, ConnectManyClientsAndServices) {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
service->Ping(mojo::Callback<void()>()); service->Ping(mojo::Callback<void()>());
int64 time_result; int64 time_result;
service->ConnectToAppAndGetTime("mojo:mojo_test_request_tracker_app", service->ConnectToAppAndGetTime("mojo:test_request_tracker_app",
SetAndQuit<int64>(&time_result)); SetAndQuit<int64>(&time_result));
message_loop()->Run(); message_loop()->Run();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace switches { namespace switches {
// Specify configuration arguments for a Mojo application URL. For example: // Specify configuration arguments for a Mojo application URL. For example:
// --args-for='mojo://mojo_wget http://www.google.com' // --args-for='mojo://wget http://www.google.com'
const char kArgsFor[] = "args-for"; const char kArgsFor[] = "args-for";
// Used to specify the type of child process (switch values from // Used to specify the type of child process (switch values from
...@@ -15,7 +15,7 @@ const char kArgsFor[] = "args-for"; ...@@ -15,7 +15,7 @@ const char kArgsFor[] = "args-for";
const char kChildProcessType[] = "child-process-type"; const char kChildProcessType[] = "child-process-type";
// Comma separated list like: // Comma separated list like:
// text/html,mojo://mojo_html_viewer,application/bravo,https://abarth.com/bravo // text/html,mojo://html_viewer,application/bravo,https://abarth.com/bravo
const char kContentHandlers[] = "content-handlers"; const char kContentHandlers[] = "content-handlers";
// Force dynamically loaded apps / services to be loaded irrespective of cache // Force dynamically loaded apps / services to be loaded irrespective of cache
......
...@@ -15,7 +15,7 @@ Usage: $(basename "$0") [-d DIRECTORY] [-|--] <mojo_shell arguments ...> ...@@ -15,7 +15,7 @@ Usage: $(basename "$0") [-d DIRECTORY] [-|--] <mojo_shell arguments ...>
DIRECTORY defaults to $DIRECTORY. DIRECTORY defaults to $DIRECTORY.
Example: Example:
$(basename "$0") mojo:mojo_sample_app $(basename "$0") mojo:sample_app
EOF EOF
} }
......
...@@ -34,7 +34,7 @@ PackageManagerApplication::~PackageManagerApplication() { ...@@ -34,7 +34,7 @@ PackageManagerApplication::~PackageManagerApplication() {
} }
void PackageManagerApplication::Initialize(ApplicationImpl* app) { void PackageManagerApplication::Initialize(ApplicationImpl* app) {
app->ConnectToService("mojo:mojo_network_service", &network_service_); app->ConnectToService("mojo:network_service", &network_service_);
printf("Enter URL> "); printf("Enter URL> ");
char buf[1024]; char buf[1024];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment