1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "mojo/services/test_service/test_service_impl.h" 6 7 #include "mojo/services/test_service/test_service_application.h" 8 9 namespace mojo { 10 namespace test { 11 12 TestServiceImpl::TestServiceImpl(TestServiceApplication* application) 13 : application_(application) { 14 } 15 16 TestServiceImpl::~TestServiceImpl() { 17 } 18 19 void TestServiceImpl::OnConnectionEstablished() { 20 application_->AddRef(); 21 } 22 23 void TestServiceImpl::OnConnectionError() { 24 application_->ReleaseRef(); 25 } 26 27 void TestServiceImpl::Ping(const mojo::Callback<void()>& callback) { 28 callback.Run(); 29 } 30 31 } // namespace test 32 } // namespace mojo 33