Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / metrics / metrics_service_accessor.h
blob9d1438e11f7f9312e2d65eb80699add4006c6893
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.
5 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_
6 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_
8 #include <stdint.h>
10 #include "base/macros.h"
12 namespace metrics {
13 class MetricsService;
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:
21 // Constructor declared as protected to enable inheritance. Descendants should
22 // disallow instantiation.
23 MetricsServiceAccessor() {}
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.
29 static bool RegisterSyntheticFieldTrial(
30 metrics::MetricsService* metrics_service,
31 uint32_t trial_name_hash,
32 uint32_t group_name_hash);
34 private:
35 DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor);
38 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_