| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_winrt.h" | 5 #include "media/midi/midi_manager_winrt.h" |
| 6 | 6 |
| 7 #pragma warning(disable : 4467) | 7 #pragma warning(disable : 4467) |
| 8 | 8 |
| 9 #include <initguid.h> // Required by <devpkey.h> | 9 #include <initguid.h> // Required by <devpkey.h> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 namespace WRL = Microsoft::WRL; | 37 namespace WRL = Microsoft::WRL; |
| 38 | 38 |
| 39 using namespace ABI::Windows::Devices::Enumeration; | 39 using namespace ABI::Windows::Devices::Enumeration; |
| 40 using namespace ABI::Windows::Devices::Midi; | 40 using namespace ABI::Windows::Devices::Midi; |
| 41 using namespace ABI::Windows::Foundation; | 41 using namespace ABI::Windows::Foundation; |
| 42 using namespace ABI::Windows::Storage::Streams; | 42 using namespace ABI::Windows::Storage::Streams; |
| 43 | 43 |
| 44 using base::win::ScopedComPtr; | 44 using base::win::ScopedComPtr; |
| 45 using mojom::Result; |
| 45 | 46 |
| 46 // Helpers for printing HRESULTs. | 47 // Helpers for printing HRESULTs. |
| 47 struct PrintHr { | 48 struct PrintHr { |
| 48 PrintHr(HRESULT hr) : hr(hr) {} | 49 PrintHr(HRESULT hr) : hr(hr) {} |
| 49 HRESULT hr; | 50 HRESULT hr; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 std::ostream& operator<<(std::ostream& os, const PrintHr& phr) { | 53 std::ostream& operator<<(std::ostream& os, const PrintHr& phr) { |
| 53 std::ios_base::fmtflags ff = os.flags(); | 54 std::ios_base::fmtflags ff = os.flags(); |
| 54 os << _com_error(phr.hr).ErrorMessage() << " (0x" << std::hex | 55 os << _com_error(phr.hr).ErrorMessage() << " (0x" << std::hex |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 | 1039 |
| 1039 void MidiManagerWinrt::OnPortManagerReady() { | 1040 void MidiManagerWinrt::OnPortManagerReady() { |
| 1040 DCHECK(com_thread_checker_->CalledOnValidThread()); | 1041 DCHECK(com_thread_checker_->CalledOnValidThread()); |
| 1041 DCHECK(port_manager_ready_count_ < 2); | 1042 DCHECK(port_manager_ready_count_ < 2); |
| 1042 | 1043 |
| 1043 if (++port_manager_ready_count_ == 2) | 1044 if (++port_manager_ready_count_ == 2) |
| 1044 CompleteInitialization(Result::OK); | 1045 CompleteInitialization(Result::OK); |
| 1045 } | 1046 } |
| 1046 | 1047 |
| 1047 } // namespace midi | 1048 } // namespace midi |
| OLD | NEW |