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

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

Issue 2404443002: Web MIDI: use midi_service.mojom for media::midi::Result (Closed)
Patch Set: rebase Created 4 years, 2 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
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 "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 #include <ks.h> 8 #include <ks.h>
9 #include <ksmedia.h> 9 #include <ksmedia.h>
10 #include <mmreg.h> 10 #include <mmreg.h>
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 // Start monitoring device changes. This should start before the 501 // Start monitoring device changes. This should start before the
502 // following UpdateDeviceList() call not to miss the event happening 502 // following UpdateDeviceList() call not to miss the event happening
503 // between the call and the observer registration. 503 // between the call and the observer registration.
504 base::SystemMonitor::Get()->AddDevicesChangedObserver(this); 504 base::SystemMonitor::Get()->AddDevicesChangedObserver(this);
505 505
506 UpdateDeviceList(); 506 UpdateDeviceList();
507 507
508 task_thread_.task_runner()->PostTask( 508 task_thread_.task_runner()->PostTask(
509 FROM_HERE, 509 FROM_HERE,
510 base::Bind(&MidiServiceWinImpl::CompleteInitializationOnTaskThread, 510 base::Bind(&MidiServiceWinImpl::CompleteInitializationOnTaskThread,
511 base::Unretained(this), Result::OK)); 511 base::Unretained(this), mojom::Result::OK));
512 } 512 }
513 513
514 void SendMidiDataAsync(uint32_t port_number, 514 void SendMidiDataAsync(uint32_t port_number,
515 const std::vector<uint8_t>& data, 515 const std::vector<uint8_t>& data,
516 base::TimeTicks time) final { 516 base::TimeTicks time) final {
517 if (destructor_started) { 517 if (destructor_started) {
518 LOG(ERROR) << "ThreadSafeSendData failed because MidiServiceWinImpl is " 518 LOG(ERROR) << "ThreadSafeSendData failed because MidiServiceWinImpl is "
519 "being destructed. port: " << port_number; 519 "being destructed. port: " << port_number;
520 return; 520 return;
521 } 521 }
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1193
1194 MidiManager* MidiManager::Create() { 1194 MidiManager* MidiManager::Create() {
1195 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1195 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1196 switches::kDisableWinrtMidiApi) && 1196 switches::kDisableWinrtMidiApi) &&
1197 base::win::GetVersion() >= base::win::VERSION_WIN10) 1197 base::win::GetVersion() >= base::win::VERSION_WIN10)
1198 return new MidiManagerWinrt(); 1198 return new MidiManagerWinrt();
1199 return new MidiManagerWin(); 1199 return new MidiManagerWin();
1200 } 1200 }
1201 1201
1202 } // namespace midi 1202 } // namespace midi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698