diff options
Diffstat (limited to 'mojo/shell')
63 files changed, 284 insertions, 240 deletions
diff --git a/mojo/shell/application_instance.cc b/mojo/shell/application_instance.cc index 40b97ee..7d9abdf 100644 --- a/mojo/shell/application_instance.cc +++ b/mojo/shell/application_instance.cc @@ -20,7 +20,7 @@ namespace mojo { namespace shell { ApplicationInstance::ApplicationInstance( - ApplicationPtr application, + mojom::ApplicationPtr application, ApplicationManager* manager, const Identity& identity, uint32_t requesting_content_handler_id, @@ -79,7 +79,7 @@ void ApplicationInstance::ConnectToApplication( URLRequestPtr app_request, InterfaceRequest<ServiceProvider> services, ServiceProviderPtr exposed_services, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, const ConnectToApplicationCallback& callback) { std::string url_string = app_request->url.To<std::string>(); GURL url(url_string); diff --git a/mojo/shell/application_instance.h b/mojo/shell/application_instance.h index 5764478..cae1442 100644 --- a/mojo/shell/application_instance.h +++ b/mojo/shell/application_instance.h @@ -30,13 +30,13 @@ class NativeRunner; // Encapsulates a connection to an instance of an application, tracked by the // shell's ApplicationManager. -class ApplicationInstance : public Shell, +class ApplicationInstance : public mojom::Shell, public mojom::PIDReceiver { public: // |requesting_content_handler_id| is the id of the content handler that // loaded this app. If the app was not loaded by a content handler the id // is kInvalidContentHandlerID. - ApplicationInstance(ApplicationPtr application, + ApplicationInstance(mojom::ApplicationPtr application, ApplicationManager* manager, const Identity& identity, uint32_t requesting_content_handler_id, @@ -53,7 +53,7 @@ class ApplicationInstance : public Shell, void BindPIDReceiver(InterfaceRequest<mojom::PIDReceiver> pid_receiver); - Application* application() { return application_.get(); } + mojom::Application* application() { return application_.get(); } const Identity& identity() const { return identity_; } uint32_t id() const { return id_; } base::ProcessId pid() const { return pid_; } @@ -72,7 +72,7 @@ class ApplicationInstance : public Shell, URLRequestPtr app_request, InterfaceRequest<ServiceProvider> services, ServiceProviderPtr exposed_services, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, const ConnectToApplicationCallback& callback) override; void QuitApplication() override; @@ -98,8 +98,8 @@ class ApplicationInstance : public Shell, const bool allow_any_application_; uint32_t requesting_content_handler_id_; base::Closure on_application_end_; - ApplicationPtr application_; - Binding<Shell> binding_; + mojom::ApplicationPtr application_; + Binding<mojom::Shell> binding_; Binding<mojom::PIDReceiver> pid_receiver_binding_; bool queue_requests_; std::vector<ConnectToApplicationParams*> queued_client_requests_; diff --git a/mojo/shell/application_loader.h b/mojo/shell/application_loader.h index add330c..21e7911 100644 --- a/mojo/shell/application_loader.h +++ b/mojo/shell/application_loader.h @@ -8,6 +8,7 @@ #include "base/callback.h" #include "mojo/public/cpp/system/core.h" #include "mojo/services/network/public/interfaces/url_loader.mojom.h" +#include "mojo/shell/public/interfaces/application.mojom.h" #include "mojo/shell/public/interfaces/shell.mojom.h" #include "url/gurl.h" @@ -25,8 +26,9 @@ class ApplicationLoader { public: virtual ~ApplicationLoader() {} - virtual void Load(const GURL& url, - InterfaceRequest<Application> application_request) = 0; + virtual void Load( + const GURL& url, + InterfaceRequest<mojom::Application> application_request) = 0; protected: ApplicationLoader() {} diff --git a/mojo/shell/application_manager.cc b/mojo/shell/application_manager.cc index 87a8706..2e6a1f2 100644 --- a/mojo/shell/application_manager.cc +++ b/mojo/shell/application_manager.cc @@ -129,7 +129,7 @@ ApplicationInstance* ApplicationManager::GetApplicationInstance( void ApplicationManager::CreateInstanceForHandle( ScopedHandle channel, const GURL& url, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, InterfaceRequest<mojom::PIDReceiver> pid_receiver) { // Instances created by others are considered unique, and thus have no // identity. As such they cannot be connected to by anyone else, and so we @@ -140,7 +140,7 @@ void ApplicationManager::CreateInstanceForHandle( CapabilityFilter local_filter = filter->filter.To<CapabilityFilter>(); Identity target_id(url, std::string(), local_filter); ApplicationInstance* instance = nullptr; - InterfaceRequest<Application> application_request = + InterfaceRequest<mojom::Application> application_request = CreateInstance(target_id, base::Closure(), &instance); instance->BindPIDReceiver(std::move(pid_receiver)); scoped_ptr<NativeRunner> runner = @@ -175,11 +175,12 @@ void ApplicationManager::ApplicationPIDAvailable( }); } -InterfaceRequest<Application> ApplicationManager::CreateAndConnectToInstance( - scoped_ptr<ConnectToApplicationParams> params, - ApplicationInstance** resulting_instance) { +InterfaceRequest<mojom::Application> + ApplicationManager::CreateAndConnectToInstance( + scoped_ptr<ConnectToApplicationParams> params, + ApplicationInstance** resulting_instance) { ApplicationInstance* instance = nullptr; - InterfaceRequest<Application> application_request = + InterfaceRequest<mojom::Application> application_request = CreateInstance(params->target(), params->on_application_end(), &instance); instance->ConnectToClient(std::move(params)); if (resulting_instance) @@ -187,15 +188,16 @@ InterfaceRequest<Application> ApplicationManager::CreateAndConnectToInstance( return application_request; } -InterfaceRequest<Application> ApplicationManager::CreateInstance( +InterfaceRequest<mojom::Application> ApplicationManager::CreateInstance( const Identity& target_id, const base::Closure& on_application_end, ApplicationInstance** resulting_instance) { - ApplicationPtr application; - InterfaceRequest<Application> application_request = GetProxy(&application); + mojom::ApplicationPtr application; + InterfaceRequest<mojom::Application> application_request = + GetProxy(&application); ApplicationInstance* instance = new ApplicationInstance( - std::move(application), this, target_id, Shell::kInvalidApplicationID, - on_application_end); + std::move(application), this, target_id, + mojom::Shell::kInvalidApplicationID, on_application_end); DCHECK(identity_to_instance_.find(target_id) == identity_to_instance_.end()); identity_to_instance_[target_id] = instance; @@ -216,8 +218,8 @@ void ApplicationManager::HandleFetchCallback( scoped_ptr<Fetcher> fetcher) { if (!fetcher) { // Network error. Drop |params| to tell the requestor. - params->connect_callback().Run(Shell::kInvalidApplicationID, - Shell::kInvalidApplicationID); + params->connect_callback().Run(mojom::Shell::kInvalidApplicationID, + mojom::Shell::kInvalidApplicationID); return; } @@ -244,16 +246,16 @@ void ApplicationManager::HandleFetchCallback( Identity source = params->source(); Identity target = params->target(); - Shell::ConnectToApplicationCallback connect_callback = + mojom::Shell::ConnectToApplicationCallback connect_callback = params->connect_callback(); params->set_connect_callback(EmptyConnectCallback()); ApplicationInstance* app = nullptr; - InterfaceRequest<Application> request( + InterfaceRequest<mojom::Application> request( CreateAndConnectToInstance(std::move(params), &app)); uint32_t content_handler_id = package_manager_->HandleWithContentHandler( fetcher.get(), source, target.url(), target.filter(), &request); - if (content_handler_id != Shell::kInvalidApplicationID) { + if (content_handler_id != mojom::Shell::kInvalidApplicationID) { app->set_requesting_content_handler_id(content_handler_id); connect_callback.Run(app->id(), content_handler_id); return; @@ -269,7 +271,7 @@ void ApplicationManager::HandleFetchCallback( target.url() == GURL("mojo://html_viewer/"); } - connect_callback.Run(app->id(), Shell::kInvalidApplicationID); + connect_callback.Run(app->id(), mojom::Shell::kInvalidApplicationID); fetcher->AsPath( task_runner_, @@ -280,7 +282,7 @@ void ApplicationManager::HandleFetchCallback( } void ApplicationManager::RunNativeApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, bool start_sandboxed, scoped_ptr<Fetcher> fetcher, ApplicationInstance* instance, @@ -367,7 +369,7 @@ void ApplicationManager::CleanupRunner(NativeRunner* runner) { } } -Shell::ConnectToApplicationCallback EmptyConnectCallback() { +mojom::Shell::ConnectToApplicationCallback EmptyConnectCallback() { return base::Bind(&OnEmptyOnConnectCallback); } diff --git a/mojo/shell/application_manager.h b/mojo/shell/application_manager.h index 88ad7e1..f20a9ae 100644 --- a/mojo/shell/application_manager.h +++ b/mojo/shell/application_manager.h @@ -98,7 +98,7 @@ class ApplicationManager { void CreateInstanceForHandle( ScopedHandle channel, const GURL& url, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, InterfaceRequest<mojom::PIDReceiver> pid_receiver); void AddListener(mojom::ApplicationManagerListenerPtr listener); void GetRunningApplications( @@ -114,10 +114,10 @@ class ApplicationManager { bool ConnectToRunningApplication( scoped_ptr<ConnectToApplicationParams>* params); - InterfaceRequest<Application> CreateAndConnectToInstance( + InterfaceRequest<mojom::Application> CreateAndConnectToInstance( scoped_ptr<ConnectToApplicationParams> params, ApplicationInstance** instance); - InterfaceRequest<Application> CreateInstance( + InterfaceRequest<mojom::Application> CreateInstance( const Identity& target_id, const base::Closure& on_application_end, ApplicationInstance** resulting_instance); @@ -128,12 +128,13 @@ class ApplicationManager { void HandleFetchCallback(scoped_ptr<ConnectToApplicationParams> params, scoped_ptr<Fetcher> fetcher); - void RunNativeApplication(InterfaceRequest<Application> application_request, - bool start_sandboxed, - scoped_ptr<Fetcher> fetcher, - ApplicationInstance* instance, - const base::FilePath& file_path, - bool path_exists); + void RunNativeApplication( + InterfaceRequest<mojom::Application> application_request, + bool start_sandboxed, + scoped_ptr<Fetcher> fetcher, + ApplicationInstance* instance, + const base::FilePath& file_path, + bool path_exists); // Returns the appropriate loader for |url|, or the default loader if there is // no loader configured for the URL. @@ -162,7 +163,7 @@ class ApplicationManager { DISALLOW_COPY_AND_ASSIGN(ApplicationManager); }; -Shell::ConnectToApplicationCallback EmptyConnectCallback(); +mojom::Shell::ConnectToApplicationCallback EmptyConnectCallback(); } // namespace shell } // namespace mojo diff --git a/mojo/shell/application_manager_apptest.cc b/mojo/shell/application_manager_apptest.cc index aedc225..e0abdd5 100644 --- a/mojo/shell/application_manager_apptest.cc +++ b/mojo/shell/application_manager_apptest.cc @@ -31,7 +31,7 @@ class ApplicationManagerAppTestDelegate public CreateInstanceForHandleTest { public: ApplicationManagerAppTestDelegate() - : target_id_(Shell::kInvalidApplicationID), + : target_id_(mojom::Shell::kInvalidApplicationID), binding_(this) {} ~ApplicationManagerAppTestDelegate() override {} @@ -183,9 +183,9 @@ TEST_F(ApplicationManagerAppTest, CreateInstanceForHandle) { // mojo:application_manager_apptests) base::MessageLoop::current()->Run(); - uint32_t remote_id = Shell::kInvalidApplicationID; + uint32_t remote_id = mojom::Shell::kInvalidApplicationID; EXPECT_TRUE(connection->GetRemoteApplicationID(&remote_id)); - EXPECT_NE(Shell::kInvalidApplicationID, remote_id); + EXPECT_NE(mojom::Shell::kInvalidApplicationID, remote_id); // 3. Validate that this test suite's pretty name was consumed from its // manifest. diff --git a/mojo/shell/application_manager_apptest_driver.cc b/mojo/shell/application_manager_apptest_driver.cc index 26d79b3..33ca80a 100644 --- a/mojo/shell/application_manager_apptest_driver.cc +++ b/mojo/shell/application_manager_apptest_driver.cc @@ -141,7 +141,8 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate, void OnMessagePipeCreatedOnMainThread( mojo::InterfaceRequest<mojo::shell::mojom::PIDReceiver> request, mojo::ScopedMessagePipeHandle pipe) { - mojo::CapabilityFilterPtr filter(mojo::CapabilityFilter::New()); + mojo::shell::mojom::CapabilityFilterPtr filter( + mojo::shell::mojom::CapabilityFilter::New()); mojo::Array<mojo::String> test_interfaces; test_interfaces.push_back( mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_); diff --git a/mojo/shell/application_manager_unittest.cc b/mojo/shell/application_manager_unittest.cc index cc52d65..94b92c6 100644 --- a/mojo/shell/application_manager_unittest.cc +++ b/mojo/shell/application_manager_unittest.cc @@ -114,7 +114,7 @@ class TestApplicationLoader : public ApplicationLoader, private: // ApplicationLoader implementation. void Load(const GURL& url, - InterfaceRequest<Application> application_request) override { + InterfaceRequest<mojom::Application> application_request) override { ++num_loads_; test_app_.reset(new ApplicationImpl(this, std::move(application_request))); } @@ -144,7 +144,8 @@ class ClosingApplicationLoader : public ApplicationLoader { private: // ApplicationLoader implementation. void Load(const GURL& url, - InterfaceRequest<Application> application_request) override {} + InterfaceRequest<mojom::Application> application_request) override { + } }; class TesterContext { @@ -345,7 +346,7 @@ class Tester : public ApplicationDelegate, private: void Load(const GURL& url, - InterfaceRequest<Application> application_request) override { + InterfaceRequest<mojom::Application> application_request) override { app_.reset(new ApplicationImpl(this, std::move(application_request))); } diff --git a/mojo/shell/application_package_apptest.cc b/mojo/shell/application_package_apptest.cc index 657853c..893c7ec 100644 --- a/mojo/shell/application_package_apptest.cc +++ b/mojo/shell/application_package_apptest.cc @@ -37,7 +37,7 @@ class ProvidedApplicationDelegate public base::SimpleThread { public: ProvidedApplicationDelegate(const std::string& name, - InterfaceRequest<Application> request, + InterfaceRequest<mojom::Application> request, const Callback<void()>& destruct_callback) : base::SimpleThread(name), name_(name), @@ -79,7 +79,7 @@ class ProvidedApplicationDelegate } const std::string name_; - InterfaceRequest<Application> request_; + InterfaceRequest<mojom::Application> request_; const Callback<void()> destruct_callback_; WeakBindingSet<test::mojom::ApplicationPackageApptestService> bindings_; @@ -88,9 +88,9 @@ class ProvidedApplicationDelegate class ApplicationPackageApptestDelegate : public ApplicationDelegate, - public InterfaceFactory<ContentHandler>, + public InterfaceFactory<mojom::ContentHandler>, public InterfaceFactory<test::mojom::ApplicationPackageApptestService>, - public ContentHandler, + public mojom::ContentHandler, public test::mojom::ApplicationPackageApptestService { public: ApplicationPackageApptestDelegate() {} @@ -105,9 +105,9 @@ class ApplicationPackageApptestDelegate return true; } - // InterfaceFactory<ContentHandler>: + // InterfaceFactory<mojom::ContentHandler>: void Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) override { + InterfaceRequest<mojom::ContentHandler> request) override { content_handler_bindings_.AddBinding(this, std::move(request)); } @@ -118,8 +118,8 @@ class ApplicationPackageApptestDelegate bindings_.AddBinding(this, std::move(request)); } - // ContentHandler: - void StartApplication(InterfaceRequest<Application> request, + // mojom::ContentHandler: + void StartApplication(InterfaceRequest<mojom::Application> request, URLResponsePtr response, const Callback<void()>& destruct_callback) override { const std::string url = response->url; @@ -138,7 +138,7 @@ class ApplicationPackageApptestDelegate } std::vector<scoped_ptr<ApplicationDelegate>> delegates_; - WeakBindingSet<ContentHandler> content_handler_bindings_; + WeakBindingSet<mojom::ContentHandler> content_handler_bindings_; WeakBindingSet<test::mojom::ApplicationPackageApptestService> bindings_; DISALLOW_COPY_AND_ASSIGN(ApplicationPackageApptestDelegate); diff --git a/mojo/shell/capability_filter_test.cc b/mojo/shell/capability_filter_test.cc index 8f294dd..a5a8bb0 100644 --- a/mojo/shell/capability_filter_test.cc +++ b/mojo/shell/capability_filter_test.cc @@ -51,7 +51,8 @@ class ConnectionValidator : public ApplicationLoader, private: // Overridden from ApplicationLoader: - void Load(const GURL& url, InterfaceRequest<Application> request) override { + void Load(const GURL& url, + InterfaceRequest<mojom::Application> request) override { app_.reset(new ApplicationImpl(this, std::move(request))); } @@ -194,7 +195,7 @@ TestLoader::TestLoader(ApplicationDelegate* delegate) : delegate_(delegate) {} TestLoader::~TestLoader() {} void TestLoader::Load(const GURL& url, - InterfaceRequest<Application> request) { + InterfaceRequest<mojom::Application> request) { app_.reset(new ApplicationImpl(delegate_.get(), std::move(request))); } diff --git a/mojo/shell/capability_filter_test.h b/mojo/shell/capability_filter_test.h index 9bef66a..394c842 100644 --- a/mojo/shell/capability_filter_test.h +++ b/mojo/shell/capability_filter_test.h @@ -48,7 +48,8 @@ class TestLoader : public ApplicationLoader { private: // Overridden from ApplicationLoader: - void Load(const GURL& url, InterfaceRequest<Application> request) override; + void Load(const GURL& url, + InterfaceRequest<mojom::Application> request) override; scoped_ptr<ApplicationDelegate> delegate_; scoped_ptr<ApplicationImpl> app_; diff --git a/mojo/shell/connect_to_application_params.h b/mojo/shell/connect_to_application_params.h index c911552..66a0b1f 100644 --- a/mojo/shell/connect_to_application_params.h +++ b/mojo/shell/connect_to_application_params.h @@ -71,10 +71,12 @@ class ConnectToApplicationParams { return on_application_end_; } - void set_connect_callback(const Shell::ConnectToApplicationCallback& value) { + void set_connect_callback( + const shell::mojom::Shell::ConnectToApplicationCallback& value) { connect_callback_ = value; } - const Shell::ConnectToApplicationCallback& connect_callback() const { + const shell::mojom::Shell::ConnectToApplicationCallback& + connect_callback() const { return connect_callback_; } @@ -92,7 +94,7 @@ class ConnectToApplicationParams { InterfaceRequest<ServiceProvider> services_; ServiceProviderPtr exposed_services_; base::Closure on_application_end_; - Shell::ConnectToApplicationCallback connect_callback_; + shell::mojom::Shell::ConnectToApplicationCallback connect_callback_; DISALLOW_COPY_AND_ASSIGN(ConnectToApplicationParams); }; diff --git a/mojo/shell/fetcher/about_fetcher_unittest.cc b/mojo/shell/fetcher/about_fetcher_unittest.cc index 6eed303..84878e9 100644 --- a/mojo/shell/fetcher/about_fetcher_unittest.cc +++ b/mojo/shell/fetcher/about_fetcher_unittest.cc @@ -31,8 +31,8 @@ namespace shell { namespace { class TestContentHandler : public ApplicationDelegate, - public InterfaceFactory<ContentHandler>, - public ContentHandler { + public InterfaceFactory<mojom::ContentHandler>, + public mojom::ContentHandler { public: TestContentHandler() : response_number_(0) {} ~TestContentHandler() override {} @@ -44,19 +44,19 @@ class TestContentHandler : public ApplicationDelegate, // Overridden from ApplicationDelegate: void Initialize(ApplicationImpl* app) override {} bool AcceptConnection(ApplicationConnection* connection) override { - connection->AddService<ContentHandler>(this); + connection->AddService<mojom::ContentHandler>(this); return true; } - // Overridden from InterfaceFactory<ContentHandler>: + // Overridden from InterfaceFactory<mojom::ContentHandler>: void Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) override { + InterfaceRequest<mojom::ContentHandler> request) override { bindings_.AddBinding(this, std::move(request)); } - // Overridden from ContentHandler: + // Overridden from mojom::ContentHandler: void StartApplication( - InterfaceRequest<Application> application, + InterfaceRequest<mojom::Application> application, URLResponsePtr response, const Callback<void()>& destruct_callback) override { response_number_++; @@ -72,7 +72,7 @@ class TestContentHandler : public ApplicationDelegate, size_t response_number_; URLResponsePtr latest_response_; - WeakBindingSet<ContentHandler> bindings_; + WeakBindingSet<mojom::ContentHandler> bindings_; DISALLOW_COPY_AND_ASSIGN(TestContentHandler); }; @@ -84,7 +84,8 @@ class TestLoader : public ApplicationLoader { private: // Overridden from ApplicationLoader: - void Load(const GURL& url, InterfaceRequest<Application> request) override { + void Load(const GURL& url, + InterfaceRequest<mojom::Application> request) override { app_.reset(new ApplicationImpl(delegate_, std::move(request))); } diff --git a/mojo/shell/native_runner.h b/mojo/shell/native_runner.h index 68b8279..ea99a75 100644 --- a/mojo/shell/native_runner.h +++ b/mojo/shell/native_runner.h @@ -33,14 +33,15 @@ class NativeRunner { virtual void Start( const base::FilePath& app_path, bool start_sandboxed, - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, const base::Closure& app_completed_callback) = 0; // Like Start(), but used to initialize the host for a child process started // by someone else. Provides |application_request| via |channel|. - virtual void InitHost(ScopedHandle channel, - InterfaceRequest<Application> application_request) = 0; + virtual void InitHost( + ScopedHandle channel, + InterfaceRequest<mojom::Application> application_request) = 0; }; class NativeRunnerFactory { diff --git a/mojo/shell/package_manager.h b/mojo/shell/package_manager.h index 922c56f..1ffae75 100644 --- a/mojo/shell/package_manager.h +++ b/mojo/shell/package_manager.h @@ -52,7 +52,7 @@ class PackageManager { const Identity& source, const GURL& target_url, const CapabilityFilter& target_filter, - InterfaceRequest<Application>* application_request) = 0; + InterfaceRequest<shell::mojom::Application>* application_request) = 0; // Returns true if a manifest for |url| exists within the PackageManager's // application catalog. diff --git a/mojo/shell/package_manager/capability_filter_content_handler_unittest.cc b/mojo/shell/package_manager/capability_filter_content_handler_unittest.cc index 96bf798..2268a7e 100644 --- a/mojo/shell/package_manager/capability_filter_content_handler_unittest.cc +++ b/mojo/shell/package_manager/capability_filter_content_handler_unittest.cc @@ -78,8 +78,8 @@ class TestPackageManager : public PackageManagerImpl { }; class TestContentHandler : public ApplicationDelegate, - public InterfaceFactory<ContentHandler>, - public ContentHandler { + public InterfaceFactory<mojom::ContentHandler>, + public mojom::ContentHandler { public: TestContentHandler() : app_(nullptr) {} ~TestContentHandler() override {} @@ -90,19 +90,19 @@ class TestContentHandler : public ApplicationDelegate, app_ = app; } bool AcceptConnection(ApplicationConnection* connection) override { - connection->AddService<ContentHandler>(this); + connection->AddService<mojom::ContentHandler>(this); return true; } - // Overridden from InterfaceFactory<ContentHandler>: + // Overridden from InterfaceFactory<mojom::ContentHandler>: void Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) override { + InterfaceRequest<mojom::ContentHandler> request) override { bindings_.AddBinding(this, std::move(request)); } - // Overridden from ContentHandler: + // Overridden from mojom::ContentHandler: void StartApplication( - InterfaceRequest<Application> application, + InterfaceRequest<mojom::Application> application, URLResponsePtr response, const Callback<void()>& destruct_callback) override { scoped_ptr<ApplicationDelegate> delegate(new test::TestApplication); @@ -113,7 +113,7 @@ class TestContentHandler : public ApplicationDelegate, } ApplicationImpl* app_; - WeakBindingSet<ContentHandler> bindings_; + WeakBindingSet<mojom::ContentHandler> bindings_; ScopedVector<ApplicationDelegate> embedded_app_delegates_; ScopedVector<ApplicationImpl> embedded_apps_; diff --git a/mojo/shell/package_manager/content_handler_connection.cc b/mojo/shell/package_manager/content_handler_connection.cc index 433245a..7271fb8 100644 --- a/mojo/shell/package_manager/content_handler_connection.cc +++ b/mojo/shell/package_manager/content_handler_connection.cc @@ -38,14 +38,15 @@ ContentHandlerConnection::ContentHandlerConnection( MessagePipe pipe; content_handler_.Bind( - InterfacePtrInfo<ContentHandler>(std::move(pipe.handle0), 0u)); - services->ConnectToService(ContentHandler::Name_, std::move(pipe.handle1)); + InterfacePtrInfo<mojom::ContentHandler>(std::move(pipe.handle0), 0u)); + services->ConnectToService(mojom::ContentHandler::Name_, + std::move(pipe.handle1)); content_handler_.set_connection_error_handler( [this]() { CloseConnection(); }); } void ContentHandlerConnection::StartApplication( - InterfaceRequest<Application> request, + InterfaceRequest<mojom::Application> request, URLResponsePtr response) { content_handler_->StartApplication( std::move(request), std::move(response), diff --git a/mojo/shell/package_manager/content_handler_connection.h b/mojo/shell/package_manager/content_handler_connection.h index 3b94d78..c1c4551 100644 --- a/mojo/shell/package_manager/content_handler_connection.h +++ b/mojo/shell/package_manager/content_handler_connection.h @@ -35,7 +35,7 @@ class ContentHandlerConnection { uint32_t id, const ClosedCallback& connection_closed_callback); - void StartApplication(InterfaceRequest<Application> request, + void StartApplication(InterfaceRequest<mojom::Application> request, URLResponsePtr response); // Closes the connection and destroys |this| object. @@ -52,7 +52,7 @@ class ContentHandlerConnection { ClosedCallback connection_closed_callback_; Identity identity_; - ContentHandlerPtr content_handler_; + mojom::ContentHandlerPtr content_handler_; bool connection_closed_; // The id for this content handler. const uint32_t id_; diff --git a/mojo/shell/package_manager/content_handler_unittest.cc b/mojo/shell/package_manager/content_handler_unittest.cc index 06f4223..95870f3 100644 --- a/mojo/shell/package_manager/content_handler_unittest.cc +++ b/mojo/shell/package_manager/content_handler_unittest.cc @@ -72,15 +72,16 @@ void QuitClosure(bool* value) { base::MessageLoop::current()->QuitWhenIdle(); } -class TestContentHandler : public ContentHandler, public ApplicationDelegate { +class TestContentHandler : public mojom::ContentHandler, + public ApplicationDelegate { public: TestContentHandler(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) + InterfaceRequest<mojom::ContentHandler> request) : binding_(this, std::move(request)) {} // ContentHandler: void StartApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, URLResponsePtr response, const Callback<void()>& destruct_callback) override { apps_.push_back(new ApplicationImpl(this, std::move(application_request))); @@ -88,7 +89,7 @@ class TestContentHandler : public ContentHandler, public ApplicationDelegate { } private: - StrongBinding<ContentHandler> binding_; + StrongBinding<mojom::ContentHandler> binding_; ScopedVector<ApplicationImpl> apps_; DISALLOW_COPY_AND_ASSIGN(TestContentHandler); @@ -96,7 +97,7 @@ class TestContentHandler : public ContentHandler, public ApplicationDelegate { class TestApplicationLoader : public ApplicationLoader, public ApplicationDelegate, - public InterfaceFactory<ContentHandler> { + public InterfaceFactory<mojom::ContentHandler> { public: TestApplicationLoader() : num_loads_(0) {} ~TestApplicationLoader() override {} @@ -107,20 +108,20 @@ class TestApplicationLoader : public ApplicationLoader, private: // ApplicationLoader implementation. void Load(const GURL& url, - InterfaceRequest<Application> application_request) override { + InterfaceRequest<mojom::Application> application_request) override { ++num_loads_; test_app_.reset(new ApplicationImpl(this, std::move(application_request))); } // ApplicationDelegate implementation. bool AcceptConnection(ApplicationConnection* connection) override { - connection->AddService<ContentHandler>(this); + connection->AddService<mojom::ContentHandler>(this); last_requestor_url_ = GURL(connection->GetRemoteApplicationURL()); return true; } - // InterfaceFactory<ContentHandler> implementation. + // InterfaceFactory<mojom::ContentHandler> implementation. void Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) override { + InterfaceRequest<mojom::ContentHandler> request) override { new TestContentHandler(connection, std::move(request)); } @@ -232,7 +233,7 @@ TEST_F(ContentHandlerTest, }); application_manager_->ConnectToApplication(std::move(params)); run_loop.Run(); - EXPECT_NE(Shell::kInvalidApplicationID, content_handler_id); + EXPECT_NE(mojom::Shell::kInvalidApplicationID, content_handler_id); } uint32_t content_handler_id2; @@ -249,7 +250,7 @@ TEST_F(ContentHandlerTest, }); application_manager_->ConnectToApplication(std::move(params)); run_loop.Run(); - EXPECT_NE(Shell::kInvalidApplicationID, content_handler_id2); + EXPECT_NE(mojom::Shell::kInvalidApplicationID, content_handler_id2); } EXPECT_EQ(content_handler_id, content_handler_id2); } @@ -274,7 +275,7 @@ TEST_F(ContentHandlerTest, DifferedContentHandlersGetDifferentIDs) { }); application_manager_->ConnectToApplication(std::move(params)); run_loop.Run(); - EXPECT_NE(Shell::kInvalidApplicationID, content_handler_id); + EXPECT_NE(mojom::Shell::kInvalidApplicationID, content_handler_id); } const std::string mime_type2 = "test/mime-type2"; @@ -302,7 +303,7 @@ TEST_F(ContentHandlerTest, DifferedContentHandlersGetDifferentIDs) { }); application_manager_->ConnectToApplication(std::move(params)); run_loop.Run(); - EXPECT_NE(Shell::kInvalidApplicationID, content_handler_id2); + EXPECT_NE(mojom::Shell::kInvalidApplicationID, content_handler_id2); } EXPECT_NE(content_handler_id, content_handler_id2); } diff --git a/mojo/shell/package_manager/package_manager_impl.cc b/mojo/shell/package_manager/package_manager_impl.cc index 3133a40..6985381 100644 --- a/mojo/shell/package_manager/package_manager_impl.cc +++ b/mojo/shell/package_manager/package_manager_impl.cc @@ -181,7 +181,7 @@ uint32_t PackageManagerImpl::HandleWithContentHandler( const Identity& source, const GURL& target_url, const CapabilityFilter& target_filter, - InterfaceRequest<Application>* application_request) { + InterfaceRequest<mojom::Application>* application_request) { Identity content_handler_identity; URLResponsePtr response; if (ShouldHandleWithContentHandler(fetcher, @@ -195,7 +195,7 @@ uint32_t PackageManagerImpl::HandleWithContentHandler( std::move(response)); return connection->id(); } - return Shell::kInvalidApplicationID; + return mojom::Shell::kInvalidApplicationID; } bool PackageManagerImpl::IsURLInCatalog(const std::string& url) const { diff --git a/mojo/shell/package_manager/package_manager_impl.h b/mojo/shell/package_manager/package_manager_impl.h index dc047df..fdef369 100644 --- a/mojo/shell/package_manager/package_manager_impl.h +++ b/mojo/shell/package_manager/package_manager_impl.h @@ -98,7 +98,7 @@ class PackageManagerImpl : public PackageManager { const Identity& source, const GURL& target_url, const CapabilityFilter& target_filter, - InterfaceRequest<Application>* application_request) override; + InterfaceRequest<mojom::Application>* application_request) override; bool IsURLInCatalog(const std::string& url) const override; std::string GetApplicationName(const std::string& url) const override; diff --git a/mojo/shell/public/cpp/application_impl.h b/mojo/shell/public/cpp/application_impl.h index 662cfda..8cbda21 100644 --- a/mojo/shell/public/cpp/application_impl.h +++ b/mojo/shell/public/cpp/application_impl.h @@ -23,7 +23,9 @@ namespace mojo { -CapabilityFilterPtr CreatePermissiveCapabilityFilter(); +shell::mojom::CapabilityFilterPtr CreatePermissiveCapabilityFilter(); + +using ApplicationRequest = InterfaceRequest<shell::mojom::Application>; // TODO(beng): This comment is hilariously out of date. // Utility class for communicating with the Shell, and providing Services @@ -59,7 +61,7 @@ CapabilityFilterPtr CreatePermissiveCapabilityFilter(); // app.AddService<BarImpl>(&context); // // -class ApplicationImpl : public Application { +class ApplicationImpl : public shell::mojom::Application { public: class ConnectParams { public: @@ -68,12 +70,16 @@ class ApplicationImpl : public Application { ~ConnectParams(); URLRequestPtr TakeRequest() { return std::move(request_); } - CapabilityFilterPtr TakeFilter() { return std::move(filter_); } - void set_filter(CapabilityFilterPtr filter) { filter_ = std::move(filter); } + shell::mojom::CapabilityFilterPtr TakeFilter() { + return std::move(filter_); + } + void set_filter(shell::mojom::CapabilityFilterPtr filter) { + filter_ = std::move(filter); + } private: URLRequestPtr request_; - CapabilityFilterPtr filter_; + shell::mojom::CapabilityFilterPtr filter_; DISALLOW_COPY_AND_ASSIGN(ConnectParams); }; @@ -83,8 +89,9 @@ class ApplicationImpl : public Application { explicit TestApi(ApplicationImpl* application) : application_(application) {} - void UnbindConnections(InterfaceRequest<Application>* application_request, - ShellPtr* shell) { + void UnbindConnections( + InterfaceRequest<shell::mojom::Application>* application_request, + shell::mojom::ShellPtr* shell) { application_->UnbindConnections(application_request, shell); } @@ -95,19 +102,19 @@ class ApplicationImpl : public Application { // Does not take ownership of |delegate|, which must remain valid for the // lifetime of ApplicationImpl. ApplicationImpl(ApplicationDelegate* delegate, - InterfaceRequest<Application> request); + InterfaceRequest<shell::mojom::Application> request); // Constructs an ApplicationImpl with a custom termination closure. This // closure is invoked on Quit() instead of the default behavior of quitting // the current base::MessageLoop. ApplicationImpl(ApplicationDelegate* delegate, - InterfaceRequest<Application> request, + InterfaceRequest<shell::mojom::Application> request, const Closure& termination_closure); ~ApplicationImpl() override; // The Mojo shell. This will return a valid pointer after Initialize() has // been invoked. It will remain valid until UnbindConnections() is invoked or // the ApplicationImpl is destroyed. - Shell* shell() const { return shell_.get(); } + shell::mojom::Shell* shell() const { return shell_.get(); } const std::string& url() const { return url_; } uint32_t id() const { return id_; } @@ -146,8 +153,8 @@ class ApplicationImpl : public Application { void Quit(); private: - // Application implementation. - void Initialize(ShellPtr shell, + // shell::mojom::Application implementation. + void Initialize(shell::mojom::ShellPtr shell, const mojo::String& url, uint32_t id) override; void AcceptConnection(const String& requestor_url, @@ -167,15 +174,16 @@ class ApplicationImpl : public Application { // Unbinds the Shell and Application connections. Can be used to re-bind the // handles to another implementation of ApplicationImpl, for instance when // running apptests. - void UnbindConnections(InterfaceRequest<Application>* application_request, - ShellPtr* shell); + void UnbindConnections( + InterfaceRequest<shell::mojom::Application>* application_request, + shell::mojom::ShellPtr* shell); // We track the lifetime of incoming connection registries as it more // convenient for the client. ScopedVector<ApplicationConnection> incoming_connections_; ApplicationDelegate* delegate_; - Binding<Application> binding_; - ShellPtr shell_; + Binding<shell::mojom::Application> binding_; + shell::mojom::ShellPtr shell_; std::string url_; uint32_t id_; Closure termination_closure_; diff --git a/mojo/shell/public/cpp/content_handler_factory.h b/mojo/shell/public/cpp/content_handler_factory.h index 4bcb81e..a8aa8c3 100644 --- a/mojo/shell/public/cpp/content_handler_factory.h +++ b/mojo/shell/public/cpp/content_handler_factory.h @@ -14,7 +14,8 @@ namespace mojo { -class ContentHandlerFactory : public InterfaceFactory<ContentHandler> { +class ContentHandlerFactory + : public InterfaceFactory<shell::mojom::ContentHandler> { public: class HandledApplicationHolder { public: @@ -27,7 +28,7 @@ class ContentHandlerFactory : public InterfaceFactory<ContentHandler> { // Implement this method to create the Application. This method will be // called on a new thread. Leaving this method will quit the application. virtual void RunApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<shell::mojom::Application> application_request, URLResponsePtr response) = 0; }; @@ -39,12 +40,13 @@ class ContentHandlerFactory : public InterfaceFactory<ContentHandler> { // on this new thread, and the returned value will be kept alive until the // application ends. virtual scoped_ptr<HandledApplicationHolder> CreateApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<shell::mojom::Application> application_request, URLResponsePtr response) = 0; private: - void RunApplication(InterfaceRequest<Application> application_request, - URLResponsePtr response) override; + void RunApplication( + InterfaceRequest<shell::mojom::Application> application_request, + URLResponsePtr response) override; }; explicit ContentHandlerFactory(Delegate* delegate); @@ -53,7 +55,7 @@ class ContentHandlerFactory : public InterfaceFactory<ContentHandler> { private: // From InterfaceFactory: void Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) override; + InterfaceRequest<shell::mojom::ContentHandler> request) override; Delegate* delegate_; diff --git a/mojo/shell/public/cpp/lib/application_impl.cc b/mojo/shell/public/cpp/lib/application_impl.cc index 5c40fe6..2769f6e 100644 --- a/mojo/shell/public/cpp/lib/application_impl.cc +++ b/mojo/shell/public/cpp/lib/application_impl.cc @@ -29,23 +29,26 @@ void DefaultTerminationClosure() { ApplicationImpl::ConnectParams::ConnectParams(const std::string& url) : ConnectParams(URLRequest::From(url)) {} ApplicationImpl::ConnectParams::ConnectParams(URLRequestPtr request) - : request_(std::move(request)), filter_(CapabilityFilter::New()) { + : request_(std::move(request)), + filter_(shell::mojom::CapabilityFilter::New()) { filter_->filter.mark_non_null(); } ApplicationImpl::ConnectParams::~ConnectParams() {} -ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, - InterfaceRequest<Application> request) +ApplicationImpl::ApplicationImpl( + ApplicationDelegate* delegate, + InterfaceRequest<shell::mojom::Application> request) : ApplicationImpl(delegate, std::move(request), base::Bind(&DefaultTerminationClosure)) {} -ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate, - InterfaceRequest<Application> request, - const Closure& termination_closure) +ApplicationImpl::ApplicationImpl( + ApplicationDelegate* delegate, + InterfaceRequest<shell::mojom::Application> request, + const Closure& termination_closure) : delegate_(delegate), binding_(this, std::move(request)), - id_(Shell::kInvalidApplicationID), + id_(shell::mojom::Shell::kInvalidApplicationID), termination_closure_(termination_closure), app_lifetime_helper_(this), quit_requested_(false), @@ -81,8 +84,9 @@ scoped_ptr<ApplicationConnection> InterfaceRequest<ServiceProvider> remote_services_proxy = GetProxy(&remote_services); scoped_ptr<internal::ServiceRegistry> registry(new internal::ServiceRegistry( - application_url, application_url, Shell::kInvalidApplicationID, - std::move(remote_services), std::move(local_request), allowed)); + application_url, application_url, + shell::mojom::Shell::kInvalidApplicationID, std::move(remote_services), + std::move(local_request), allowed)); shell_->ConnectToApplication(std::move(request), std::move(remote_services_proxy), std::move(local_services), params->TakeFilter(), @@ -106,7 +110,7 @@ void ApplicationImpl::Quit() { } } -void ApplicationImpl::Initialize(ShellPtr shell, +void ApplicationImpl::Initialize(shell::mojom::ShellPtr shell, const mojo::String& url, uint32_t id) { shell_ = std::move(shell); @@ -167,14 +171,15 @@ void ApplicationImpl::QuitNow() { } void ApplicationImpl::UnbindConnections( - InterfaceRequest<Application>* application_request, - ShellPtr* shell) { + InterfaceRequest<shell::mojom::Application>* application_request, + shell::mojom::ShellPtr* shell) { *application_request = binding_.Unbind(); shell->Bind(shell_.PassInterface()); } -CapabilityFilterPtr CreatePermissiveCapabilityFilter() { - CapabilityFilterPtr filter(CapabilityFilter::New()); +shell::mojom::CapabilityFilterPtr CreatePermissiveCapabilityFilter() { + shell::mojom::CapabilityFilterPtr filter( + shell::mojom::CapabilityFilter::New()); Array<String> all_interfaces; all_interfaces.push_back("*"); filter->filter.insert("*", std::move(all_interfaces)); diff --git a/mojo/shell/public/cpp/lib/application_runner.cc b/mojo/shell/public/cpp/lib/application_runner.cc index 02380c6..e95133e 100644 --- a/mojo/shell/public/cpp/lib/application_runner.cc +++ b/mojo/shell/public/cpp/lib/application_runner.cc @@ -55,8 +55,9 @@ MojoResult ApplicationRunner::Run(MojoHandle application_request_handle, loop.reset(new base::MessageLoop(message_loop_type_)); ApplicationImpl impl(delegate_.get(), - MakeRequest<Application>(MakeScopedHandle( - MessagePipeHandle(application_request_handle)))); + MakeRequest<shell::mojom::Application>( + MakeScopedHandle(MessagePipeHandle( + application_request_handle)))); loop->Run(); // It's very common for the delegate to cache the app and terminate on // errors. If we don't delete the delegate before the app we run the risk diff --git a/mojo/shell/public/cpp/lib/application_test_base.cc b/mojo/shell/public/cpp/lib/application_test_base.cc index c9d08c1..377220e 100644 --- a/mojo/shell/public/cpp/lib/application_test_base.cc +++ b/mojo/shell/public/cpp/lib/application_test_base.cc @@ -19,20 +19,21 @@ namespace test { namespace { // Share the application URL with multiple application tests. String g_url; -uint32_t g_id = Shell::kInvalidApplicationID; +uint32_t g_id = shell::mojom::Shell::kInvalidApplicationID; // Application request handle passed from the shell in MojoMain, stored in // between SetUp()/TearDown() so we can (re-)intialize new ApplicationImpls. -InterfaceRequest<Application> g_application_request; +InterfaceRequest<shell::mojom::Application> g_application_request; // Shell pointer passed in the initial mojo.Application.Initialize() call, // stored in between initial setup and the first test and between SetUp/TearDown // calls so we can (re-)initialize new ApplicationImpls. -ShellPtr g_shell; +shell::mojom::ShellPtr g_shell; -class ShellGrabber : public Application { +class ShellGrabber : public shell::mojom::Application { public: - explicit ShellGrabber(InterfaceRequest<Application> application_request) + explicit ShellGrabber( + InterfaceRequest<shell::mojom::Application> application_request) : binding_(this, std::move(application_request)) {} void WaitForInitialize() { @@ -42,7 +43,7 @@ class ShellGrabber : public Application { private: // Application implementation. - void Initialize(ShellPtr shell, + void Initialize(shell::mojom::ShellPtr shell, const mojo::String& url, uint32_t id) override { g_url = url; @@ -76,7 +77,7 @@ MojoResult RunAllTests(MojoHandle application_request_handle) { // Grab the shell handle. ShellGrabber grabber( - MakeRequest<Application>(MakeScopedHandle( + MakeRequest<shell::mojom::Application>(MakeScopedHandle( MessagePipeHandle(application_request_handle)))); grabber.WaitForInitialize(); MOJO_CHECK(g_shell); @@ -117,7 +118,7 @@ TestHelper::TestHelper(ApplicationDelegate* delegate) delegate == nullptr ? &default_application_delegate_ : delegate, std::move(g_application_request))) { // Fake application initialization. - Application* application = application_impl_.get(); + shell::mojom::Application* application = application_impl_.get(); application->Initialize(std::move(g_shell), g_url, g_id); } diff --git a/mojo/shell/public/cpp/lib/content_handler_factory.cc b/mojo/shell/public/cpp/lib/content_handler_factory.cc index c810354..c713f24 100644 --- a/mojo/shell/public/cpp/lib/content_handler_factory.cc +++ b/mojo/shell/public/cpp/lib/content_handler_factory.cc @@ -31,7 +31,7 @@ class ApplicationThread : public base::PlatformThread::Delegate { scoped_refptr<base::SingleThreadTaskRunner> handler_thread, const base::Callback<void(ApplicationThread*)>& termination_callback, ContentHandlerFactory::Delegate* handler_delegate, - InterfaceRequest<Application> application_request, + InterfaceRequest<shell::mojom::Application> application_request, URLResponsePtr response, const Callback<void()>& destruct_callback) : handler_thread_(handler_thread), @@ -56,17 +56,17 @@ class ApplicationThread : public base::PlatformThread::Delegate { scoped_refptr<base::SingleThreadTaskRunner> handler_thread_; base::Callback<void(ApplicationThread*)> termination_callback_; ContentHandlerFactory::Delegate* handler_delegate_; - InterfaceRequest<Application> application_request_; + InterfaceRequest<shell::mojom::Application> application_request_; URLResponsePtr response_; Callback<void()> destruct_callback_; DISALLOW_COPY_AND_ASSIGN(ApplicationThread); }; -class ContentHandlerImpl : public ContentHandler { +class ContentHandlerImpl : public shell::mojom::ContentHandler { public: ContentHandlerImpl(ContentHandlerFactory::Delegate* delegate, - InterfaceRequest<ContentHandler> request) + InterfaceRequest<shell::mojom::ContentHandler> request) : delegate_(delegate), binding_(this, std::move(request)), weak_factory_(this) {} @@ -85,7 +85,7 @@ class ContentHandlerImpl : public ContentHandler { private: // Overridden from ContentHandler: void StartApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<shell::mojom::Application> application_request, URLResponsePtr response, const Callback<void()>& destruct_callback) override { ApplicationThread* thread = @@ -110,7 +110,7 @@ class ContentHandlerImpl : public ContentHandler { ContentHandlerFactory::Delegate* delegate_; std::map<ApplicationThread*, base::PlatformThreadHandle> active_threads_; - StrongBinding<ContentHandler> binding_; + StrongBinding<shell::mojom::ContentHandler> binding_; base::WeakPtrFactory<ContentHandlerImpl> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); @@ -126,7 +126,7 @@ ContentHandlerFactory::~ContentHandlerFactory() { } void ContentHandlerFactory::ManagedDelegate::RunApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<shell::mojom::Application> application_request, URLResponsePtr response) { base::MessageLoop loop(common::MessagePumpMojo::Create()); auto application = this->CreateApplication(std::move(application_request), @@ -135,8 +135,9 @@ void ContentHandlerFactory::ManagedDelegate::RunApplication( loop.Run(); } -void ContentHandlerFactory::Create(ApplicationConnection* connection, - InterfaceRequest<ContentHandler> request) { +void ContentHandlerFactory::Create( + ApplicationConnection* connection, + InterfaceRequest<shell::mojom::ContentHandler> request) { new ContentHandlerImpl(delegate_, std::move(request)); } diff --git a/mojo/shell/public/cpp/lib/service_registry.cc b/mojo/shell/public/cpp/lib/service_registry.cc index 6503e0b..1425276 100644 --- a/mojo/shell/public/cpp/lib/service_registry.cc +++ b/mojo/shell/public/cpp/lib/service_registry.cc @@ -47,7 +47,7 @@ ServiceRegistry::ServiceRegistry() ServiceRegistry::~ServiceRegistry() { } -Shell::ConnectToApplicationCallback +shell::mojom::Shell::ConnectToApplicationCallback ServiceRegistry::GetConnectToApplicationCallback() { return base::Bind(&ServiceRegistry::OnGotRemoteIDs, weak_factory_.GetWeakPtr()); diff --git a/mojo/shell/public/cpp/lib/service_registry.h b/mojo/shell/public/cpp/lib/service_registry.h index 09481e6..74c2e34 100644 --- a/mojo/shell/public/cpp/lib/service_registry.h +++ b/mojo/shell/public/cpp/lib/service_registry.h @@ -36,7 +36,8 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection { const std::set<std::string>& allowed_interfaces); ~ServiceRegistry() override; - Shell::ConnectToApplicationCallback GetConnectToApplicationCallback(); + shell::mojom::Shell::ConnectToApplicationCallback + GetConnectToApplicationCallback(); // ApplicationConnection overrides. void SetServiceConnector(ServiceConnector* service_connector) override; diff --git a/mojo/shell/public/interfaces/application.mojom b/mojo/shell/public/interfaces/application.mojom index efe1e7b..b59b724 100644 --- a/mojo/shell/public/interfaces/application.mojom +++ b/mojo/shell/public/interfaces/application.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo; +module mojo.shell.mojom; import "mojo/shell/public/interfaces/service_provider.mojom"; import "mojo/shell/public/interfaces/shell.mojom"; @@ -63,8 +63,8 @@ interface Application { // AcceptConnection(string requestor_url, uint32 requestor_id, - ServiceProvider&? services, - ServiceProvider? exposed_services, + mojo.ServiceProvider&? services, + mojo.ServiceProvider? exposed_services, array<string> allowed_interfaces, string resolved_url); diff --git a/mojo/shell/public/interfaces/application_manager.mojom b/mojo/shell/public/interfaces/application_manager.mojom index d50f96e..c365146 100644 --- a/mojo/shell/public/interfaces/application_manager.mojom +++ b/mojo/shell/public/interfaces/application_manager.mojom @@ -54,7 +54,7 @@ interface ApplicationManager { // request there. CreateInstanceForHandle(handle channel, string url, - mojo.CapabilityFilter filter, + CapabilityFilter filter, PIDReceiver& pid_receiver); // The listener is removed when the pipe is closed. diff --git a/mojo/shell/public/interfaces/content_handler.mojom b/mojo/shell/public/interfaces/content_handler.mojom index 5fdb826..405238f 100644 --- a/mojo/shell/public/interfaces/content_handler.mojom +++ b/mojo/shell/public/interfaces/content_handler.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo; +module mojo.shell.mojom; import "mojo/shell/public/interfaces/application.mojom"; import "network/public/interfaces/url_loader.mojom"; @@ -16,5 +16,5 @@ import "network/public/interfaces/url_loader.mojom"; // implementation to self destruct and release the app reference. interface ContentHandler { // The callback should be called when the application is destructed. - StartApplication(Application& application, URLResponse response) => (); + StartApplication(Application& application, mojo.URLResponse response) => (); }; diff --git a/mojo/shell/public/interfaces/shell.mojom b/mojo/shell/public/interfaces/shell.mojom index 787ed11..1efc3586 100644 --- a/mojo/shell/public/interfaces/shell.mojom +++ b/mojo/shell/public/interfaces/shell.mojom @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo; +module mojo.shell.mojom; import "mojo/shell/public/interfaces/service_provider.mojom"; import "network/public/interfaces/url_loader.mojom"; @@ -61,9 +61,9 @@ interface Shell { // |content_handler_id| is the id of the deepest content handler used to // establish the connection to |application_url|. If no content handler is // used |content_handler_id| is kInvalidApplicationID. - ConnectToApplication(URLRequest application_url, - ServiceProvider&? services, - ServiceProvider? exposed_services, + ConnectToApplication(mojo.URLRequest application_url, + mojo.ServiceProvider&? services, + mojo.ServiceProvider? exposed_services, CapabilityFilter filter) => (uint32 application_id, uint32 content_handler_id); diff --git a/mojo/shell/runner/child/child_controller.mojom b/mojo/shell/runner/child/child_controller.mojom index 2c56357..34c6dc9 100644 --- a/mojo/shell/runner/child/child_controller.mojom +++ b/mojo/shell/runner/child/child_controller.mojom @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -module mojo.shell; +module mojo.shell.mojom; import "mojo/shell/public/interfaces/application.mojom"; interface ChildController { // Starts the app. - StartApp(mojo.Application& application_request) => (int32 result); + StartApp(Application& application_request) => (int32 result); // Exits the child process now (with no cleanup), with the given exit code. ExitNow(int32 exit_code); diff --git a/mojo/shell/runner/child/runner_connection.cc b/mojo/shell/runner/child/runner_connection.cc index 4ee789d..b8477ac 100644 --- a/mojo/shell/runner/child/runner_connection.cc +++ b/mojo/shell/runner/child/runner_connection.cc @@ -72,7 +72,7 @@ class Blocker { }; using GotApplicationRequestCallback = - base::Callback<void(InterfaceRequest<Application>)>; + base::Callback<void(InterfaceRequest<mojom::Application>)>; void OnCreateMessagePipe(ScopedMessagePipeHandle* result, Blocker::Unblocker unblocker, @@ -81,8 +81,8 @@ void OnCreateMessagePipe(ScopedMessagePipeHandle* result, unblocker.Unblock(base::Bind(&base::DoNothing)); } -void OnGotApplicationRequest(InterfaceRequest<Application>* out_request, - InterfaceRequest<Application> request) { +void OnGotApplicationRequest(InterfaceRequest<mojom::Application>* out_request, + InterfaceRequest<mojom::Application> request) { *out_request = std::move(request); } @@ -102,7 +102,7 @@ class RunnerConnectionImpl : public RunnerConnection { // Returns true if a connection to the runner has been established and // |request| has been modified, false if no connection was established. - bool WaitForApplicationRequest(InterfaceRequest<Application>* request, + bool WaitForApplicationRequest(InterfaceRequest<mojom::Application>* request, ScopedMessagePipeHandle handle); ChildControllerImpl* controller() const { return controller_.get(); } @@ -134,7 +134,7 @@ class RunnerConnectionImpl : public RunnerConnection { DISALLOW_COPY_AND_ASSIGN(RunnerConnectionImpl); }; -class ChildControllerImpl : public ChildController { +class ChildControllerImpl : public mojom::ChildController { public: ~ChildControllerImpl() override { DCHECK(thread_checker_.CalledOnValidThread()); @@ -172,8 +172,8 @@ class ChildControllerImpl : public ChildController { _exit(1); } - // |ChildController| methods: - void StartApp(InterfaceRequest<Application> application_request, + // |mojom::ChildController| methods: + void StartApp(InterfaceRequest<mojom::Application> application_request, const StartAppCallback& on_app_complete) override { DCHECK(thread_checker_.CalledOnValidThread()); @@ -199,7 +199,7 @@ class ChildControllerImpl : public ChildController { static void ReturnApplicationRequestOnMainThread( const GotApplicationRequestCallback& callback, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { callback.Run(std::move(application_request)); } @@ -215,7 +215,7 @@ class ChildControllerImpl : public ChildController { }; bool RunnerConnectionImpl::WaitForApplicationRequest( - InterfaceRequest<Application>* request, + InterfaceRequest<mojom::Application>* request, ScopedMessagePipeHandle handle) { // If a valid message pipe to the runner was not provided, look for one on the // command line. @@ -255,7 +255,7 @@ RunnerConnection::~RunnerConnection() {} // static RunnerConnection* RunnerConnection::ConnectToRunner( - InterfaceRequest<Application>* request, + InterfaceRequest<mojom::Application>* request, ScopedMessagePipeHandle handle) { RunnerConnectionImpl* connection = new RunnerConnectionImpl; if (!connection->WaitForApplicationRequest(request, std::move(handle))) { diff --git a/mojo/shell/runner/child/runner_connection.h b/mojo/shell/runner/child/runner_connection.h index dcb231e..18f01b7 100644 --- a/mojo/shell/runner/child/runner_connection.h +++ b/mojo/shell/runner/child/runner_connection.h @@ -24,7 +24,7 @@ class RunnerConnection { // If a connection to the runner cannot be established, |request| will not be // modified and this function will return null. static RunnerConnection* ConnectToRunner( - InterfaceRequest<Application>* request, + InterfaceRequest<mojom::Application>* request, ScopedMessagePipeHandle handle); protected: diff --git a/mojo/shell/runner/child/test_native_main.cc b/mojo/shell/runner/child/test_native_main.cc index 563ab5c..3e63eec5 100644 --- a/mojo/shell/runner/child/test_native_main.cc +++ b/mojo/shell/runner/child/test_native_main.cc @@ -60,7 +60,7 @@ int TestNativeMain(mojo::ApplicationDelegate* application_delegate) { mojo::embedder::ProcessType::NONE, &process_delegate, io_thread.task_runner().get(), mojo::embedder::ScopedPlatformHandle()); - mojo::InterfaceRequest<mojo::Application> application_request; + mojo::ApplicationRequest application_request; scoped_ptr<mojo::shell::RunnerConnection> connection( mojo::shell::RunnerConnection::ConnectToRunner( &application_request, ScopedMessagePipeHandle())); diff --git a/mojo/shell/runner/host/child_process.cc b/mojo/shell/runner/host/child_process.cc index 23b1ddf5f..1d9228c 100644 --- a/mojo/shell/runner/host/child_process.cc +++ b/mojo/shell/runner/host/child_process.cc @@ -194,7 +194,7 @@ class AppContext : public embedder::ProcessDelegate { // ChildControllerImpl ------------------------------------------------------ -class ChildControllerImpl : public ChildController { +class ChildControllerImpl : public mojom::ChildController { public: ~ChildControllerImpl() override { DCHECK(thread_checker_.CalledOnValidThread()); @@ -235,7 +235,7 @@ class ChildControllerImpl : public ChildController { } // |ChildController| methods: - void StartApp(InterfaceRequest<Application> application_request, + void StartApp(InterfaceRequest<mojom::Application> application_request, const StartAppCallback& on_app_complete) override { DCHECK(thread_checker_.CalledOnValidThread()); @@ -258,7 +258,7 @@ class ChildControllerImpl : public ChildController { static void StartAppOnMainThread( base::NativeLibrary app_library, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { if (!RunNativeApplication(app_library, std::move(application_request))) { LOG(ERROR) << "Failure to RunNativeApplication()"; } diff --git a/mojo/shell/runner/host/child_process_host.cc b/mojo/shell/runner/host/child_process_host.cc index 57e5235..4e9fa9f 100644 --- a/mojo/shell/runner/host/child_process_host.cc +++ b/mojo/shell/runner/host/child_process_host.cc @@ -88,7 +88,8 @@ ChildProcessHost::ChildProcessHost(ScopedHandle channel) weak_factory_(this) { CHECK(channel.is_valid()); ScopedMessagePipeHandle handle(MessagePipeHandle(channel.release().value())); - controller_.Bind(InterfacePtrInfo<ChildController>(std::move(handle), 0u)); + controller_.Bind( + InterfacePtrInfo<mojom::ChildController>(std::move(handle), 0u)); } ChildProcessHost::~ChildProcessHost() { @@ -138,7 +139,7 @@ int ChildProcessHost::Join() { if (controller_) // We use this as a signal that Start was called. start_child_process_event_.Wait(); - controller_ = ChildControllerPtr(); + controller_ = mojom::ChildControllerPtr(); DCHECK(child_process_.IsValid()); // Ensure the child pipe is closed even if it wasn't yet connected to the @@ -155,8 +156,8 @@ int ChildProcessHost::Join() { } void ChildProcessHost::StartApp( - InterfaceRequest<Application> application_request, - const ChildController::StartAppCallback& on_app_complete) { + InterfaceRequest<mojom::Application> application_request, + const mojom::ChildController::StartAppCallback& on_app_complete) { DCHECK(controller_); on_app_complete_ = on_app_complete; @@ -287,7 +288,7 @@ void ChildProcessHost::DidCreateChannel(embedder::ChannelInfo* channel_info) { void ChildProcessHost::OnMessagePipeCreated() { controller_.Bind( - InterfacePtrInfo<ChildController>(pipe_holder_->PassPipe(), 0u)); + InterfacePtrInfo<mojom::ChildController>(pipe_holder_->PassPipe(), 0u)); MaybeNotifyProcessReady(); } diff --git a/mojo/shell/runner/host/child_process_host.h b/mojo/shell/runner/host/child_process_host.h index 9c0acda..7472096 100644 --- a/mojo/shell/runner/host/child_process_host.h +++ b/mojo/shell/runner/host/child_process_host.h @@ -64,9 +64,10 @@ class ChildProcessHost { // Waits for the child process to terminate, and returns its exit code. int Join(); - // See |ChildController|: - void StartApp(InterfaceRequest<Application> application_request, - const ChildController::StartAppCallback& on_app_complete); + // See |mojom::ChildController|: + void StartApp( + InterfaceRequest<mojom::Application> application_request, + const mojom::ChildController::StartAppCallback& on_app_complete); void ExitNow(int32_t exit_code); protected: @@ -127,9 +128,9 @@ class ChildProcessHost { base::Process child_process_; // Used for the ChildController binding. embedder::PlatformChannelPair platform_channel_pair_; - ChildControllerPtr controller_; + mojom::ChildControllerPtr controller_; embedder::ChannelInfo* channel_info_; - ChildController::StartAppCallback on_app_complete_; + mojom::ChildController::StartAppCallback on_app_complete_; embedder::HandlePassingInformation handle_passing_info_; // Used only when --use-new-edk is specified. Used to back the NodeChannel diff --git a/mojo/shell/runner/host/in_process_native_runner.cc b/mojo/shell/runner/host/in_process_native_runner.cc index a6a0b11..1674cbf 100644 --- a/mojo/shell/runner/host/in_process_native_runner.cc +++ b/mojo/shell/runner/host/in_process_native_runner.cc @@ -35,7 +35,7 @@ InProcessNativeRunner::~InProcessNativeRunner() { void InProcessNativeRunner::Start( const base::FilePath& app_path, bool start_sandboxed, - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, const base::Closure& app_completed_callback) { app_path_ = app_path; @@ -56,7 +56,7 @@ void InProcessNativeRunner::Start( void InProcessNativeRunner::InitHost( ScopedHandle channel, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { NOTREACHED(); // Can't host another process in this runner. } diff --git a/mojo/shell/runner/host/in_process_native_runner.h b/mojo/shell/runner/host/in_process_native_runner.h index d2759c2..c167112 100644 --- a/mojo/shell/runner/host/in_process_native_runner.h +++ b/mojo/shell/runner/host/in_process_native_runner.h @@ -33,18 +33,19 @@ class InProcessNativeRunner : public NativeRunner, void Start( const base::FilePath& app_path, bool start_sandboxed, - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, const base::Closure& app_completed_callback) override; - void InitHost(ScopedHandle channel, - InterfaceRequest<Application> application_request) override; + void InitHost( + ScopedHandle channel, + InterfaceRequest<mojom::Application> application_request) override; private: // |base::DelegateSimpleThread::Delegate| method: void Run() override; base::FilePath app_path_; - InterfaceRequest<Application> application_request_; + InterfaceRequest<mojom::Application> application_request_; base::Callback<bool(void)> app_completed_callback_runner_; base::ScopedNativeLibrary app_library_; diff --git a/mojo/shell/runner/host/native_application_support.cc b/mojo/shell/runner/host/native_application_support.cc index cdc6685..eeccef9 100644 --- a/mojo/shell/runner/host/native_application_support.cc +++ b/mojo/shell/runner/host/native_application_support.cc @@ -52,8 +52,9 @@ base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path) { return app_library; } -bool RunNativeApplication(base::NativeLibrary app_library, - InterfaceRequest<Application> application_request) { +bool RunNativeApplication( + base::NativeLibrary app_library, + InterfaceRequest<mojom::Application> application_request) { // Tolerate |app_library| being null, to make life easier for callers. if (!app_library) return false; diff --git a/mojo/shell/runner/host/native_application_support.h b/mojo/shell/runner/host/native_application_support.h index d9ece60..88daad3 100644 --- a/mojo/shell/runner/host/native_application_support.h +++ b/mojo/shell/runner/host/native_application_support.h @@ -7,6 +7,7 @@ #include "base/native_library.h" #include "mojo/public/cpp/bindings/interface_request.h" +#include "mojo/shell/public/interfaces/application.mojom.h" namespace base { class FilePath; @@ -32,8 +33,9 @@ base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path); // true if |MojoMain()| was called (even if it returns an error), and false // otherwise. // TODO(vtl): Maybe this should also have a |MojoResult| as an out parameter? -bool RunNativeApplication(base::NativeLibrary app_library, - InterfaceRequest<Application> application_request); +bool RunNativeApplication( + base::NativeLibrary app_library, + InterfaceRequest<mojom::Application> application_request); } // namespace shell } // namespace mojo diff --git a/mojo/shell/runner/host/out_of_process_native_runner.cc b/mojo/shell/runner/host/out_of_process_native_runner.cc index 4c0c8bf..9b4ae03 100644 --- a/mojo/shell/runner/host/out_of_process_native_runner.cc +++ b/mojo/shell/runner/host/out_of_process_native_runner.cc @@ -31,7 +31,7 @@ OutOfProcessNativeRunner::~OutOfProcessNativeRunner() { void OutOfProcessNativeRunner::Start( const base::FilePath& app_path, bool start_sandboxed, - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, const base::Closure& app_completed_callback) { app_path_ = app_path; @@ -48,7 +48,7 @@ void OutOfProcessNativeRunner::Start( void OutOfProcessNativeRunner::InitHost( ScopedHandle channel, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { child_process_host_.reset(new ChildProcessHost(std::move(channel))); child_process_host_->StartApp( std::move(application_request), @@ -69,7 +69,7 @@ void OutOfProcessNativeRunner::AppCompleted(int32_t result) { } void OutOfProcessNativeRunner::OnProcessLaunched( - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, base::ProcessId pid) { DCHECK(child_process_host_); diff --git a/mojo/shell/runner/host/out_of_process_native_runner.h b/mojo/shell/runner/host/out_of_process_native_runner.h index 74c1d5b..794c1f3 100644 --- a/mojo/shell/runner/host/out_of_process_native_runner.h +++ b/mojo/shell/runner/host/out_of_process_native_runner.h @@ -33,11 +33,12 @@ class OutOfProcessNativeRunner : public NativeRunner { void Start( const base::FilePath& app_path, bool start_sandboxed, - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, const base::Closure& app_completed_callback) override; - void InitHost(ScopedHandle channel, - InterfaceRequest<Application> application_request) override; + void InitHost( + ScopedHandle channel, + InterfaceRequest<mojom::Application> application_request) override; private: // |ChildController::StartApp()| callback: @@ -45,7 +46,7 @@ class OutOfProcessNativeRunner : public NativeRunner { // Callback run when the child process has launched. void OnProcessLaunched( - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, const base::Callback<void(base::ProcessId)>& pid_available_callback, base::ProcessId pid); diff --git a/mojo/shell/shell_application_delegate.cc b/mojo/shell/shell_application_delegate.cc index 4b3efdd..66a36ba 100644 --- a/mojo/shell/shell_application_delegate.cc +++ b/mojo/shell/shell_application_delegate.cc @@ -37,7 +37,7 @@ void ShellApplicationDelegate::Create( void ShellApplicationDelegate::CreateInstanceForHandle( ScopedHandle channel, const String& url, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, InterfaceRequest<mojom::PIDReceiver> pid_receiver) { manager_->CreateInstanceForHandle(std::move(channel), GURL(url.get()), std::move(filter), std::move(pid_receiver)); diff --git a/mojo/shell/shell_application_delegate.h b/mojo/shell/shell_application_delegate.h index 6986bc3..717e104 100644 --- a/mojo/shell/shell_application_delegate.h +++ b/mojo/shell/shell_application_delegate.h @@ -40,7 +40,7 @@ class ShellApplicationDelegate void CreateInstanceForHandle( ScopedHandle channel, const String& url, - CapabilityFilterPtr filter, + mojom::CapabilityFilterPtr filter, InterfaceRequest<mojom::PIDReceiver> pid_receiver) override; void AddListener( mojom::ApplicationManagerListenerPtr listener) override; diff --git a/mojo/shell/shell_application_loader.cc b/mojo/shell/shell_application_loader.cc index 6040517..e648295 100644 --- a/mojo/shell/shell_application_loader.cc +++ b/mojo/shell/shell_application_loader.cc @@ -18,7 +18,7 @@ ShellApplicationLoader::~ShellApplicationLoader() {} void ShellApplicationLoader::Load( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { DCHECK(application_request.is_pending()); app_.reset(new ApplicationImpl(new ShellApplicationDelegate(manager_), std::move(application_request))); diff --git a/mojo/shell/shell_application_loader.h b/mojo/shell/shell_application_loader.h index 7ffd365..b00f08a 100644 --- a/mojo/shell/shell_application_loader.h +++ b/mojo/shell/shell_application_loader.h @@ -21,7 +21,7 @@ class ShellApplicationLoader : public ApplicationLoader { // Overridden from ApplicationLoader: void Load( const GURL& url, - InterfaceRequest<Application> application_request) override; + InterfaceRequest<mojom::Application> application_request) override; scoped_ptr<ApplicationImpl> app_; diff --git a/mojo/shell/standalone/android/android_handler.cc b/mojo/shell/standalone/android/android_handler.cc index 6e3ad3c..f3de55f 100644 --- a/mojo/shell/standalone/android/android_handler.cc +++ b/mojo/shell/standalone/android/android_handler.cc @@ -41,8 +41,9 @@ void RunAndroidApplication(JNIEnv* env, jobject j_context, const base::FilePath& app_path, jint j_handle) { - InterfaceRequest<Application> application_request = - MakeRequest<Application>(MakeScopedHandle(MessagePipeHandle(j_handle))); + InterfaceRequest<mojom::Application> application_request = + MakeRequest<mojom::Application>( + MakeScopedHandle(MessagePipeHandle(j_handle))); // Load the library, so that we can set the application context there if // needed. @@ -132,7 +133,7 @@ AndroidHandler::AndroidHandler() : content_handler_factory_(this) {} AndroidHandler::~AndroidHandler() {} void AndroidHandler::RunApplication( - InterfaceRequest<Application> application_request, + InterfaceRequest<mojom::Application> application_request, URLResponsePtr response) { JNIEnv* env = AttachCurrentThread(); RunAndroidApplicationFn run_android_application_fn = &RunAndroidApplication; diff --git a/mojo/shell/standalone/android/android_handler.h b/mojo/shell/standalone/android/android_handler.h index ac25ea1..1169699 100644 --- a/mojo/shell/standalone/android/android_handler.h +++ b/mojo/shell/standalone/android/android_handler.h @@ -31,7 +31,7 @@ class AndroidHandler : public ApplicationDelegate, bool AcceptConnection(ApplicationConnection* connection) override; // ContentHandlerFactory::Delegate: - void RunApplication(InterfaceRequest<Application> application_request, + void RunApplication(InterfaceRequest<mojom::Application> application_request, URLResponsePtr response) override; ContentHandlerFactory content_handler_factory_; diff --git a/mojo/shell/standalone/android/android_handler_loader.cc b/mojo/shell/standalone/android/android_handler_loader.cc index ef7b202..1c1bb5e 100644 --- a/mojo/shell/standalone/android/android_handler_loader.cc +++ b/mojo/shell/standalone/android/android_handler_loader.cc @@ -15,7 +15,7 @@ AndroidHandlerLoader::~AndroidHandlerLoader() {} void AndroidHandlerLoader::Load( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { DCHECK(application_request.is_pending()); application_.reset( new ApplicationImpl(&android_handler_, std::move(application_request))); diff --git a/mojo/shell/standalone/android/android_handler_loader.h b/mojo/shell/standalone/android/android_handler_loader.h index 0136742..18255d5 100644 --- a/mojo/shell/standalone/android/android_handler_loader.h +++ b/mojo/shell/standalone/android/android_handler_loader.h @@ -23,7 +23,7 @@ class AndroidHandlerLoader : public ApplicationLoader { private: // ApplicationLoader overrides: void Load(const GURL& url, - InterfaceRequest<Application> application_request) override; + InterfaceRequest<mojom::Application> application_request) override; AndroidHandler android_handler_; scoped_ptr<ApplicationImpl> application_; diff --git a/mojo/shell/standalone/android/background_application_loader.cc b/mojo/shell/standalone/android/background_application_loader.cc index da433e7..8bd3869 100644 --- a/mojo/shell/standalone/android/background_application_loader.cc +++ b/mojo/shell/standalone/android/background_application_loader.cc @@ -29,7 +29,7 @@ BackgroundApplicationLoader::~BackgroundApplicationLoader() { void BackgroundApplicationLoader::Load( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { DCHECK(application_request.is_pending()); if (!thread_) { // TODO(tim): It'd be nice if we could just have each Load call @@ -65,7 +65,7 @@ void BackgroundApplicationLoader::Run() { void BackgroundApplicationLoader::LoadOnBackgroundThread( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { DCHECK(task_runner_->RunsTasksOnCurrentThread()); loader_->Load(url, std::move(application_request)); } diff --git a/mojo/shell/standalone/android/background_application_loader.h b/mojo/shell/standalone/android/background_application_loader.h index 2e25e55..203ce54 100644 --- a/mojo/shell/standalone/android/background_application_loader.h +++ b/mojo/shell/standalone/android/background_application_loader.h @@ -26,7 +26,7 @@ class BackgroundApplicationLoader // ApplicationLoader overrides: void Load(const GURL& url, - InterfaceRequest<Application> application_request) override; + InterfaceRequest<mojom::Application> application_request) override; private: // |base::DelegateSimpleThread::Delegate| method: @@ -36,7 +36,7 @@ class BackgroundApplicationLoader // to |background_loader_| to do the actual loading. void LoadOnBackgroundThread( const GURL& url, - InterfaceRequest<Application> application_request); + InterfaceRequest<mojom::Application> application_request); bool quit_on_shutdown_; scoped_ptr<ApplicationLoader> loader_; diff --git a/mojo/shell/standalone/android/background_application_loader_unittest.cc b/mojo/shell/standalone/android/background_application_loader_unittest.cc index 9f66bf1..b7c1712 100644 --- a/mojo/shell/standalone/android/background_application_loader_unittest.cc +++ b/mojo/shell/standalone/android/background_application_loader_unittest.cc @@ -18,7 +18,7 @@ class DummyLoader : public ApplicationLoader { // ApplicationLoader overrides: void Load(const GURL& url, - InterfaceRequest<Application> application_request) override { + InterfaceRequest<mojom::Application> application_request) override { if (simulate_app_quit_) base::MessageLoop::current()->QuitWhenIdle(); } diff --git a/mojo/shell/standalone/android/ui_application_loader_android.cc b/mojo/shell/standalone/android/ui_application_loader_android.cc index 10ec448..39ebb8d 100644 --- a/mojo/shell/standalone/android/ui_application_loader_android.cc +++ b/mojo/shell/standalone/android/ui_application_loader_android.cc @@ -26,7 +26,7 @@ UIApplicationLoader::~UIApplicationLoader() { void UIApplicationLoader::Load( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { DCHECK(application_request.is_pending()); ui_message_loop_->PostTask( FROM_HERE, @@ -36,7 +36,7 @@ void UIApplicationLoader::Load( void UIApplicationLoader::LoadOnUIThread( const GURL& url, - InterfaceRequest<Application> application_request) { + InterfaceRequest<mojom::Application> application_request) { loader_->Load(url, std::move(application_request)); } diff --git a/mojo/shell/standalone/android/ui_application_loader_android.h b/mojo/shell/standalone/android/ui_application_loader_android.h index c990ace..6a8c03e 100644 --- a/mojo/shell/standalone/android/ui_application_loader_android.h +++ b/mojo/shell/standalone/android/ui_application_loader_android.h @@ -29,7 +29,7 @@ class UIApplicationLoader : public ApplicationLoader { // ApplicationLoader overrides: void Load(const GURL& url, - InterfaceRequest<Application> application_request) override; + InterfaceRequest<mojom::Application> application_request) override; private: class UILoader; @@ -39,7 +39,7 @@ class UIApplicationLoader : public ApplicationLoader { // TODO: having this code take a |manager| is fragile (as ApplicationManager // isn't thread safe). void LoadOnUIThread(const GURL& url, - InterfaceRequest<Application> application_request); + InterfaceRequest<mojom::Application> application_request); void ShutdownOnUIThread(); scoped_ptr<ApplicationLoader> loader_; diff --git a/mojo/shell/static_application_loader.cc b/mojo/shell/static_application_loader.cc index b609fcd..c7e7f5e 100644 --- a/mojo/shell/static_application_loader.cc +++ b/mojo/shell/static_application_loader.cc @@ -25,7 +25,7 @@ namespace { class RunnerThread : public base::SimpleThread { public: RunnerThread(const GURL& url, - InterfaceRequest<Application> request, + InterfaceRequest<mojom::Application> request, scoped_refptr<base::TaskRunner> exit_task_runner, const base::Closure& exit_callback, const StaticApplicationLoader::ApplicationFactory& factory) @@ -44,7 +44,7 @@ class RunnerThread : public base::SimpleThread { } private: - InterfaceRequest<Application> request_; + InterfaceRequest<mojom::Application> request_; scoped_refptr<base::TaskRunner> exit_task_runner_; base::Closure exit_callback_; StaticApplicationLoader::ApplicationFactory factory_; @@ -70,8 +70,9 @@ StaticApplicationLoader::~StaticApplicationLoader() { StopAppThread(); } -void StaticApplicationLoader::Load(const GURL& url, - InterfaceRequest<Application> request) { +void StaticApplicationLoader::Load( + const GURL& url, + InterfaceRequest<mojom::Application> request) { if (thread_) return; diff --git a/mojo/shell/static_application_loader.h b/mojo/shell/static_application_loader.h index cbf611a..9cb5cae 100644 --- a/mojo/shell/static_application_loader.h +++ b/mojo/shell/static_application_loader.h @@ -44,7 +44,7 @@ class StaticApplicationLoader : public mojo::shell::ApplicationLoader { // mojo::shell::ApplicationLoader: void Load(const GURL& url, - mojo::InterfaceRequest<mojo::Application> request) override; + InterfaceRequest<mojom::Application> request) override; private: void StopAppThread(); diff --git a/mojo/shell/test_package_manager.cc b/mojo/shell/test_package_manager.cc index 889dd8d..281925d 100644 --- a/mojo/shell/test_package_manager.cc +++ b/mojo/shell/test_package_manager.cc @@ -22,7 +22,7 @@ uint32_t TestPackageManager::HandleWithContentHandler( const Identity& source, const GURL& target_url, const CapabilityFilter& target_filter, - InterfaceRequest<Application>* application_request) { + InterfaceRequest<shell::mojom::Application>* application_request) { return 0; } bool TestPackageManager::IsURLInCatalog(const std::string& url) const { diff --git a/mojo/shell/test_package_manager.h b/mojo/shell/test_package_manager.h index f4a35df..0acb7bc 100644 --- a/mojo/shell/test_package_manager.h +++ b/mojo/shell/test_package_manager.h @@ -30,7 +30,8 @@ class TestPackageManager : public PackageManager { const Identity& source, const GURL& target_url, const CapabilityFilter& target_filter, - InterfaceRequest<Application>* application_request) override; + InterfaceRequest<shell::mojom::Application>* application_request) + override; bool IsURLInCatalog(const std::string& url) const override; std::string GetApplicationName(const std::string& url) const override; |