Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_HOST_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_HOST_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 #include "content/public/browser/browser_message_filter.h" | |
| 12 #include "content/public/browser/browser_thread.h" | |
| 13 #include "media/midi/midi_manager.h" | |
| 14 | |
| 15 namespace media { | |
| 16 class MIDIManager; | |
| 17 } | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 class CONTENT_EXPORT MIDIHost : public BrowserMessageFilter, | |
| 22 public media::MIDIManager::Client { | |
| 23 public: | |
| 24 // Called from UI thread from the owner of this object. | |
| 25 MIDIHost(media::MIDIManager* midi_manager); | |
| 26 | |
| 27 // BrowserMessageFilter implementation. | |
| 28 virtual void OnChannelClosing() OVERRIDE; | |
| 29 virtual void OnDestruct() const OVERRIDE; | |
| 30 virtual bool OnMessageReceived(const IPC::Message& message, | |
| 31 bool* message_was_ok) OVERRIDE; | |
| 32 | |
| 33 // MIDIManager::Client | |
| 34 virtual void ReceiveMIDIData( | |
|
scherkus (not reviewing)
2013/06/03 22:44:59
note: called on high-priority audio thread
| |
| 35 int port_index, | |
| 36 const uint8* data, | |
| 37 size_t length, | |
| 38 double timeStampSeconds) OVERRIDE; | |
| 39 | |
| 40 // Play the audio stream referenced by |stream_id|. | |
| 41 void OnRequestAccess(); | |
| 42 | |
| 43 private: | |
| 44 friend class base::DeleteHelper<MIDIHost>; | |
| 45 | |
| 46 friend class BrowserThread; | |
| 47 | |
| 48 virtual ~MIDIHost(); | |
| 49 | |
| 50 // Methods called on IO thread ---------------------------------------------- | |
| 51 | |
| 52 // Audio related IPC message handlers. | |
| 53 | |
| 54 media::MIDIManager* const midi_manager_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(MIDIHost); | |
| 57 }; | |
| 58 | |
| 59 } // namespace content | |
| 60 | |
| 61 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_HOST_H_ | |
| OLD | NEW |