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

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

Issue 23379002: Web MIDI: fix multi-threading problem around message buffer handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review #7 and #8 Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_MIDI_MIDI_MANAGER_MAC_H_ 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_MAC_H_
6 #define MEDIA_MIDI_MIDI_MANAGER_MAC_H_ 6 #define MEDIA_MIDI_MIDI_MANAGER_MAC_H_
7 7
8 #include <CoreMIDI/MIDIServices.h> 8 #include <CoreMIDI/MIDIServices.h>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector>
11 12
12 #include "base/basictypes.h" 13 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "media/midi/midi_manager.h" 15 #include "media/midi/midi_manager.h"
15 #include "media/midi/midi_port_info.h" 16 #include "media/midi/midi_port_info.h"
16 17
17 namespace media { 18 namespace media {
18 19
19 class MEDIA_EXPORT MIDIManagerMac : public MIDIManager { 20 class MEDIA_EXPORT MIDIManagerMac : public MIDIManager {
20 public: 21 public:
21 MIDIManagerMac(); 22 MIDIManagerMac();
22 virtual ~MIDIManagerMac(); 23 virtual ~MIDIManagerMac();
23 24
24 // MIDIManager implementation. 25 // MIDIManager implementation.
25 virtual bool Initialize() OVERRIDE; 26 virtual bool Initialize() OVERRIDE;
26 virtual void SendMIDIData(MIDIManagerClient* client, 27 virtual void SendMIDIData(MIDIManagerClient* client,
27 int port_index, 28 size_t port_index,
palmer 2013/08/26 17:43:25 uint32_t
Takashi Toyoshima 2013/08/27 07:14:33 Done.
28 const uint8* data, 29 const std::vector<uint8>& data,
29 size_t length,
30 double timestamp) OVERRIDE; 30 double timestamp) OVERRIDE;
31 31
32 private: 32 private:
33 // CoreMIDI callback for MIDI data. 33 // CoreMIDI callback for MIDI data.
34 // Each callback can contain multiple packets, each of which can contain 34 // Each callback can contain multiple packets, each of which can contain
35 // multiple MIDI messages. 35 // multiple MIDI messages.
36 static void ReadMidiDispatch( 36 static void ReadMidiDispatch(
37 const MIDIPacketList *pktlist, 37 const MIDIPacketList *pktlist,
38 void *read_proc_refcon, 38 void *read_proc_refcon,
39 void *src_conn_refcon); 39 void *src_conn_refcon);
(...skipping 21 matching lines...) Expand all
61 61
62 // Keeps track of all destinations. 62 // Keeps track of all destinations.
63 std::vector<MIDIEndpointRef> destinations_; 63 std::vector<MIDIEndpointRef> destinations_;
64 64
65 DISALLOW_COPY_AND_ASSIGN(MIDIManagerMac); 65 DISALLOW_COPY_AND_ASSIGN(MIDIManagerMac);
66 }; 66 };
67 67
68 } // namespace media 68 } // namespace media
69 69
70 #endif // MEDIA_MIDI_MIDI_MANAGER_MAC_H_ 70 #endif // MEDIA_MIDI_MIDI_MANAGER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698