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

Side by Side Diff: content/browser/renderer_host/media/midi_dispatcher_host.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
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 #include "content/browser/renderer_host/media/midi_dispatcher_host.h" 5 #include "content/browser/renderer_host/media/midi_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/child_process_security_policy_impl.h" 8 #include "content/browser/child_process_security_policy_impl.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/common/media/midi_messages.h" 10 #include "content/common/media/midi_messages.h"
11 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 MidiDispatcherHost::MidiDispatcherHost(int render_process_id, 17 MidiDispatcherHost::MidiDispatcherHost(int render_process_id,
18 BrowserContext* browser_context) 18 BrowserContext* browser_context)
19 : render_process_id_(render_process_id), 19 : BrowserMessageFilter(MidiMsgStart),
20 render_process_id_(render_process_id),
20 browser_context_(browser_context) { 21 browser_context_(browser_context) {
21 } 22 }
22 23
23 MidiDispatcherHost::~MidiDispatcherHost() { 24 MidiDispatcherHost::~MidiDispatcherHost() {
24 } 25 }
25 26
26 bool MidiDispatcherHost::OnMessageReceived(const IPC::Message& message, 27 bool MidiDispatcherHost::OnMessageReceived(const IPC::Message& message,
27 bool* message_was_ok) { 28 bool* message_was_ok) {
28 bool handled = true; 29 bool handled = true;
29 IPC_BEGIN_MESSAGE_MAP_EX(MidiDispatcherHost, message, *message_was_ok) 30 IPC_BEGIN_MESSAGE_MAP_EX(MidiDispatcherHost, message, *message_was_ok)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 71 }
71 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id, 72 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id,
72 int bridge_id, 73 int bridge_id,
73 bool success) { 74 bool success) {
74 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage( 75 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage(
75 render_process_id_); 76 render_process_id_);
76 Send(new MidiMsg_SysExPermissionApproved(render_view_id, bridge_id, success)); 77 Send(new MidiMsg_SysExPermissionApproved(render_view_id, bridge_id, success));
77 } 78 }
78 79
79 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_stream_dispatcher_host.cc ('k') | content/browser/renderer_host/media/midi_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698