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

Side by Side Diff: media/midi/midi_manager_win.cc

Issue 2926143003: Web MIDI: restore sysex receiving buffer synchronously (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "media/midi/midi_manager_win.h" 5 #include "media/midi/midi_manager_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <ks.h> 9 #include <ks.h>
10 #include <ksmedia.h> 10 #include <ksmedia.h>
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 DCHECK_EQ(static_cast<UINT>(MIM_LONGDATA), msg); 653 DCHECK_EQ(static_cast<UINT>(MIM_LONGDATA), msg);
654 LPMIDIHDR hdr = reinterpret_cast<LPMIDIHDR>(param1); 654 LPMIDIHDR hdr = reinterpret_cast<LPMIDIHDR>(param1);
655 if (hdr->dwBytesRecorded > 0) { 655 if (hdr->dwBytesRecorded > 0) {
656 const uint8_t* src = reinterpret_cast<const uint8_t*>(hdr->lpData); 656 const uint8_t* src = reinterpret_cast<const uint8_t*>(hdr->lpData);
657 std::vector<uint8_t> data; 657 std::vector<uint8_t> data;
658 data.assign(src, src + hdr->dwBytesRecorded); 658 data.assign(src, src + hdr->dwBytesRecorded);
659 manager->PostReplyTask(base::Bind( 659 manager->PostReplyTask(base::Bind(
660 &MidiManagerWin::ReceiveMidiData, base::Unretained(manager), index, 660 &MidiManagerWin::ReceiveMidiData, base::Unretained(manager), index,
661 data, manager->port_manager()->CalculateInEventTime(index, param2))); 661 data, manager->port_manager()->CalculateInEventTime(index, param2)));
662 } 662 }
663 manager->PostTask(base::Bind(&MidiManagerWin::PortManager::RestoreInBuffer, 663 manager->port_manager()->RestoreInBuffer(index);
664 base::Unretained(manager->port_manager()),
665 index));
666 } 664 }
667 } 665 }
668 666
669 void CALLBACK 667 void CALLBACK
670 MidiManagerWin::PortManager::HandleMidiOutCallback(HMIDIOUT hmo, 668 MidiManagerWin::PortManager::HandleMidiOutCallback(HMIDIOUT hmo,
671 UINT msg, 669 UINT msg,
672 DWORD_PTR instance, 670 DWORD_PTR instance,
673 DWORD_PTR param1, 671 DWORD_PTR param1,
674 DWORD_PTR param2) { 672 DWORD_PTR param2) {
675 if (msg == MOM_DONE) { 673 if (msg == MOM_DONE) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 876
879 MidiManager* MidiManager::Create(MidiService* service) { 877 MidiManager* MidiManager::Create(MidiService* service) {
880 if (base::FeatureList::IsEnabled(features::kMidiManagerWinrt) && 878 if (base::FeatureList::IsEnabled(features::kMidiManagerWinrt) &&
881 base::win::GetVersion() >= base::win::VERSION_WIN10) { 879 base::win::GetVersion() >= base::win::VERSION_WIN10) {
882 return new MidiManagerWinrt(service); 880 return new MidiManagerWinrt(service);
883 } 881 }
884 return new MidiManagerWin(service); 882 return new MidiManagerWin(service);
885 } 883 }
886 884
887 } // namespace midi 885 } // namespace midi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698