forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.h
64 lines (49 loc) · 1.8 KB
/
init.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// 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 MASH_INIT_INIT_H_
#define MASH_INIT_INIT_H_
#include <map>
#include <memory>
#include "base/callback.h"
#include "base/macros.h"
#include "mash/init/public/interfaces/init.mojom.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_factory.h"
#include "services/service_manager/public/cpp/service.h"
namespace service_manager {
class Connection;
}
namespace mash {
namespace init {
class Init : public service_manager::Service,
public service_manager::InterfaceFactory<mojom::Init>,
public mojom::Init {
public:
Init();
~Init() override;
private:
// service_manager::Service:
void OnStart() override;
bool OnConnect(const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) override;
// service_manager::InterfaceFactory<mojom::Login>:
void Create(const service_manager::Identity& remote_identity,
mojom::InitRequest request) override;
// mojom::Init:
void StartService(const std::string& name,
const std::string& user_id) override;
void StopServicesForUser(const std::string& user_id) override;
void UserServiceQuit(const std::string& user_id);
void StartTracing();
void StartLogin();
std::unique_ptr<service_manager::Connection> login_connection_;
mojo::BindingSet<mojom::Init> init_bindings_;
std::map<std::string, std::unique_ptr<service_manager::Connection>>
user_services_;
DISALLOW_COPY_AND_ASSIGN(Init);
};
} // namespace init
} // namespace mash
#endif // MASH_INIT_INIT_H_