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

Side by Side Diff: chrome/browser/metrics/drive_metrics_provider.cc

Issue 1057093003: Detect seek penalties on Linux/ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SSSSCCCSSSSIIIII!!! Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/metrics/drive_metrics_provider.h" 5 #include "chrome/browser/metrics/drive_metrics_provider.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 22 matching lines...) Expand all
33 content::BrowserThread::PostTaskAndReplyWithResult( 33 content::BrowserThread::PostTaskAndReplyWithResult(
34 content::BrowserThread::FILE, FROM_HERE, 34 content::BrowserThread::FILE, FROM_HERE,
35 base::Bind(&DriveMetricsProvider::GetDriveMetricsOnFileThread), 35 base::Bind(&DriveMetricsProvider::GetDriveMetricsOnFileThread),
36 base::Bind(&DriveMetricsProvider::GotDriveMetrics, 36 base::Bind(&DriveMetricsProvider::GotDriveMetrics,
37 weak_ptr_factory_.GetWeakPtr())); 37 weak_ptr_factory_.GetWeakPtr()));
38 } 38 }
39 39
40 DriveMetricsProvider::SeekPenaltyResponse::SeekPenaltyResponse() 40 DriveMetricsProvider::SeekPenaltyResponse::SeekPenaltyResponse()
41 : success(false) {} 41 : success(false) {}
42 42
43 #if !(defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_IOS)) 43 #if !(defined(OS_WIN) || defined(OS_LINUX) || defined(OS_IOS))
44 // static 44 // static
45 bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path, 45 bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
46 bool* has_seek_penalty) { 46 bool* has_seek_penalty) {
47 // TODO(dbeam): implement on more platforms. 47 // TODO(dbeam): implement on Mac.
48 return false; 48 return false;
49 } 49 }
50 #endif 50 #endif
51 51
52 // static 52 // static
53 DriveMetricsProvider::DriveMetrics 53 DriveMetricsProvider::DriveMetrics
54 DriveMetricsProvider::GetDriveMetricsOnFileThread() { 54 DriveMetricsProvider::GetDriveMetricsOnFileThread() {
55 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); 55 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
56 56
57 DriveMetricsProvider::DriveMetrics metrics; 57 DriveMetricsProvider::DriveMetrics metrics;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 metrics_ = metrics; 90 metrics_ = metrics;
91 got_metrics_callback_.Run(); 91 got_metrics_callback_.Run();
92 } 92 }
93 93
94 void DriveMetricsProvider::FillDriveMetrics( 94 void DriveMetricsProvider::FillDriveMetrics(
95 const DriveMetricsProvider::SeekPenaltyResponse& response, 95 const DriveMetricsProvider::SeekPenaltyResponse& response,
96 metrics::SystemProfileProto::Hardware::Drive* drive) { 96 metrics::SystemProfileProto::Hardware::Drive* drive) {
97 if (response.success) 97 if (response.success)
98 drive->set_has_seek_penalty(response.has_seek_penalty); 98 drive->set_has_seek_penalty(response.has_seek_penalty);
99 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698