| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromeos/dbus/fake_audio_dsp_client.h" | 5 #include "chromeos/dbus/fake_audio_dsp_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 11 | 13 |
| 12 namespace chromeos { | 14 namespace chromeos { |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 void OnVoidDBusMethod(const VoidDBusMethodCallback& callback) { | 18 void OnVoidDBusMethod(const VoidDBusMethodCallback& callback) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 FROM_HERE, base::Bind(&OnDoubleDBusMethod, callback)); | 101 FROM_HERE, base::Bind(&OnDoubleDBusMethod, callback)); |
| 100 } | 102 } |
| 101 | 103 |
| 102 void FakeAudioDspClient::GetCapabilitiesOEM( | 104 void FakeAudioDspClient::GetCapabilitiesOEM( |
| 103 const ThreeStringDBusMethodCallback& callback) { | 105 const ThreeStringDBusMethodCallback& callback) { |
| 104 base::ThreadTaskRunnerHandle::Get()->PostTask( | 106 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 105 FROM_HERE, base::Bind(&OnThreeStringDBusMethod, callback)); | 107 FROM_HERE, base::Bind(&OnThreeStringDBusMethod, callback)); |
| 106 } | 108 } |
| 107 | 109 |
| 108 void FakeAudioDspClient::SetCapabilitiesOEM( | 110 void FakeAudioDspClient::SetCapabilitiesOEM( |
| 109 uint32 speaker_id, | 111 uint32_t speaker_id, |
| 110 const std::string& speaker_capabilities, | 112 const std::string& speaker_capabilities, |
| 111 const std::string& driver_capabilities, | 113 const std::string& driver_capabilities, |
| 112 const VoidDBusMethodCallback& callback) { | 114 const VoidDBusMethodCallback& callback) { |
| 113 base::ThreadTaskRunnerHandle::Get()->PostTask( | 115 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 114 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); | 116 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); |
| 115 } | 117 } |
| 116 | 118 |
| 117 void FakeAudioDspClient::GetFilterConfigOEM( | 119 void FakeAudioDspClient::GetFilterConfigOEM( |
| 118 uint32 speaker_id, | 120 uint32_t speaker_id, |
| 119 const TwoStringDBusMethodCallback& callback) { | 121 const TwoStringDBusMethodCallback& callback) { |
| 120 base::ThreadTaskRunnerHandle::Get()->PostTask( | 122 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 121 FROM_HERE, base::Bind(&OnTwoStringDBusMethod, callback)); | 123 FROM_HERE, base::Bind(&OnTwoStringDBusMethod, callback)); |
| 122 } | 124 } |
| 123 | 125 |
| 124 void FakeAudioDspClient::SetFilterConfigOEM( | 126 void FakeAudioDspClient::SetFilterConfigOEM( |
| 125 const std::string& speaker_config, | 127 const std::string& speaker_config, |
| 126 const std::string& driver_config, | 128 const std::string& driver_config, |
| 127 const VoidDBusMethodCallback& callback) { | 129 const VoidDBusMethodCallback& callback) { |
| 128 base::ThreadTaskRunnerHandle::Get()->PostTask( | 130 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 129 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); | 131 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); |
| 130 } | 132 } |
| 131 | 133 |
| 132 void FakeAudioDspClient::SetSourceType(uint16 source_type, | 134 void FakeAudioDspClient::SetSourceType(uint16_t source_type, |
| 133 const VoidDBusMethodCallback& callback) { | 135 const VoidDBusMethodCallback& callback) { |
| 134 base::ThreadTaskRunnerHandle::Get()->PostTask( | 136 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 135 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); | 137 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); |
| 136 } | 138 } |
| 137 | 139 |
| 138 void FakeAudioDspClient::AmplifierVolumeChanged( | 140 void FakeAudioDspClient::AmplifierVolumeChanged( |
| 139 double db_spl, | 141 double db_spl, |
| 140 const VoidDBusMethodCallback& callback) { | 142 const VoidDBusMethodCallback& callback) { |
| 141 base::ThreadTaskRunnerHandle::Get()->PostTask( | 143 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 142 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); | 144 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback)); |
| 143 } | 145 } |
| 144 | 146 |
| 145 } // namespace chromeos | 147 } // namespace chromeos |
| OLD | NEW |