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

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

Issue 165333004: Revert "Allow MessageFilters to restrict listening to specific message classes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 : BrowserMessageFilter(MidiMsgStart), 19 : render_process_id_(render_process_id),
20 render_process_id_(render_process_id),
21 browser_context_(browser_context) { 20 browser_context_(browser_context) {
22 } 21 }
23 22
24 MidiDispatcherHost::~MidiDispatcherHost() { 23 MidiDispatcherHost::~MidiDispatcherHost() {
25 } 24 }
26 25
27 bool MidiDispatcherHost::OnMessageReceived(const IPC::Message& message, 26 bool MidiDispatcherHost::OnMessageReceived(const IPC::Message& message,
28 bool* message_was_ok) { 27 bool* message_was_ok) {
29 bool handled = true; 28 bool handled = true;
30 IPC_BEGIN_MESSAGE_MAP_EX(MidiDispatcherHost, message, *message_was_ok) 29 IPC_BEGIN_MESSAGE_MAP_EX(MidiDispatcherHost, message, *message_was_ok)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 70 }
72 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id, 71 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id,
73 int bridge_id, 72 int bridge_id,
74 bool success) { 73 bool success) {
75 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage( 74 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage(
76 render_process_id_); 75 render_process_id_);
77 Send(new MidiMsg_SysExPermissionApproved(render_view_id, bridge_id, success)); 76 Send(new MidiMsg_SysExPermissionApproved(render_view_id, bridge_id, success));
78 } 77 }
79 78
80 } // namespace content 79 } // 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