diff options
author | yzshen <yzshen@chromium.org> | 2016-02-12 17:10:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-13 01:13:27 +0000 |
commit | 48f0c963ba40f0b3b7768c9d7f36bd51346ebeb5 (patch) | |
tree | e3b4d4f5458bb914cf6798eece128b3608055535 /device/serial/serial_device_enumerator_win.cc | |
parent | 07eb2f07100d7439592d80471454b8e2ecb83388 (diff) | |
download | chromium_src-48f0c963ba40f0b3b7768c9d7f36bd51346ebeb5.zip chromium_src-48f0c963ba40f0b3b7768c9d7f36bd51346ebeb5.tar.gz chromium_src-48f0c963ba40f0b3b7768c9d7f36bd51346ebeb5.tar.bz2 |
Mojo C++ bindings: make Array/Map/String non-null by default.
Array<X> a; // Default construct an empty array.
Array<X> b(nullptr); // Construct a null array.
a.clear(); // Set to an empty array.
a = nullptr; // Set to a null array.
BUG=579634
TEST=None
Review URL: https://codereview.chromium.org/1693943002
Cr-Commit-Position: refs/heads/master@{#375304}
Diffstat (limited to 'device/serial/serial_device_enumerator_win.cc')
-rw-r--r-- | device/serial/serial_device_enumerator_win.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/device/serial/serial_device_enumerator_win.cc b/device/serial/serial_device_enumerator_win.cc index 79c4001..2e83fd6 100644 --- a/device/serial/serial_device_enumerator_win.cc +++ b/device/serial/serial_device_enumerator_win.cc @@ -87,7 +87,7 @@ int Clamp(int value, int min, int max) { // enumerating serial devices (SetupDi). This new method gives more information // about the devices than the old method. mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { - mojo::Array<serial::DeviceInfoPtr> devices(0); + mojo::Array<serial::DeviceInfoPtr> devices; // Make a device interface query to find all serial devices. HDEVINFO dev_info = @@ -141,7 +141,7 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { mojo::Array<serial::DeviceInfoPtr> GetDevicesOld() { base::win::RegistryValueIterator iter_key( HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\SERIALCOMM\\"); - mojo::Array<serial::DeviceInfoPtr> devices(0); + mojo::Array<serial::DeviceInfoPtr> devices; for (; iter_key.Valid(); ++iter_key) { serial::DeviceInfoPtr info(serial::DeviceInfo::New()); info->path = base::UTF16ToASCII(iter_key.Value()); |