Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / mojo / services / test_service / test_service_application.cc
index 3737823..074e2e8 100644 (file)
@@ -6,8 +6,10 @@
 
 #include <assert.h>
 
+#include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/utility/run_loop.h"
 #include "mojo/services/test_service/test_service_impl.h"
+#include "mojo/services/test_service/test_time_service_impl.h"
 
 namespace mojo {
 namespace test {
@@ -18,8 +20,21 @@ TestServiceApplication::TestServiceApplication() : ref_count_(0) {
 TestServiceApplication::~TestServiceApplication() {
 }
 
-void TestServiceApplication::Initialize() {
-  AddService<TestServiceImpl>(this);
+bool TestServiceApplication::ConfigureIncomingConnection(
+    ApplicationConnection* connection) {
+  connection->AddService<TestService>(this);
+  connection->AddService<TestTimeService>(this);
+  return true;
+}
+
+void TestServiceApplication::Create(ApplicationConnection* connection,
+                                    InterfaceRequest<TestService> request) {
+  BindToRequest(new TestServiceImpl(connection, this), &request);
+}
+
+void TestServiceApplication::Create(ApplicationConnection* connection,
+                                    InterfaceRequest<TestTimeService> request) {
+  BindToRequest(new TestTimeServiceImpl(connection), &request);
 }
 
 void TestServiceApplication::AddRef() {
@@ -37,7 +52,7 @@ void TestServiceApplication::ReleaseRef() {
 }  // namespace test
 
 // static
-Application* Application::Create() {
+ApplicationDelegate* ApplicationDelegate::Create() {
   return new mojo::test::TestServiceApplication();
 }