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

Unified Diff: services/test/service_impl.h

Issue 2829003005: Test service as minimum repro for sharing memory handle (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « services/test/public/interfaces/service.mojom ('k') | services/test/service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « services/test/public/interfaces/service.mojom ('k') | services/test/service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698