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

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: 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(reinterpret_cast<const char*>(buffer), "WinUSB",
131 0) { 131 base::CompareCase::INSENSITIVE_ASCII))
132 return true; 132 return true;
133 }
134 return false; 133 return false;
135 } 134 }
136 135
137 #endif // OS_WIN 136 #endif // OS_WIN
138 137
139 void GetDeviceListOnBlockingThread( 138 void GetDeviceListOnBlockingThread(
140 const std::string& new_device_path, 139 const std::string& new_device_path,
141 scoped_refptr<UsbContext> usb_context, 140 scoped_refptr<UsbContext> usb_context,
142 scoped_refptr<base::SequencedTaskRunner> task_runner, 141 scoped_refptr<base::SequencedTaskRunner> task_runner,
143 base::Callback<void(libusb_device**, size_t)> callback) { 142 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()) { 685 if (it != platform_devices_.end()) {
687 RemoveDevice(it->second); 686 RemoveDevice(it->second);
688 } else { 687 } else {
689 DCHECK(ContainsKey(devices_being_enumerated_, platform_device)); 688 DCHECK(ContainsKey(devices_being_enumerated_, platform_device));
690 devices_being_enumerated_.erase(platform_device); 689 devices_being_enumerated_.erase(platform_device);
691 } 690 }
692 libusb_unref_device(platform_device); 691 libusb_unref_device(platform_device);
693 } 692 }
694 693
695 } // namespace device 694 } // namespace device
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | extensions/browser/api/web_request/form_data_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698