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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_win.cc

Issue 1160263002: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in device/blu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device/bluetooth/bluetooth_low_energy_win.h" 5 #include "device/bluetooth/bluetooth_low_energy_win.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 for (DWORD i = 0;; ++i) { 642 for (DWORD i = 0;; ++i) {
643 scoped_ptr<BluetoothLowEnergyDeviceInfo> device_info; 643 scoped_ptr<BluetoothLowEnergyDeviceInfo> device_info;
644 DeviceInfoResult result = EnumerateSingleBluetoothLowEnergyDevice( 644 DeviceInfoResult result = EnumerateSingleBluetoothLowEnergyDevice(
645 info_set_handle, i, &device_info, error); 645 info_set_handle, i, &device_info, error);
646 switch (result) { 646 switch (result) {
647 case kNoMoreDevices: 647 case kNoMoreDevices:
648 return true; 648 return true;
649 case kError: 649 case kError:
650 return false; 650 return false;
651 case kOk: 651 case kOk:
652 devices->push_back(device_info.release()); 652 devices->push_back(device_info.Pass());
653 } 653 }
654 } 654 }
655 } 655 }
656 656
657 bool EnumerateKnownBluetoothLowEnergyServices( 657 bool EnumerateKnownBluetoothLowEnergyServices(
658 const base::FilePath& device_path, 658 const base::FilePath& device_path,
659 ScopedVector<BluetoothLowEnergyServiceInfo>* services, 659 ScopedVector<BluetoothLowEnergyServiceInfo>* services,
660 std::string* error) { 660 std::string* error) {
661 if (!IsBluetoothLowEnergySupported()) { 661 if (!IsBluetoothLowEnergySupported()) {
662 *error = kPlatformNotSupported; 662 *error = kPlatformNotSupported;
663 return false; 663 return false;
664 } 664 }
665 665
666 return CollectBluetoothLowEnergyDeviceServices(device_path, services, error); 666 return CollectBluetoothLowEnergyDeviceServices(device_path, services, error);
667 } 667 }
668 668
669 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting( 669 bool ExtractBluetoothAddressFromDeviceInstanceIdForTesting(
670 const std::string& instance_id, 670 const std::string& instance_id,
671 BLUETOOTH_ADDRESS* btha, 671 BLUETOOTH_ADDRESS* btha,
672 std::string* error) { 672 std::string* error) {
673 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error); 673 return ExtractBluetoothAddressFromDeviceInstanceId(instance_id, btha, error);
674 } 674 }
675 675
676 } // namespace win 676 } // namespace win
677 } // namespace device 677 } // namespace device
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698