forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arc_midis_client.h
45 lines (34 loc) · 1.35 KB
/
arc_midis_client.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
// Copyright 2017 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 CHROMEOS_DBUS_ARC_MIDIS_CLIENT_H_
#define CHROMEOS_DBUS_ARC_MIDIS_CLIENT_H_
#include <memory>
#include <string>
#include "base/callback_forward.h"
#include "base/component_export.h"
#include "base/files/scoped_file.h"
#include "base/macros.h"
#include "chromeos/dbus/dbus_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
namespace chromeos {
// ArcMidisClient is used to pass an FD to the midis daemon for the purpose
// of setting up a Mojo channel. It is expected to be called once during browser
// initialization.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ArcMidisClient : public DBusClient {
public:
~ArcMidisClient() override = default;
// Factory function.
static std::unique_ptr<ArcMidisClient> Create();
// Bootstrap the Mojo connection between Chrome and the MIDI service.
// Should pass in the child end of the Mojo pipe.
virtual void BootstrapMojoConnection(base::ScopedFD fd,
VoidDBusMethodCallback callback) = 0;
protected:
// Create() should be used instead.
ArcMidisClient() = default;
private:
DISALLOW_COPY_AND_ASSIGN(ArcMidisClient);
};
} // namespace chromeos
#endif // CHROMEOS_DBUS_ARC_MIDIS_CLIENT_H_