diff options
author | avi <avi@chromium.org> | 2015-12-20 19:43:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-21 03:44:30 +0000 |
commit | 6e1a22dbf2f897399d459f0e1a813decf02ff002 (patch) | |
tree | 1514d498779a6799f72b1f0310c7c54ec533494b /chromeos/audio | |
parent | 77bc325cc5c97ebff1d447ac972fd02e2aec4155 (diff) | |
download | chromium_src-6e1a22dbf2f897399d459f0e1a813decf02ff002.zip chromium_src-6e1a22dbf2f897399d459f0e1a813decf02ff002.tar.gz chromium_src-6e1a22dbf2f897399d459f0e1a813decf02ff002.tar.bz2 |
Switch to standard integer types in chromeos/.
BUG=138542
TBR=zelidrag@chromium.org
Review URL: https://codereview.chromium.org/1540803002
Cr-Commit-Position: refs/heads/master@{#366324}
Diffstat (limited to 'chromeos/audio')
-rw-r--r-- | chromeos/audio/audio_device.cc | 4 | ||||
-rw-r--r-- | chromeos/audio/audio_device.h | 11 | ||||
-rw-r--r-- | chromeos/audio/audio_devices_pref_handler.h | 1 | ||||
-rw-r--r-- | chromeos/audio/audio_devices_pref_handler_impl.cc | 4 | ||||
-rw-r--r-- | chromeos/audio/audio_devices_pref_handler_impl.h | 1 | ||||
-rw-r--r-- | chromeos/audio/audio_devices_pref_handler_impl_unittest.cc | 13 | ||||
-rw-r--r-- | chromeos/audio/audio_devices_pref_handler_stub.h | 2 | ||||
-rw-r--r-- | chromeos/audio/audio_pref_observer.h | 1 | ||||
-rw-r--r-- | chromeos/audio/cras_audio_handler.cc | 3 | ||||
-rw-r--r-- | chromeos/audio/cras_audio_handler.h | 2 | ||||
-rw-r--r-- | chromeos/audio/cras_audio_handler_unittest.cc | 44 |
11 files changed, 52 insertions, 34 deletions
diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc index 27109ed..5374194 100644 --- a/chromeos/audio/audio_device.cc +++ b/chromeos/audio/audio_device.cc @@ -4,6 +4,8 @@ #include "chromeos/audio/audio_device.h" +#include <stdint.h> + #include "base/format_macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -15,7 +17,7 @@ namespace { // Get the priority for a particular device type. The priority returned // will be between 0 to 3, the higher number meaning a higher priority. -uint8 GetDevicePriority(AudioDeviceType type, bool is_input) { +uint8_t GetDevicePriority(AudioDeviceType type, bool is_input) { // Lower the priority of bluetooth mic to prevent unexpected bad eperience // to user because of bluetooth audio profile switching. Make priority to // zero so this mic will never be automatically chosen. diff --git a/chromeos/audio/audio_device.h b/chromeos/audio/audio_device.h index 240f892b1..ee47ee5 100644 --- a/chromeos/audio/audio_device.h +++ b/chromeos/audio/audio_device.h @@ -5,11 +5,12 @@ #ifndef CHROMEOS_AUDIO_AUDIO_DEVICE_H_ #define CHROMEOS_AUDIO_AUDIO_DEVICE_H_ +#include <stdint.h> + #include <map> #include <string> #include <vector> -#include "base/basictypes.h" #include "chromeos/chromeos_export.h" #include "chromeos/dbus/audio_node.h" @@ -56,18 +57,18 @@ struct CHROMEOS_EXPORT AudioDevice { } bool is_input; - uint64 id; + uint64_t id; std::string display_name; std::string device_name; std::string mic_positions; AudioDeviceType type; - uint8 priority; + uint8_t priority; bool active; - uint64 plugged_time; + uint64_t plugged_time; }; typedef std::vector<AudioDevice> AudioDeviceList; -typedef std::map<uint64, AudioDevice> AudioDeviceMap; +typedef std::map<uint64_t, AudioDevice> AudioDeviceMap; struct AudioDeviceCompare { // Rules used to discern which device is higher, diff --git a/chromeos/audio/audio_devices_pref_handler.h b/chromeos/audio/audio_devices_pref_handler.h index dfa582e..2347aad 100644 --- a/chromeos/audio/audio_devices_pref_handler.h +++ b/chromeos/audio/audio_devices_pref_handler.h @@ -5,7 +5,6 @@ #ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_H_ -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "chromeos/audio/audio_pref_observer.h" #include "chromeos/chromeos_export.h" diff --git a/chromeos/audio/audio_devices_pref_handler_impl.cc b/chromeos/audio/audio_devices_pref_handler_impl.cc index 17b5681..45aa433 100644 --- a/chromeos/audio/audio_devices_pref_handler_impl.cc +++ b/chromeos/audio/audio_devices_pref_handler_impl.cc @@ -4,6 +4,8 @@ #include "chromeos/audio/audio_devices_pref_handler_impl.h" +#include <stdint.h> + #include <algorithm> #include "base/bind.h" @@ -32,7 +34,7 @@ const int kPrefMuteOn = 1; std::string GetDeviceIdString(const chromeos::AudioDevice& device) { std::string device_id_string = device.device_name + " : " + - base::Uint64ToString(device.id & static_cast<uint64>(0xffffffff)) + + base::Uint64ToString(device.id & static_cast<uint64_t>(0xffffffff)) + " : " + (device.is_input ? "1" : "0"); // Replace any periods from the device id string with a space, since setting // names cannot contain periods. diff --git a/chromeos/audio/audio_devices_pref_handler_impl.h b/chromeos/audio/audio_devices_pref_handler_impl.h index 72dc335..7d30552 100644 --- a/chromeos/audio/audio_devices_pref_handler_impl.h +++ b/chromeos/audio/audio_devices_pref_handler_impl.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" #include "base/values.h" diff --git a/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc b/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc index ba87132..a4a97da 100644 --- a/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc +++ b/chromeos/audio/audio_devices_pref_handler_impl_unittest.cc @@ -4,6 +4,9 @@ #include "chromeos/audio/audio_devices_pref_handler_impl.h" +#include <stdint.h> + +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/prefs/testing_pref_service.h" #include "chromeos/audio/audio_device.h" @@ -14,11 +17,11 @@ namespace chromeos { -const uint64 kInternalMicId = 10003; -const uint64 kHeadphoneId = 10002; -const uint64 kHDMIOutputId = 10006; -const uint64 kOtherTypeOutputId = 90001; -const uint64 kOtherTypeInputId = 90002; +const uint64_t kInternalMicId = 10003; +const uint64_t kHeadphoneId = 10002; +const uint64_t kHDMIOutputId = 10006; +const uint64_t kOtherTypeOutputId = 90001; +const uint64_t kOtherTypeInputId = 90002; const AudioDevice kInternalMic(AudioNode(true, kInternalMicId, diff --git a/chromeos/audio/audio_devices_pref_handler_stub.h b/chromeos/audio/audio_devices_pref_handler_stub.h index 4cb5d5f..6efe238 100644 --- a/chromeos/audio/audio_devices_pref_handler_stub.h +++ b/chromeos/audio/audio_devices_pref_handler_stub.h @@ -5,6 +5,8 @@ #ifndef CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ #define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_ +#include <stdint.h> + #include <map> #include "base/macros.h" diff --git a/chromeos/audio/audio_pref_observer.h b/chromeos/audio/audio_pref_observer.h index 52393d4..b183ebfe 100644 --- a/chromeos/audio/audio_pref_observer.h +++ b/chromeos/audio/audio_pref_observer.h @@ -5,7 +5,6 @@ #ifndef CHROMEOS_AUDIO_AUDIO_PREF_OBSERVER_H_ #define CHROMEOS_AUDIO_AUDIO_PREF_OBSERVER_H_ -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "chromeos/chromeos_export.h" diff --git a/chromeos/audio/cras_audio_handler.cc b/chromeos/audio/cras_audio_handler.cc index 8ee6009..970c78c 100644 --- a/chromeos/audio/cras_audio_handler.cc +++ b/chromeos/audio/cras_audio_handler.cc @@ -4,6 +4,9 @@ #include "chromeos/audio/cras_audio_handler.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <cmath> diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h index a12e5ae4..39e4ac8 100644 --- a/chromeos/audio/cras_audio_handler.h +++ b/chromeos/audio/cras_audio_handler.h @@ -5,9 +5,11 @@ #ifndef CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ #define CHROMEOS_AUDIO_CRAS_AUDIO_HANDLER_H_ +#include <stddef.h> #include <stdint.h> #include <queue> +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" diff --git a/chromeos/audio/cras_audio_handler_unittest.cc b/chromeos/audio/cras_audio_handler_unittest.cc index 4633d87..46e7d3e 100644 --- a/chromeos/audio/cras_audio_handler_unittest.cc +++ b/chromeos/audio/cras_audio_handler_unittest.cc @@ -4,7 +4,11 @@ #include "chromeos/audio/cras_audio_handler.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" @@ -20,23 +24,23 @@ namespace chromeos { namespace { -const uint64 kInternalSpeakerId = 10001; -const uint64 kHeadphoneId = 10002; -const uint64 kInternalMicId = 10003; -const uint64 kUSBMicId = 10004; -const uint64 kBluetoothHeadsetId = 10005; -const uint64 kHDMIOutputId = 10006; -const uint64 kUSBHeadphoneId1 = 10007; -const uint64 kUSBHeadphoneId2 = 10008; -const uint64 kMicJackId = 10009; -const uint64 kKeyboardMicId = 10010; -const uint64 kOtherTypeOutputId = 90001; -const uint64 kOtherTypeInputId = 90002; -const uint64 kUSBJabraSpeakerOutputId1 = 90003; -const uint64 kUSBJabraSpeakerOutputId2 = 90004; -const uint64 kUSBJabraSpeakerInputId1 = 90005; -const uint64 kUSBJabraSpeakerInputId2 = 90006; -const uint64 kUSBCameraInputId = 90007; +const uint64_t kInternalSpeakerId = 10001; +const uint64_t kHeadphoneId = 10002; +const uint64_t kInternalMicId = 10003; +const uint64_t kUSBMicId = 10004; +const uint64_t kBluetoothHeadsetId = 10005; +const uint64_t kHDMIOutputId = 10006; +const uint64_t kUSBHeadphoneId1 = 10007; +const uint64_t kUSBHeadphoneId2 = 10008; +const uint64_t kMicJackId = 10009; +const uint64_t kKeyboardMicId = 10010; +const uint64_t kOtherTypeOutputId = 90001; +const uint64_t kOtherTypeInputId = 90002; +const uint64_t kUSBJabraSpeakerOutputId1 = 90003; +const uint64_t kUSBJabraSpeakerOutputId2 = 90004; +const uint64_t kUSBJabraSpeakerInputId1 = 90005; +const uint64_t kUSBJabraSpeakerInputId2 = 90006; +const uint64_t kUSBCameraInputId = 90007; const AudioNode kInternalSpeaker( false, @@ -265,12 +269,12 @@ class TestObserver : public chromeos::CrasAudioHandler::AudioObserver { ++input_mute_changed_count_; } - void OnOutputNodeVolumeChanged(uint64 /* node_id */, + void OnOutputNodeVolumeChanged(uint64_t /* node_id */, int /* volume */) override { ++output_volume_changed_count_; } - void OnInputNodeGainChanged(uint64 /* node_id */, int /* gain */) override { + void OnInputNodeGainChanged(uint64_t /* node_id */, int /* gain */) override { ++input_gain_changed_count_; } @@ -341,7 +345,7 @@ class CrasAudioHandlerTest : public testing::Test { message_loop_.RunUntilIdle(); } - const AudioDevice* GetDeviceFromId(uint64 id) { + const AudioDevice* GetDeviceFromId(uint64_t id) { return cras_audio_handler_->GetDeviceFromId(id); } |