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

Side by Side Diff: device/usb/usb_service_impl.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert CLD Created 5 years, 5 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
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/usb/usb_service_impl.h" 5 #include "device/usb/usb_service_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 USB_PLOG(ERROR) << "Failed to get device service property"; 120 USB_PLOG(ERROR) << "Failed to get device service property";
121 return false; 121 return false;
122 } 122 }
123 if (reg_data_type != REG_SZ) { 123 if (reg_data_type != REG_SZ) {
124 USB_LOG(ERROR) << "Unexpected data type for driver service: " 124 USB_LOG(ERROR) << "Unexpected data type for driver service: "
125 << reg_data_type; 125 << reg_data_type;
126 return false; 126 return false;
127 } 127 }
128 128
129 USB_LOG(DEBUG) << "Driver for " << device_path << " is " << buffer << "."; 129 USB_LOG(DEBUG) << "Driver for " << device_path << " is " << buffer << ".";
130 if (base::strncasecmp("WinUSB", (const char*)&buffer[0], sizeof "WinUSB") == 130 if (base::StartsWith(buffer, "WinUSB", base::CompareCase::INSENSITIVE_ASCII))
131 0) {
132 return true; 131 return true;
133 }
134 return false; 132 return false;
135 } 133 }
136 134
137 #endif // OS_WIN 135 #endif // OS_WIN
138 136
139 void GetDeviceListOnBlockingThread( 137 void GetDeviceListOnBlockingThread(
140 const std::string& new_device_path, 138 const std::string& new_device_path,
141 scoped_refptr<UsbContext> usb_context, 139 scoped_refptr<UsbContext> usb_context,
142 scoped_refptr<base::SequencedTaskRunner> task_runner, 140 scoped_refptr<base::SequencedTaskRunner> task_runner,
143 base::Callback<void(libusb_device**, size_t)> callback) { 141 base::Callback<void(libusb_device**, size_t)> callback) {
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 if (it != platform_devices_.end()) { 684 if (it != platform_devices_.end()) {
687 RemoveDevice(it->second); 685 RemoveDevice(it->second);
688 } else { 686 } else {
689 DCHECK(ContainsKey(devices_being_enumerated_, platform_device)); 687 DCHECK(ContainsKey(devices_being_enumerated_, platform_device));
690 devices_being_enumerated_.erase(platform_device); 688 devices_being_enumerated_.erase(platform_device);
691 } 689 }
692 libusb_unref_device(platform_device); 690 libusb_unref_device(platform_device);
693 } 691 }
694 692
695 } // namespace device 693 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698