| Index: components/metrics/drive_metrics_provider_win.cc
|
| diff --git a/chrome/browser/metrics/drive_metrics_provider_win.cc b/components/metrics/drive_metrics_provider_win.cc
|
| similarity index 77%
|
| rename from chrome/browser/metrics/drive_metrics_provider_win.cc
|
| rename to components/metrics/drive_metrics_provider_win.cc
|
| index 70cf3228efaf74432e6eed604b2b858557b6f44c..3e190d5b936cd4ddc19c2590e98b37e22d5ab993 100644
|
| --- a/chrome/browser/metrics/drive_metrics_provider_win.cc
|
| +++ b/components/metrics/drive_metrics_provider_win.cc
|
| @@ -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 <windows.h>
|
| #include <ntddscsi.h>
|
| @@ -15,6 +15,8 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "base/win/windows_version.h"
|
|
|
| +namespace metrics {
|
| +
|
| namespace {
|
|
|
| // Semi-copy of similarly named struct from ata.h in WinDDK.
|
| @@ -54,11 +56,9 @@ bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
|
|
| DEVICE_SEEK_PENALTY_DESCRIPTOR result;
|
| DWORD bytes_returned;
|
| - BOOL success = DeviceIoControl(volume.GetPlatformFile(),
|
| - IOCTL_STORAGE_QUERY_PROPERTY,
|
| - &query, sizeof(query),
|
| - &result, sizeof(result),
|
| - &bytes_returned, NULL);
|
| + BOOL success = DeviceIoControl(
|
| + volume.GetPlatformFile(), IOCTL_STORAGE_QUERY_PROPERTY, &query,
|
| + sizeof(query), &result, sizeof(result), &bytes_returned, NULL);
|
| if (success == FALSE || bytes_returned < sizeof(result))
|
| return false;
|
|
|
| @@ -73,11 +73,9 @@ bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
| request.query.TimeOutValue = 10;
|
|
|
| DWORD bytes_returned;
|
| - BOOL success = DeviceIoControl(volume.GetPlatformFile(),
|
| - IOCTL_ATA_PASS_THROUGH,
|
| - &request, sizeof(request),
|
| - &request, sizeof(request),
|
| - &bytes_returned, NULL);
|
| + BOOL success = DeviceIoControl(
|
| + volume.GetPlatformFile(), IOCTL_ATA_PASS_THROUGH, &request,
|
| + sizeof(request), &request, sizeof(request), &bytes_returned, NULL);
|
| if (success == FALSE || bytes_returned < sizeof(request) ||
|
| request.query.CurrentTaskFile[0]) {
|
| return false;
|
| @@ -88,3 +86,5 @@ bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
|
|
|
| return true;
|
| }
|
| +
|
| +} // namespace metrics
|
|
|