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

Side by Side Diff: chrome/browser/metrics/metrics_service_accessor.h

Issue 440693002: Add function to register a synthetic trial with the trial hash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ 5 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_
6 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ 6 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_
7 7
8 #include <stdint.h>
8 #include <string> 9 #include <string>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 12
12 class MetricsService; 13 class MetricsService;
13 class MetricsServiceObserver; 14 class MetricsServiceObserver;
14 15
15 // This class limits and documents access to metrics service helper methods. 16 // This class limits and documents access to metrics service helper methods.
16 // These methods are protected so each user has to inherit own program-specific 17 // These methods are protected so each user has to inherit own program-specific
17 // specialization and enable access there by declaring friends. 18 // specialization and enable access there by declaring friends.
18 class MetricsServiceAccessor { 19 class MetricsServiceAccessor {
19 protected: 20 protected:
20 // Constructor declared as protected to enable inheritance. Decendants should 21 // Constructor declared as protected to enable inheritance. Decendants should
21 // disallow instantiation. 22 // disallow instantiation.
22 MetricsServiceAccessor() {} 23 MetricsServiceAccessor() {}
23 24
24 // Registers/unregisters |observer| to receive MetricsLog notifications 25 // Registers/unregisters |observer| to receive MetricsLog notifications
25 // from metrics service. 26 // from metrics service.
26 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); 27 static void AddMetricsServiceObserver(MetricsServiceObserver* observer);
27 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); 28 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer);
28 29
29 // Registers a field trial name and group to be used to annotate a UMA report 30 // Registers a field trial name and group to be used to annotate a UMA report
30 // with a particular Chrome configuration state. A UMA report will be 31 // with a particular Chrome configuration state. A UMA report will be
31 // annotated with this trial group if and only if all events in the report 32 // annotated with this trial group if and only if all events in the report
32 // were created after the trial is registered. Only one group name may be 33 // were created after the trial is registered. Only one group name may be
33 // registered at a time for a given trial name. Only the last group name that 34 // registered at a time for a given trial name. Only the last group name that
34 // is registered for a given trial name will be recorded. The values passed 35 // is registered for a given trial name will be recorded. The values passed
35 // in must not correspond to any real field trial in the code. 36 // in must not correspond to any real field trial in the code.
jwd 2014/08/05 19:26:05 Update comment.
Alexei Svitkine (slow) 2014/08/05 19:31:40 Done. Gutted most of the comment, instead pointing
36 static bool RegisterSyntheticFieldTrial(MetricsService* metrics_service, 37 static bool RegisterSyntheticFieldTrial(MetricsService* metrics_service,
37 const std::string& trial, 38 uint32_t trial_name_hash,
38 const std::string& group); 39 uint32_t group_name_hash);
39 40
40 private: 41 private:
41 DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor); 42 DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor);
42 }; 43 };
43 44
44 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_ 45 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_ACCESSOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_accessor.cc ('k') | chrome/browser/metrics/metrics_service_accessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698