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

Unified Diff: base/sys_info_win.cc

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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
Index: base/sys_info_win.cc
diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc
index 817992c4f7a5705ce700568bae49da3696ead843..c8314c7a6a9bd34fb1491716a970d68157d200d0 100644
--- a/base/sys_info_win.cc
+++ b/base/sys_info_win.cc
@@ -1,13 +1,11 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/sys_info.h"
#include <windows.h>
-#include <winioctl.h>
-#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -65,44 +63,6 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
return rv < 0 ? kint64max : rv;
}
-bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) {
- ThreadRestrictions::AssertIOAllowed();
-
- DCHECK(path.IsAbsolute());
- DCHECK(has_seek_penalty);
-
- // TODO(dbeam): Vista, XP support.
- if (win::GetVersion() < win::VERSION_WIN7)
- return false;
-
- std::vector<FilePath::StringType> components;
- path.GetComponents(&components);
-
- File drive(FilePath(L"\\\\.\\" + components[0]), File::FLAG_OPEN);
- if (!drive.IsValid())
- return false;
-
- STORAGE_PROPERTY_QUERY query = {};
- query.QueryType = PropertyStandardQuery;
- query.PropertyId = StorageDeviceSeekPenaltyProperty;
-
- DEVICE_SEEK_PENALTY_DESCRIPTOR result;
- DWORD bytes_returned;
-
- BOOL success = DeviceIoControl(drive.GetPlatformFile(),
- IOCTL_STORAGE_QUERY_PROPERTY,
- &query, sizeof(query),
- &result, sizeof(result),
- &bytes_returned,
- NULL);
- if (success == FALSE || bytes_returned < sizeof(result))
- return false;
-
- *has_seek_penalty = result.IncursSeekPenalty != FALSE;
- return true;
-}
-
-// static
std::string SysInfo::OperatingSystemName() {
return "Windows NT";
}
« no previous file with comments | « base/sys_info_unittest.cc ('k') | base/test/BUILD.gn » ('j') | mojo/public/tools/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698