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

Side by Side Diff: chrome_frame/metrics_service.h

Issue 6881018: Switch back to using urlmon (from using Chrome's network stack) to upload metrics. This basicall... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « no previous file | chrome_frame/metrics_service.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_SERVICE_H_ 8 #ifndef CHROME_FRAME_METRICS_SERVICE_H_
9 #define CHROME_FRAME_METRICS_SERVICE_H_ 9 #define CHROME_FRAME_METRICS_SERVICE_H_
10 10
(...skipping 18 matching lines...) Expand all
29 // Start/stop the metrics recording and uploading machine. These should be 29 // Start/stop the metrics recording and uploading machine. These should be
30 // used on startup and when the user clicks the checkbox in the prefs. 30 // used on startup and when the user clicks the checkbox in the prefs.
31 // StartRecordingOnly starts the metrics recording but not reporting, for use 31 // StartRecordingOnly starts the metrics recording but not reporting, for use
32 // in tests only. 32 // in tests only.
33 static void Start(); 33 static void Start();
34 static void Stop(); 34 static void Stop();
35 // Set up client ID, session ID, etc. 35 // Set up client ID, session ID, etc.
36 void InitializeMetricsState(); 36 void InitializeMetricsState();
37 37
38 private: 38 private:
39 // To enable the default traits object to create an instance of this class.
40 friend struct base::DefaultLazyInstanceTraits<MetricsService>;
41
42 MetricsService(); 39 MetricsService();
43 virtual ~MetricsService(); 40 virtual ~MetricsService();
44 // The MetricsService has a lifecycle that is stored as a state. 41 // The MetricsService has a lifecycle that is stored as a state.
45 // See metrics_service.cc for description of this lifecycle. 42 // See metrics_service.cc for description of this lifecycle.
46 enum State { 43 enum State {
47 INITIALIZED, // Constructor was called. 44 INITIALIZED, // Constructor was called.
48 ACTIVE, // Accumalating log data 45 ACTIVE, // Accumalating log data
49 STOPPED, // Service has stopped 46 STOPPED, // Service has stopped
50 }; 47 };
51 48
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 129
133 // The URL for the metrics server. 130 // The URL for the metrics server.
134 std::wstring server_url_; 131 std::wstring server_url_;
135 132
136 // The identifier that's sent to the server with the log reports. 133 // The identifier that's sent to the server with the log reports.
137 std::string client_id_; 134 std::string client_id_;
138 135
139 // A number that identifies the how many times the app has been launched. 136 // A number that identifies the how many times the app has been launched.
140 int session_id_; 137 int session_id_;
141 138
139 static base::LazyInstance<base::ThreadLocalPointer<MetricsService> >
140 g_metrics_instance_;
141
142 base::PlatformThreadId thread_; 142 base::PlatformThreadId thread_;
143 143
144 // Indicates if this is the first uma upload from this instance. 144 // Indicates if this is the first uma upload from this instance.
145 bool initial_uma_upload_; 145 bool initial_uma_upload_;
146 146
147 // The transmission timer id returned by SetTimer 147 // The transmission timer id returned by SetTimer
148 int transmission_timer_id_; 148 int transmission_timer_id_;
149 149
150 // Used to serialize the Start and Stop operations on the metrics service. 150 // Used to serialize the Start and Stop operations on the metrics service.
151 static base::Lock metrics_service_lock_; 151 static base::Lock metrics_service_lock_;
152 152
153 DISALLOW_COPY_AND_ASSIGN(MetricsService); 153 DISALLOW_COPY_AND_ASSIGN(MetricsService);
154 }; 154 };
155 155
156 #endif // CHROME_FRAME_METRICS_SERVICE_H_ 156 #endif // CHROME_FRAME_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome_frame/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698