diff options
Diffstat (limited to 'mojo/services/test_service')
6 files changed, 24 insertions, 29 deletions
diff --git a/mojo/services/test_service/test_request_tracker_application.cc b/mojo/services/test_service/test_request_tracker_application.cc index cf5d831..4e657cb 100644 --- a/mojo/services/test_service/test_request_tracker_application.cc +++ b/mojo/services/test_service/test_request_tracker_application.cc @@ -9,8 +9,8 @@ #include "mojo/public/c/system/main.h" #include "mojo/services/test_service/test_time_service_impl.h" -#include "mojo/shell/public/cpp/application_connection.h" #include "mojo/shell/public/cpp/application_runner.h" +#include "mojo/shell/public/cpp/connection.h" namespace mojo { namespace test { @@ -25,8 +25,7 @@ void TestRequestTrackerApplication::Initialize(Shell* shell, shell_ = shell; } -bool TestRequestTrackerApplication::AcceptConnection( - ApplicationConnection* connection) { +bool TestRequestTrackerApplication::AcceptConnection(Connection* connection) { // Every instance of the service and recorder shares the context. // Note, this app is single-threaded, so this is thread safe. connection->AddService<TestTimeService>(this); @@ -36,19 +35,19 @@ bool TestRequestTrackerApplication::AcceptConnection( } void TestRequestTrackerApplication::Create( - ApplicationConnection* connection, + Connection* connection, InterfaceRequest<TestTimeService> request) { new TestTimeServiceImpl(shell_, std::move(request)); } void TestRequestTrackerApplication::Create( - ApplicationConnection* connection, + Connection* connection, InterfaceRequest<TestRequestTracker> request) { new TestRequestTrackerImpl(std::move(request), &context_); } void TestRequestTrackerApplication::Create( - ApplicationConnection* connection, + Connection* connection, InterfaceRequest<TestTrackedRequestService> request) { new TestTrackedRequestServiceImpl(std::move(request), &context_); } diff --git a/mojo/services/test_service/test_request_tracker_application.h b/mojo/services/test_service/test_request_tracker_application.h index 8d7f84c..74aa39c 100644 --- a/mojo/services/test_service/test_request_tracker_application.h +++ b/mojo/services/test_service/test_request_tracker_application.h @@ -7,8 +7,8 @@ #include "mojo/public/cpp/system/macros.h" #include "mojo/services/test_service/test_request_tracker_impl.h" -#include "mojo/shell/public/cpp/application_delegate.h" #include "mojo/shell/public/cpp/interface_factory_impl.h" +#include "mojo/shell/public/cpp/shell_client.h" namespace mojo { class ApplicationImpl; @@ -17,7 +17,7 @@ class TestTimeService; // Embeds TestRequestTracker mojo services into an application. class TestRequestTrackerApplication - : public ApplicationDelegate, + : public ShellClient, public InterfaceFactory<TestTimeService>, public InterfaceFactory<TestRequestTracker>, public InterfaceFactory<TestTrackedRequestService> { @@ -25,20 +25,20 @@ class TestRequestTrackerApplication TestRequestTrackerApplication(); ~TestRequestTrackerApplication() override; - // ApplicationDelegate methods: + // mojo::ShellClient methods: void Initialize(Shell* shell, const std::string& url, uint32_t id) override; - bool AcceptConnection(ApplicationConnection* connection) override; + bool AcceptConnection(Connection* connection) override; // InterfaceFactory<TestTimeService> methods: - void Create(ApplicationConnection* connection, + void Create(Connection* connection, InterfaceRequest<TestTimeService> request) override; // InterfaceFactory<TestRequestTracker> methods: - void Create(ApplicationConnection* connection, + void Create(Connection* connection, InterfaceRequest<TestRequestTracker> request) override; // InterfaceFactory<TestTrackedRequestService> methods: - void Create(ApplicationConnection* connection, + void Create(Connection* connection, InterfaceRequest<TestTrackedRequestService> request) override; private: diff --git a/mojo/services/test_service/test_request_tracker_impl.h b/mojo/services/test_service/test_request_tracker_impl.h index 5251e57..97fd864 100644 --- a/mojo/services/test_service/test_request_tracker_impl.h +++ b/mojo/services/test_service/test_request_tracker_impl.h @@ -13,7 +13,6 @@ #include "mojo/services/test_service/test_request_tracker.mojom.h" namespace mojo { -class ApplicationConnection; namespace test { typedef std::map<uint64_t, std::vector<ServiceStats> > AllRecordsMap; diff --git a/mojo/services/test_service/test_service_application.cc b/mojo/services/test_service/test_service_application.cc index 0f82eb9..940ce60 100644 --- a/mojo/services/test_service/test_service_application.cc +++ b/mojo/services/test_service/test_service_application.cc @@ -10,8 +10,8 @@ #include "mojo/public/c/system/main.h" #include "mojo/services/test_service/test_service_impl.h" #include "mojo/services/test_service/test_time_service_impl.h" -#include "mojo/shell/public/cpp/application_connection.h" #include "mojo/shell/public/cpp/application_runner.h" +#include "mojo/shell/public/cpp/connection.h" namespace mojo { namespace test { @@ -28,20 +28,19 @@ void TestServiceApplication::Initialize(Shell* shell, const std::string& url, shell_ = shell; } -bool TestServiceApplication::AcceptConnection( - ApplicationConnection* connection) { +bool TestServiceApplication::AcceptConnection(Connection* connection) { connection->AddService<TestService>(this); connection->AddService<TestTimeService>(this); return true; } -void TestServiceApplication::Create(ApplicationConnection* connection, +void TestServiceApplication::Create(Connection* connection, InterfaceRequest<TestService> request) { new TestServiceImpl(shell_, this, std::move(request)); AddRef(); } -void TestServiceApplication::Create(ApplicationConnection* connection, +void TestServiceApplication::Create(Connection* connection, InterfaceRequest<TestTimeService> request) { new TestTimeServiceImpl(shell_, std::move(request)); } diff --git a/mojo/services/test_service/test_service_application.h b/mojo/services/test_service/test_service_application.h index e4a527a..fd107fb 100644 --- a/mojo/services/test_service/test_service_application.h +++ b/mojo/services/test_service/test_service_application.h @@ -6,33 +6,32 @@ #define SERVICES_TEST_SERVICE_TEST_SERVICE_APPLICATION_H_ #include "mojo/public/cpp/system/macros.h" -#include "mojo/shell/public/cpp/application_delegate.h" #include "mojo/shell/public/cpp/interface_factory.h" +#include "mojo/shell/public/cpp/shell_client.h" namespace mojo { -class ApplicationConnection; - +class Connection; namespace test { class TestService; class TestTimeService; -class TestServiceApplication : public ApplicationDelegate, +class TestServiceApplication : public ShellClient, public InterfaceFactory<TestService>, public InterfaceFactory<TestTimeService> { public: TestServiceApplication(); ~TestServiceApplication() override; - // ApplicationDelegate implementation. + // mojo::ShellClient implementation. void Initialize(Shell* shell, const std::string& url, uint32_t id) override; - bool AcceptConnection(ApplicationConnection* connection) override; + bool AcceptConnection(Connection* connection) override; // InterfaceFactory<TestService> implementation. - void Create(ApplicationConnection* connection, + void Create(Connection* connection, InterfaceRequest<TestService> request) override; // InterfaceFactory<TestTimeService> implementation. - void Create(ApplicationConnection* connection, + void Create(Connection* connection, InterfaceRequest<TestTimeService> request) override; void AddRef(); diff --git a/mojo/services/test_service/test_time_service_impl.h b/mojo/services/test_service/test_time_service_impl.h index ead6899..6b50982 100644 --- a/mojo/services/test_service/test_time_service_impl.h +++ b/mojo/services/test_service/test_time_service_impl.h @@ -14,8 +14,7 @@ #include "mojo/services/test_service/test_service.mojom.h" namespace mojo { - -class ApplicationConnection; +class Connection; class Shell; namespace test { |