OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class BrowserContext; | 14 class BrowserContext; |
15 | 15 |
16 // MIDIDispatcherHost handles permissions for using system exclusive messages. | 16 // MIDIDispatcherHost handles permissions for using system exclusive messages. |
17 // It works as BrowserMessageFilter to handle IPC messages between | 17 // It works as BrowserMessageFilter to handle IPC messages between |
18 // MIDIDispatcher running as a RenderViewObserver. | 18 // MIDIDispatcher running as a RenderViewObserver. |
19 class MIDIDispatcherHost : public BrowserMessageFilter { | 19 class MIDIDispatcherHost : public BrowserMessageFilter { |
20 public: | 20 public: |
21 MIDIDispatcherHost(int render_process_id, BrowserContext* browser_context); | 21 MIDIDispatcherHost(int render_process_id, BrowserContext* browser_context); |
22 | 22 |
23 // BrowserMessageFilter implementation. | 23 // BrowserMessageFilter implementation. |
24 virtual bool OnMessageReceived(const IPC::Message& message, | 24 virtual bool OnMessageReceived(const IPC::Message& message, |
25 bool* message_was_ok) OVERRIDE; | 25 bool* message_was_ok) OVERRIDE; |
| 26 virtual void OverrideThreadForMessage( |
| 27 const IPC::Message& message, BrowserThread::ID* thread) OVERRIDE; |
26 | 28 |
27 protected: | 29 protected: |
28 virtual ~MIDIDispatcherHost(); | 30 virtual ~MIDIDispatcherHost(); |
29 | 31 |
30 private: | 32 private: |
31 void OnRequestSysExPermission(int render_view_id, | 33 void OnRequestSysExPermission(int render_view_id, |
32 int client_id, | 34 int client_id, |
33 const GURL& origin); | 35 const GURL& origin); |
34 void WasSysExPermissionGranted(int render_view_id, | 36 void WasSysExPermissionGranted(int render_view_id, |
35 int client_id, | 37 int client_id, |
36 bool success); | 38 bool success); |
37 | 39 |
38 int render_process_id_; | 40 int render_process_id_; |
39 BrowserContext* browser_context_; | 41 BrowserContext* browser_context_; |
40 | 42 |
41 DISALLOW_COPY_AND_ASSIGN(MIDIDispatcherHost); | 43 DISALLOW_COPY_AND_ASSIGN(MIDIDispatcherHost); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace content | 46 } // namespace content |
45 | 47 |
46 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ | 48 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MIDI_DISPATCHER_HOST_H_ |
OLD | NEW |