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

Side by Side Diff: media/midi/midi_manager_winrt.h

Issue 2243183002: Web MIDI backend for Windows 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 MEDIA_MIDI_MIDI_MANAGER_WINRT_H_
6 #define MEDIA_MIDI_MIDI_MANAGER_WINRT_H_
7
8 #include <memory>
9
10 #include "base/threading/thread.h"
11 #include "media/midi/midi_manager.h"
12 #include "media/midi/midi_scheduler.h"
13
14 namespace media {
15 namespace midi {
16
17 class MIDI_EXPORT MidiManagerWinrt final : public MidiManager {
18 public:
19 MidiManagerWinrt();
20 ~MidiManagerWinrt() override;
21
22 // MidiManager overrides:
23 void StartInitialization() final;
24 void Finalize() final;
25 void DispatchSendMidiData(MidiManagerClient* client,
26 uint32_t port_index,
27 const std::vector<uint8_t>& data,
28 double timestamp) final;
29
30 private:
31 // Callbacks on the COM thread.
32 void AssertOnComThread();
33 void InitializeOnComThread();
34 void PostSendDataTaskOnComThread(MidiManagerClient* client,
35 uint32_t port_index,
36 const std::vector<uint8_t>& data,
37 double timestamp);
38 void SendOnComThread(uint32_t port_index, const std::vector<uint8_t>& data);
39
40 // Subclasses that access protected members of MidiManager.
41 class MidiInPortManager;
42 class MidiOutPortManager;
43
44 std::unique_ptr<MidiInPortManager> port_manager_in_;
45 std::unique_ptr<MidiOutPortManager> port_manager_out_;
46
47 std::unique_ptr<MidiScheduler> scheduler_;
48
49 // COM-initialized thread for calling WinRT methods.
50 base::Thread com_thread_;
51
52 DISALLOW_COPY_AND_ASSIGN(MidiManagerWinrt);
53 };
54
55 } // namespace midi
56 } // namespace media
57
58 #endif // MEDIA_MIDI_MIDI_MANAGER_WINRT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698