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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 #ifndef SERVICES_TEST_SERVICE_IMPL_H_
6 #define SERVICES_TEST_SERVICE_IMPL_H_
7
8 #include <memory>
9
10 #include "base/memory/shared_memory.h"
11 #include "mojo/public/cpp/bindings/binding_set.h"
12 #include "services/service_manager/public/cpp/binder_registry.h"
13 #include "services/service_manager/public/cpp/interface_factory.h"
14 #include "services/service_manager/public/cpp/service.h"
15 #include "services/test/public/interfaces/service.mojom.h"
16
17 namespace test {
18
19 class ServiceImpl : public service_manager::Service,
20 public service_manager::InterfaceFactory<mojom::Service>,
21 public mojom::Service {
22 public:
23 ServiceImpl();
24 ~ServiceImpl() override;
25
26 // service_manager::Service:
27 void OnBindInterface(const service_manager::ServiceInfo& source_info,
28 const std::string& interface_name,
29 mojo::ScopedMessagePipeHandle interface_pipe) override;
30
31 // service_manager::InterfaceFactory<test::mojom::Service>:
32 void Create(const service_manager::Identity& remote_identity,
33 mojom::ServiceRequest request) override;
34
35 // test::mojom::Service
36 void ShareBufferToTestReceiver(mojom::ReceiverPtr receiver) override;
37
38 private:
39 service_manager::BinderRegistry registry_;
40 mojo::BindingSet<mojom::Service> service_bindings_;
41
42 mojom::ReceiverPtr test_receiver_;
43 base::SharedMemory shared_memory_;
44 };
45
46 } // namespace test
47
48 #endif // SERVICES_TEST_SERVICE_IMPL_H_
OLDNEW
« 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