| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 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 | ||||
| 3 | // found in the LICENSE file. | ||||
| 4 | |||||
| asvitkine | c8fa43e9 | 2014-11-14 22:39:56 | [diff] [blame^] | 5 | #ifndef COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ |
| 6 | #define COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ | ||||
| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 7 | |
| [email protected] | bb5d189 | 2014-08-06 06:03:22 | [diff] [blame] | 8 | #include <stdint.h> |
| [email protected] | 0129c27 | 2014-08-02 00:35:17 | [diff] [blame] | 9 | |
| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 10 | #include "base/macros.h" |
| 11 | |||||
| asvitkine | cbd42073 | 2014-08-26 22:15:40 | [diff] [blame] | 12 | namespace metrics { |
| asvitkine | c8fa43e9 | 2014-11-14 22:39:56 | [diff] [blame^] | 13 | |
| [email protected] | 0129c27 | 2014-08-02 00:35:17 | [diff] [blame] | 14 | class MetricsService; |
| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 15 | |
| 16 | // This class limits and documents access to metrics service helper methods. | ||||
| 17 | // These methods are protected so each user has to inherit own program-specific | ||||
| 18 | // specialization and enable access there by declaring friends. | ||||
| 19 | class MetricsServiceAccessor { | ||||
| 20 | protected: | ||||
| asvitkine | cbd42073 | 2014-08-26 22:15:40 | [diff] [blame] | 21 | // Constructor declared as protected to enable inheritance. Descendants should |
| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 22 | // disallow instantiation. |
| 23 | MetricsServiceAccessor() {} | ||||
| 24 | |||||
| [email protected] | bb5d189 | 2014-08-06 06:03:22 | [diff] [blame] | 25 | // Registers the specified synthetic field trial (identified by a hash of the |
| 26 | // trial name and group name) with |metrics_service|, if the service is not | ||||
| 27 | // NULL, returning true on success. | ||||
| 28 | // See the comment on MetricsService::RegisterSyntheticFieldTrial for details. | ||||
| asvitkine | cbd42073 | 2014-08-26 22:15:40 | [diff] [blame] | 29 | static bool RegisterSyntheticFieldTrial( |
| asvitkine | c8fa43e9 | 2014-11-14 22:39:56 | [diff] [blame^] | 30 | MetricsService* metrics_service, |
| asvitkine | cbd42073 | 2014-08-26 22:15:40 | [diff] [blame] | 31 | uint32_t trial_name_hash, |
| 32 | uint32_t group_name_hash); | ||||
| [email protected] | 0129c27 | 2014-08-02 00:35:17 | [diff] [blame] | 33 | |
| [email protected] | 7edd78cd | 2014-05-23 22:31:45 | [diff] [blame] | 34 | private: |
| 35 | DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor); | ||||
| 36 | }; | ||||
| 37 | |||||
| asvitkine | c8fa43e9 | 2014-11-14 22:39:56 | [diff] [blame^] | 38 | } // namespace metrics |
| 39 | |||||
| 40 | #endif // COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ | ||||