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

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

Issue 329993002: Only grant MidiSysExMessage if needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 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"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 int bridge_id, 65 int bridge_id,
66 const GURL& requesting_frame) { 66 const GURL& requesting_frame) {
67 DCHECK_CURRENTLY_ON(BrowserThread::UI); 67 DCHECK_CURRENTLY_ON(BrowserThread::UI);
68 DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" << render_view_id 68 DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" << render_view_id
69 << ":" << bridge_id; 69 << ":" << bridge_id;
70 browser_context_->CancelMidiSysExPermissionRequest( 70 browser_context_->CancelMidiSysExPermissionRequest(
71 render_process_id_, render_view_id, bridge_id, requesting_frame); 71 render_process_id_, render_view_id, bridge_id, requesting_frame);
72 } 72 }
73 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id, 73 void MidiDispatcherHost::WasSysExPermissionGranted(int render_view_id,
74 int bridge_id, 74 int bridge_id,
75 bool success) { 75 bool is_allowed) {
76 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage( 76 if (is_allowed)
77 render_process_id_); 77 ChildProcessSecurityPolicyImpl::GetInstance()->GrantSendMidiSysExMessage(
78 Send(new MidiMsg_SysExPermissionApproved(render_view_id, bridge_id, success)); 78 render_process_id_);
79 Send(new MidiMsg_SysExPermissionApproved(
80 render_view_id, bridge_id, is_allowed));
79 } 81 }
80 82
81 } // namespace content 83 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/midi_dispatcher_host.h ('k') | content/common/media/midi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698