Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1786)

Unified Diff: mojo/services/test_service/test_request_tracker_application.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: specify ownership in the Bind call Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/test_service/test_request_tracker_application.cc
diff --git a/mojo/services/test_service/test_request_tracker_application.cc b/mojo/services/test_service/test_request_tracker_application.cc
index 673cdf4595abe8ba9e1eda14aec0db70a14fb5cc..0506c2a705f5df7214b51378e98b438a84c135ef 100644
--- a/mojo/services/test_service/test_request_tracker_application.cc
+++ b/mojo/services/test_service/test_request_tracker_application.cc
@@ -12,7 +12,9 @@
namespace mojo {
namespace test {
-TestRequestTrackerApplication::TestRequestTrackerApplication() {
+TestRequestTrackerApplication::TestRequestTrackerApplication()
+ : test_tracked_request_provider_(&context_),
+ test_request_tracker_provider_(&context_) {
}
TestRequestTrackerApplication::~TestRequestTrackerApplication() {
@@ -22,12 +24,18 @@ bool TestRequestTrackerApplication::ConfigureIncomingConnection(
ApplicationConnection* connection) {
// Every instance of the service and recorder shares the context.
// Note, this app is single-threaded, so this is thread safe.
- connection->AddService<TestTrackedRequestServiceImpl>(&context_);
- connection->AddService<TestRequestTrackerImpl>(&context_);
- connection->AddService<TestTimeServiceImpl>();
+ connection->AddServiceProvider(&test_tracked_request_provider_);
+ connection->AddServiceProvider(&test_request_tracker_provider_);
+ connection->AddServiceProvider(this);
return true;
}
+void TestRequestTrackerApplication::BindToRequest(
+ ApplicationConnection* connection,
+ InterfaceRequest<TestTimeService> request) {
+ mojo::BindToRequest(new TestTimeServiceImpl(connection), &request);
+}
+
} // namespace test
// static

Powered by Google App Engine
This is Rietveld 408576698