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

Unified Diff: content/browser/renderer_host/media/midi_dispatcher_host.cc

Issue 20990005: Web MIDI: implement permission infobar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review #2 and #10 Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/midi_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/midi_dispatcher_host.cc b/content/browser/renderer_host/media/midi_dispatcher_host.cc
index 4c673b4f509a2386b81add2bac038e91d1312268..4771eb58cc6fa02eb59e3d4e83f4b9993b42853b 100644
--- a/content/browser/renderer_host/media/midi_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/midi_dispatcher_host.cc
@@ -8,6 +8,7 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/common/media/midi_messages.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
#include "url/gurl.h"
namespace content {
@@ -32,9 +33,17 @@ bool MIDIDispatcherHost::OnMessageReceived(const IPC::Message& message,
return handled;
}
+void MIDIDispatcherHost::OverrideThreadForMessage(
+ const IPC::Message& message, BrowserThread::ID* thread) {
+ if (message.type() == MIDIHostMsg_RequestSysExPermission::ID)
+ *thread = BrowserThread::UI;
+}
+
void MIDIDispatcherHost::OnRequestSysExPermission(int render_view_id,
int client_id,
const GURL& origin) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
browser_context_->RequestMIDISysExPermission(
render_process_id_,
render_view_id,

Powered by Google App Engine
This is Rietveld 408576698