OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/music_manager_private/device_id.h" | 5 #include "chrome/browser/extensions/api/music_manager_private/device_id.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <DiskArbitration/DASession.h> | 8 #include <DiskArbitration/DASession.h> |
9 #include <DiskArbitration/DADisk.h> | 9 #include <DiskArbitration/DADisk.h> |
10 #include <IOKit/IOKitLib.h> | 10 #include <IOKit/IOKitLib.h> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 kCFAllocatorDefault, | 126 kCFAllocatorDefault, |
127 0))); | 127 0))); |
128 if (!mac_address_data) | 128 if (!mac_address_data) |
129 return keep_going; | 129 return keep_going; |
130 | 130 |
131 const UInt8* mac_address = CFDataGetBytePtr(mac_address_data); | 131 const UInt8* mac_address = CFDataGetBytePtr(mac_address_data); |
132 size_t mac_address_size = CFDataGetLength(mac_address_data); | 132 size_t mac_address_size = CFDataGetLength(mac_address_data); |
133 if (!is_valid_mac_address_.Run(mac_address, mac_address_size)) | 133 if (!is_valid_mac_address_.Run(mac_address, mac_address_size)) |
134 return keep_going; | 134 return keep_going; |
135 | 135 |
136 std::string mac_address_string = base::StringToLowerASCII(base::HexEncode( | 136 std::string mac_address_string = base::ToLowerASCII(base::HexEncode( |
137 mac_address, mac_address_size)); | 137 mac_address, mac_address_size)); |
138 | 138 |
139 base::ScopedCFTypeRef<CFStringRef> provider_class( | 139 base::ScopedCFTypeRef<CFStringRef> provider_class( |
140 static_cast<CFStringRef>( | 140 static_cast<CFStringRef>( |
141 IORegistryEntryCreateCFProperty(network_controller, | 141 IORegistryEntryCreateCFProperty(network_controller, |
142 CFSTR(kIOProviderClassKey), | 142 CFSTR(kIOProviderClassKey), |
143 kCFAllocatorDefault, | 143 kCFAllocatorDefault, |
144 0))); | 144 0))); |
145 if (provider_class) { | 145 if (provider_class) { |
146 if (CFStringCompare(provider_class, CFSTR("IOPCIDevice"), 0) == | 146 if (CFStringCompare(provider_class, CFSTR("IOPCIDevice"), 0) == |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 content::BrowserThread::PostTask( | 245 content::BrowserThread::PostTask( |
246 content::BrowserThread::FILE, | 246 content::BrowserThread::FILE, |
247 FROM_HERE, | 247 FROM_HERE, |
248 base::Bind(GetRawDeviceIdImpl, | 248 base::Bind(GetRawDeviceIdImpl, |
249 base::Bind(DeviceId::IsValidMacAddress), | 249 base::Bind(DeviceId::IsValidMacAddress), |
250 callback)); | 250 callback)); |
251 } | 251 } |
252 | 252 |
253 } // namespace api | 253 } // namespace api |
254 } // namespace extensions | 254 } // namespace extensions |
OLD | NEW |