Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 BASE_METRICS_USER_METRICS_H_ | 5 #ifndef BASE_METRICS_USER_METRICS_H_ |
| 6 #define BASE_METRICS_USER_METRICS_H_ | 6 #define BASE_METRICS_USER_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/single_thread_task_runner.h" | |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 | 16 |
| 16 // This module provides some helper functions for logging actions tracked by | 17 // This module provides some helper functions for logging actions tracked by |
| 17 // the user metrics system. | 18 // the user metrics system. |
| 18 | 19 |
| 19 // Record that the user performed an action. | 20 // Record that the user performed an action. |
| 20 // This method *must* be called from the main thread. | 21 // This method *must* be called from the main thread. |
| 21 // | 22 // |
| 22 // "Action" here means a user-generated event: | 23 // "Action" here means a user-generated event: |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 48 // tools/metrics/actions/extract_actions.py. | 49 // tools/metrics/actions/extract_actions.py. |
| 49 BASE_EXPORT void RecordComputedAction(const std::string& action); | 50 BASE_EXPORT void RecordComputedAction(const std::string& action); |
| 50 | 51 |
| 51 // Called with the action string. | 52 // Called with the action string. |
| 52 typedef base::Callback<void(const std::string&)> ActionCallback; | 53 typedef base::Callback<void(const std::string&)> ActionCallback; |
| 53 | 54 |
| 54 // Add/remove action callbacks (see above). | 55 // Add/remove action callbacks (see above). |
| 55 BASE_EXPORT void AddActionCallback(const ActionCallback& callback); | 56 BASE_EXPORT void AddActionCallback(const ActionCallback& callback); |
| 56 BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); | 57 BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); |
| 57 | 58 |
| 59 // Set the task runner on which to do the thread hopping. | |
|
Ilya Sherman
2016/04/06 02:36:29
nit: Perhaps "Set the task runner on which to reco
beaudoin
2016/04/06 15:06:13
Done.
| |
| 60 BASE_EXPORT void SetRecordActionTaskRunner( | |
| 61 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
| 62 | |
| 63 | |
|
Ilya Sherman
2016/04/06 02:36:29
nit: Spurious newline
beaudoin
2016/04/06 15:06:13
Done.
| |
| 58 } // namespace base | 64 } // namespace base |
| 59 | 65 |
| 60 #endif // BASE_METRICS_USER_METRICS_H_ | 66 #endif // BASE_METRICS_USER_METRICS_H_ |
| OLD | NEW |