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

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: mac stub 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
« no previous file with comments | « no previous file | chrome/browser/metrics/drive_metrics_provider_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
44 // static
45 bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
46 bool* has_seek_penalty) {
47 // TODO(dbeam): implement on more platforms.
48 return false;
49 }
50 #endif
51
52 // static 43 // static
53 DriveMetricsProvider::DriveMetrics 44 DriveMetricsProvider::DriveMetrics
54 DriveMetricsProvider::GetDriveMetricsOnFileThread() { 45 DriveMetricsProvider::GetDriveMetricsOnFileThread() {
55 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); 46 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
56 47
57 DriveMetricsProvider::DriveMetrics metrics; 48 DriveMetricsProvider::DriveMetrics metrics;
58 QuerySeekPenalty(base::FILE_EXE, &metrics.app_drive); 49 QuerySeekPenalty(base::FILE_EXE, &metrics.app_drive);
59 QuerySeekPenalty(chrome::FILE_LOCAL_STATE, &metrics.user_data_drive); 50 QuerySeekPenalty(chrome::FILE_LOCAL_STATE, &metrics.user_data_drive);
60 return metrics; 51 return metrics;
61 } 52 }
(...skipping 28 matching lines...) Expand all
90 metrics_ = metrics; 81 metrics_ = metrics;
91 got_metrics_callback_.Run(); 82 got_metrics_callback_.Run();
92 } 83 }
93 84
94 void DriveMetricsProvider::FillDriveMetrics( 85 void DriveMetricsProvider::FillDriveMetrics(
95 const DriveMetricsProvider::SeekPenaltyResponse& response, 86 const DriveMetricsProvider::SeekPenaltyResponse& response,
96 metrics::SystemProfileProto::Hardware::Drive* drive) { 87 metrics::SystemProfileProto::Hardware::Drive* drive) {
97 if (response.success) 88 if (response.success)
98 drive->set_has_seek_penalty(response.has_seek_penalty); 89 drive->set_has_seek_penalty(response.has_seek_penalty);
99 } 90 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/drive_metrics_provider_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698