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

Side by Side Diff: chromecast/base/metrics/cast_metrics_helper.h

Issue 1510973007: [Chromecast] Set dummy metrics session ID for browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + use GUID format for dummy session ID Created 4 years, 10 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
« no previous file with comments | « no previous file | chromecast/base/metrics/cast_metrics_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 5 #ifndef CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
6 #define CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 6 #define CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // events internally unless SetMetricsSink(NULL) is called. 97 // events internally unless SetMetricsSink(NULL) is called.
98 // CastMetricsHelper can only hold one MetricsSink instance. 98 // CastMetricsHelper can only hold one MetricsSink instance.
99 // Caller retains ownership of MetricsSink. 99 // Caller retains ownership of MetricsSink.
100 virtual void SetMetricsSink(MetricsSink* delegate); 100 virtual void SetMetricsSink(MetricsSink* delegate);
101 101
102 // Sets a default callback to record user action when MetricsSink is not set. 102 // Sets a default callback to record user action when MetricsSink is not set.
103 // This function could be called multiple times (in unittests), and 103 // This function could be called multiple times (in unittests), and
104 // CastMetricsHelper only honors the last one. 104 // CastMetricsHelper only honors the last one.
105 virtual void SetRecordActionCallback(const RecordActionCallback& callback); 105 virtual void SetRecordActionCallback(const RecordActionCallback& callback);
106 106
107 // Sets an all-0's session ID for running browser tests.
108 void SetDummySessionIdForTesting();
109
107 protected: 110 protected:
108 // Creates a CastMetricsHelper instance with no task runner. This should only 111 // Creates a CastMetricsHelper instance with no task runner. This should only
109 // be used by tests, since invoking any non-overridden methods on this 112 // be used by tests, since invoking any non-overridden methods on this
110 // instance will cause a failure. 113 // instance will cause a failure.
111 CastMetricsHelper(); 114 CastMetricsHelper();
112 115
113 private: 116 private:
114 static std::string EncodeAppInfoIntoMetricsName( 117 static std::string EncodeAppInfoIntoMetricsName(
115 const std::string& action_name, 118 const std::string& action_name,
116 const std::string& app_id, 119 const std::string& app_id,
(...skipping 27 matching lines...) Expand all
144 // Default RecordAction callback when metrics_sink_ is not set. 147 // Default RecordAction callback when metrics_sink_ is not set.
145 RecordActionCallback record_action_callback_; 148 RecordActionCallback record_action_callback_;
146 149
147 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelper); 150 DISALLOW_COPY_AND_ASSIGN(CastMetricsHelper);
148 }; 151 };
149 152
150 } // namespace metrics 153 } // namespace metrics
151 } // namespace chromecast 154 } // namespace chromecast
152 155
153 #endif // CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_ 156 #endif // CHROMECAST_BASE_METRICS_CAST_METRICS_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/base/metrics/cast_metrics_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698