Index: services/test/service_impl.h |
diff --git a/services/test/service_impl.h b/services/test/service_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dc6fb93ddc253b18b423c6f03bf606d4ec3c7493 |
--- /dev/null |
+++ b/services/test/service_impl.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SERVICES_TEST_SERVICE_IMPL_H_ |
+#define SERVICES_TEST_SERVICE_IMPL_H_ |
+ |
+#include <memory> |
+ |
+#include "base/memory/shared_memory.h" |
+#include "mojo/public/cpp/bindings/binding_set.h" |
+#include "services/service_manager/public/cpp/binder_registry.h" |
+#include "services/service_manager/public/cpp/interface_factory.h" |
+#include "services/service_manager/public/cpp/service.h" |
+#include "services/test/public/interfaces/service.mojom.h" |
+ |
+namespace test { |
+ |
+class ServiceImpl : public service_manager::Service, |
+ public service_manager::InterfaceFactory<mojom::Service>, |
+ public mojom::Service { |
+ public: |
+ ServiceImpl(); |
+ ~ServiceImpl() override; |
+ |
+ // service_manager::Service: |
+ void OnBindInterface(const service_manager::ServiceInfo& source_info, |
+ const std::string& interface_name, |
+ mojo::ScopedMessagePipeHandle interface_pipe) override; |
+ |
+ // service_manager::InterfaceFactory<test::mojom::Service>: |
+ void Create(const service_manager::Identity& remote_identity, |
+ mojom::ServiceRequest request) override; |
+ |
+ // test::mojom::Service |
+ void ShareBufferToTestReceiver(mojom::ReceiverPtr receiver) override; |
+ |
+ private: |
+ service_manager::BinderRegistry registry_; |
+ mojo::BindingSet<mojom::Service> service_bindings_; |
+ |
+ mojom::ReceiverPtr test_receiver_; |
+ base::SharedMemory shared_memory_; |
+}; |
+ |
+} // namespace test |
+ |
+#endif // SERVICES_TEST_SERVICE_IMPL_H_ |