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

Unified Diff: content/renderer/media/midi_message_filter.cc

Issue 18309004: Web MIDI: prepare to pass a security origin from blink to browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/midi_message_filter.cc
diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc
index 73b261d4ff50ec666857d101b0de1dd49928fa5c..44738dcd54232ce817b187d8cf4663867fb7f618 100644
--- a/content/renderer/media/midi_message_filter.cc
+++ b/content/renderer/media/midi_message_filter.cc
@@ -65,8 +65,9 @@ void MIDIMessageFilter::OnChannelClosing() {
channel_ = NULL;
}
-void MIDIMessageFilter::RequestAccess(
- WebKit::WebMIDIAccessorClient* client, int access) {
+void MIDIMessageFilter::RequestAccess(const std::string& origin,
+ WebKit::WebMIDIAccessorClient* client,
+ int access) {
// Generate and keep track of a "client id" which is sent to the browser
// to ask permission to talk to MIDI hardware.
// This id is handed back when we receive the answer in OnAccessApproved().
@@ -75,13 +76,15 @@ void MIDIMessageFilter::RequestAccess(
clients_[client] = client_id;
io_message_loop_->PostTask(FROM_HERE,
- base::Bind(&MIDIMessageFilter::RequestAccessOnIOThread, this,
+ base::Bind(&MIDIMessageFilter::RequestAccessOnIOThread, this, origin,
client_id, access));
}
}
-void MIDIMessageFilter::RequestAccessOnIOThread(int client_id, int access) {
- Send(new MIDIHostMsg_RequestAccess(client_id, access));
+void MIDIMessageFilter::RequestAccessOnIOThread(const std::string& origin,
+ int client_id,
+ int access) {
+ Send(new MIDIHostMsg_RequestAccess(origin, client_id, access));
}
void MIDIMessageFilter::RemoveClient(WebKit::WebMIDIAccessorClient* client) {
« no previous file with comments | « content/renderer/media/midi_message_filter.h ('k') | content/renderer/media/renderer_webmidiaccessor_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698