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