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

Side by Side Diff: components/metrics/metrics_service_client.h

Issue 1859213002: Move the thread hop for UMA user actions from content:: to base::. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/single_thread_task_runner.h"
13 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
14 #include "base/time/time.h" 15 #include "base/time/time.h"
15 #include "components/metrics/proto/system_profile.pb.h" 16 #include "components/metrics/proto/system_profile.pb.h"
16 17
17 namespace base { 18 namespace base {
18 class FilePath; 19 class FilePath;
19 } 20 }
20 21
21 namespace metrics { 22 namespace metrics {
22 23
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 const base::Closure& done_callback) = 0; 93 const base::Closure& done_callback) = 0;
93 94
94 // Creates a MetricsLogUploader with the specified parameters (see comments on 95 // Creates a MetricsLogUploader with the specified parameters (see comments on
95 // MetricsLogUploader for details). 96 // MetricsLogUploader for details).
96 virtual scoped_ptr<MetricsLogUploader> CreateUploader( 97 virtual scoped_ptr<MetricsLogUploader> CreateUploader(
97 const base::Callback<void(int)>& on_upload_complete) = 0; 98 const base::Callback<void(int)>& on_upload_complete) = 0;
98 99
99 // Returns the standard interval between upload attempts. 100 // Returns the standard interval between upload attempts.
100 virtual base::TimeDelta GetStandardUploadInterval() = 0; 101 virtual base::TimeDelta GetStandardUploadInterval() = 0;
101 102
103 virtual scoped_refptr<base::SingleThreadTaskRunner>
104 GetUIThreadTaskRunner() = 0;
Ilya Sherman 2016/04/06 02:36:29 Please document this method.
Ilya Sherman 2016/04/06 02:36:29 nit: I think "MainThread" would be better than "UI
beaudoin 2016/04/06 15:06:13 Done.
beaudoin 2016/04/06 15:06:13 Done.
105
102 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store 106 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store
103 // backups of metrics data. Unused except on Windows. 107 // backups of metrics data. Unused except on Windows.
104 virtual base::string16 GetRegistryBackupKey(); 108 virtual base::string16 GetRegistryBackupKey();
105 109
106 // Called on plugin loading errors. 110 // Called on plugin loading errors.
107 virtual void OnPluginLoadingError(const base::FilePath& plugin_path) {} 111 virtual void OnPluginLoadingError(const base::FilePath& plugin_path) {}
108 112
109 // Called on renderer crashes in some embedders (e.g., those that do not use 113 // Called on renderer crashes in some embedders (e.g., those that do not use
110 // //content and thus do not have //content's notification system available 114 // //content and thus do not have //content's notification system available
111 // as a mechanism for observing renderer crashes). 115 // as a mechanism for observing renderer crashes).
112 virtual void OnRendererProcessCrash() {} 116 virtual void OnRendererProcessCrash() {}
113 117
114 // Returns whether metrics reporting is managed by policy. 118 // Returns whether metrics reporting is managed by policy.
115 virtual bool IsReportingPolicyManaged(); 119 virtual bool IsReportingPolicyManaged();
116 120
117 // Gets information about the default value for the enable metrics reporting 121 // Gets information about the default value for the enable metrics reporting
118 // checkbox shown during first-run. 122 // checkbox shown during first-run.
119 virtual EnableMetricsDefault GetDefaultOptIn(); 123 virtual EnableMetricsDefault GetDefaultOptIn();
120 }; 124 };
121 125
122 } // namespace metrics 126 } // namespace metrics
123 127
124 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ 128 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698