| Index: components/metrics/drive_metrics_provider_mac.mm
|
| diff --git a/chrome/browser/metrics/drive_metrics_provider_mac.mm b/components/metrics/drive_metrics_provider_mac.mm
|
| similarity index 87%
|
| rename from chrome/browser/metrics/drive_metrics_provider_mac.mm
|
| rename to components/metrics/drive_metrics_provider_mac.mm
|
| index 565acd8c3e3f7da17f0465b089096d443c792761..a6a37614d0cccf595d2c7175bfd869d6c2d0af79 100644
|
| --- a/chrome/browser/metrics/drive_metrics_provider_mac.mm
|
| +++ b/components/metrics/drive_metrics_provider_mac.mm
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/metrics/drive_metrics_provider.h"
|
| +#include "components/metrics/drive_metrics_provider.h"
|
|
|
| #include <CoreFoundation/CoreFoundation.h>
|
| #include <DiskArbitration/DiskArbitration.h>
|
| @@ -18,6 +18,8 @@
|
| #include "base/mac/scoped_cftyperef.h"
|
| #include "base/mac/scoped_ioobject.h"
|
|
|
| +namespace metrics {
|
| +
|
| // static
|
| bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
| bool* has_seek_penalty) {
|
| @@ -37,17 +39,15 @@ bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
| if (!session)
|
| return false;
|
|
|
| - base::ScopedCFTypeRef<DADiskRef> disk(DADiskCreateFromBSDName(
|
| - kCFAllocatorDefault, session, bsd_name.c_str()));
|
| + base::ScopedCFTypeRef<DADiskRef> disk(
|
| + DADiskCreateFromBSDName(kCFAllocatorDefault, session, bsd_name.c_str()));
|
| if (!disk)
|
| return false;
|
|
|
| base::mac::ScopedIOObject<io_object_t> io_media(DADiskCopyIOMedia(disk));
|
| base::ScopedCFTypeRef<CFDictionaryRef> characteristics(
|
| static_cast<CFDictionaryRef>(IORegistryEntrySearchCFProperty(
|
| - io_media,
|
| - kIOServicePlane,
|
| - CFSTR(kIOPropertyDeviceCharacteristicsKey),
|
| + io_media, kIOServicePlane, CFSTR(kIOPropertyDeviceCharacteristicsKey),
|
| kCFAllocatorDefault,
|
| kIORegistryIterateRecursively | kIORegistryIterateParents)));
|
| if (!characteristics)
|
| @@ -72,3 +72,5 @@ bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
| // type? Assume rotational?
|
| return false;
|
| }
|
| +
|
| +} // namespace metrics
|
|
|