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 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/lock.h" |
16 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
17 #include "base/platform_thread.h" | 18 #include "base/platform_thread.h" |
18 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
19 #include "base/thread_local.h" | 20 #include "base/thread_local.h" |
20 #include "chrome/common/metrics_helpers.h" | 21 #include "chrome/common/metrics_helpers.h" |
21 | 22 |
22 // TODO(ananta) | 23 // TODO(ananta) |
23 // Refactor more common code from chrome/browser/metrics/metrics_service.h into | 24 // Refactor more common code from chrome/browser/metrics/metrics_service.h into |
24 // the MetricsServiceBase class. | 25 // the MetricsServiceBase class. |
25 class MetricsService : public MetricsServiceBase { | 26 class MetricsService : public MetricsServiceBase { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 int session_id_; | 140 int session_id_; |
140 | 141 |
141 PlatformThreadId thread_; | 142 PlatformThreadId thread_; |
142 | 143 |
143 // Indicates if this is the first uma upload from this instance. | 144 // Indicates if this is the first uma upload from this instance. |
144 bool initial_uma_upload_; | 145 bool initial_uma_upload_; |
145 | 146 |
146 // The transmission timer id returned by SetTimer | 147 // The transmission timer id returned by SetTimer |
147 int transmission_timer_id_; | 148 int transmission_timer_id_; |
148 | 149 |
| 150 // Used to serialize the Start and Stop operations on the metrics service. |
| 151 static Lock metrics_service_lock_; |
| 152 |
149 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 153 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
150 }; | 154 }; |
151 | 155 |
152 #endif // CHROME_FRAME_METRICS_METRICS_SERVICE_H_ | 156 #endif // CHROME_FRAME_METRICS_METRICS_SERVICE_H_ |
153 | |
OLD | NEW |