From 3dcb475f8fbe8b866657cd577a7c5efdddc8c94d Mon Sep 17 00:00:00 2001 From: toyoshim Date: Mon, 20 Oct 2014 09:36:05 -0700 Subject: [PATCH] Web MIDI: use new Blink APIs to be free from depracated ones This is the second step to update the Blink APIs. To remove old Blink APIs that do not have isActive flag, update all callers to specify the isActive flag. The first change to add the new Blink APIs is https://codereview.chromium.org/649683006/ BUG=279097 TBR=scherkus@chromium.org Review URL: https://codereview.chromium.org/661323002 Cr-Commit-Position: refs/heads/master@{#300276} --- content/renderer/media/midi_message_filter.cc | 7 +++++-- content/shell/renderer/test_runner/mock_web_midi_accessor.cc | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc index e6a7f8067bef..165451a50f69 100644 --- a/content/renderer/media/midi_message_filter.cc +++ b/content/renderer/media/midi_message_filter.cc @@ -121,12 +121,14 @@ void MidiMessageFilter::HandleSessionStarted( if (result == media::MIDI_OK) { // Add the client's input and output ports. + const bool active = true; for (size_t i = 0; i < inputs.size(); ++i) { client->didAddInputPort( base::UTF8ToUTF16(inputs[i].id), base::UTF8ToUTF16(inputs[i].manufacturer), base::UTF8ToUTF16(inputs[i].name), - base::UTF8ToUTF16(inputs[i].version)); + base::UTF8ToUTF16(inputs[i].version), + active); } for (size_t i = 0; i < outputs.size(); ++i) { @@ -134,7 +136,8 @@ void MidiMessageFilter::HandleSessionStarted( base::UTF8ToUTF16(outputs[i].id), base::UTF8ToUTF16(outputs[i].manufacturer), base::UTF8ToUTF16(outputs[i].name), - base::UTF8ToUTF16(outputs[i].version)); + base::UTF8ToUTF16(outputs[i].version), + active); } } std::string error; diff --git a/content/shell/renderer/test_runner/mock_web_midi_accessor.cc b/content/shell/renderer/test_runner/mock_web_midi_accessor.cc index c1300193965f..28ac74f89f85 100644 --- a/content/shell/renderer/test_runner/mock_web_midi_accessor.cc +++ b/content/shell/renderer/test_runner/mock_web_midi_accessor.cc @@ -46,14 +46,17 @@ MockWebMIDIAccessor::~MockWebMIDIAccessor() { void MockWebMIDIAccessor::startSession() { // Add a mock input and output port. + const bool active = true; client_->didAddInputPort("MockInputID", "MockInputManufacturer", "MockInputName", - "MockInputVersion"); + "MockInputVersion", + active); client_->didAddOutputPort("MockOutputID", "MockOutputManufacturer", "MockOutputName", - "MockOutputVersion"); + "MockOutputVersion", + active); interfaces_->GetDelegate()->PostTask(new DidStartSessionTask( this, client_, interfaces_->GetTestRunner()->midiAccessorResult())); } -- 2.11.4.GIT