blob: 4b21ea667fba1f6818bbbab8abd6c4df17309f8a [file] [log] [blame]
Prashant Malani224d3ca2017-03-14 12:44:11 -07001// Copyright 2017 The Chromium OS 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
Prashant Malanid91f4892017-03-22 14:06:44 -07005#include <base/memory/ptr_util.h>
6
Prashant Malani224d3ca2017-03-14 12:44:11 -07007#include "midis/daemon.h"
8
9namespace midis {
10
Prashant Malanif07c9522017-04-11 14:54:29 -070011Daemon::Daemon()
12 : device_tracker_(base::MakeUnique<DeviceTracker>()),
13 client_tracker_(base::MakeUnique<ClientTracker>()) {}
Prashant Malani224d3ca2017-03-14 12:44:11 -070014
15Daemon::~Daemon() {}
16
17int Daemon::OnInit() {
18 if (!device_tracker_->InitDeviceTracker()) {
19 return -1;
20 }
21
Prashant Malani3de29872017-04-28 16:01:56 -070022 if (!client_tracker_->InitClientTracker(device_tracker_.get())) {
Prashant Malanif07c9522017-04-11 14:54:29 -070023 return -1;
24 }
25
Prashant Malani224d3ca2017-03-14 12:44:11 -070026 return 0;
27}
28
29} // namespace midis