| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
| 6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
| 7 | 7 |
| 8 #ifndef CHROME_FRAME_METRICS_METRICS_SERVICE_H_ | 8 #ifndef CHROME_FRAME_METRICS_METRICS_SERVICE_H_ |
| 9 #define CHROME_FRAME_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_FRAME_METRICS_METRICS_SERVICE_H_ |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Start/stop the metrics recording and uploading machine. These should be | 28 // Start/stop the metrics recording and uploading machine. These should be |
| 29 // used on startup and when the user clicks the checkbox in the prefs. | 29 // used on startup and when the user clicks the checkbox in the prefs. |
| 30 // StartRecordingOnly starts the metrics recording but not reporting, for use | 30 // StartRecordingOnly starts the metrics recording but not reporting, for use |
| 31 // in tests only. | 31 // in tests only. |
| 32 static void Start(); | 32 static void Start(); |
| 33 static void Stop(); | 33 static void Stop(); |
| 34 // Set up client ID, session ID, etc. | 34 // Set up client ID, session ID, etc. |
| 35 void InitializeMetricsState(); | 35 void InitializeMetricsState(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // To enable the default traits object to create an instance of this class. |
| 39 friend struct base::DefaultLazyInstanceTraits<MetricsService>; |
| 40 |
| 38 MetricsService(); | 41 MetricsService(); |
| 39 virtual ~MetricsService(); | 42 virtual ~MetricsService(); |
| 40 // The MetricsService has a lifecycle that is stored as a state. | 43 // The MetricsService has a lifecycle that is stored as a state. |
| 41 // See metrics_service.cc for description of this lifecycle. | 44 // See metrics_service.cc for description of this lifecycle. |
| 42 enum State { | 45 enum State { |
| 43 INITIALIZED, // Constructor was called. | 46 INITIALIZED, // Constructor was called. |
| 44 ACTIVE, // Accumalating log data | 47 ACTIVE, // Accumalating log data |
| 45 STOPPED, // Service has stopped | 48 STOPPED, // Service has stopped |
| 46 }; | 49 }; |
| 47 | 50 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 131 |
| 129 // The URL for the metrics server. | 132 // The URL for the metrics server. |
| 130 std::wstring server_url_; | 133 std::wstring server_url_; |
| 131 | 134 |
| 132 // The identifier that's sent to the server with the log reports. | 135 // The identifier that's sent to the server with the log reports. |
| 133 std::string client_id_; | 136 std::string client_id_; |
| 134 | 137 |
| 135 // A number that identifies the how many times the app has been launched. | 138 // A number that identifies the how many times the app has been launched. |
| 136 int session_id_; | 139 int session_id_; |
| 137 | 140 |
| 138 static base::LazyInstance<base::ThreadLocalPointer<MetricsService> > | |
| 139 g_metrics_instance_; | |
| 140 | |
| 141 PlatformThreadId thread_; | 141 PlatformThreadId thread_; |
| 142 | 142 |
| 143 // Indicates if this is the first uma upload from this instance. | 143 // Indicates if this is the first uma upload from this instance. |
| 144 bool initial_uma_upload_; | 144 bool initial_uma_upload_; |
| 145 | 145 |
| 146 // The transmission timer id returned by SetTimer | 146 // The transmission timer id returned by SetTimer |
| 147 int transmission_timer_id_; | 147 int transmission_timer_id_; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 149 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 #endif // CHROME_FRAME_METRICS_METRICS_SERVICE_H_ | 152 #endif // CHROME_FRAME_METRICS_METRICS_SERVICE_H_ |
| 153 | 153 |
| OLD | NEW |