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

Unified Diff: components/metrics/drive_metrics_provider_win.cc

Issue 1254983003: Componentize DriveMetricsProvider* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/drive_metrics_provider_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « components/metrics/drive_metrics_provider_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698