OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 5 |
6 | 6 |
7 //------------------------------------------------------------------------------ | 7 //------------------------------------------------------------------------------ |
8 // Description of the life cycle of a instance of MetricsService. | 8 // Description of the life cycle of a instance of MetricsService. |
9 // | 9 // |
10 // OVERVIEW | 10 // OVERVIEW |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 #include "chrome/browser/template_url_model.h" | 176 #include "chrome/browser/template_url_model.h" |
177 #include "chrome/common/chrome_paths.h" | 177 #include "chrome/common/chrome_paths.h" |
178 #include "chrome/common/libxml_utils.h" | 178 #include "chrome/common/libxml_utils.h" |
179 #include "chrome/common/pref_names.h" | 179 #include "chrome/common/pref_names.h" |
180 #include "chrome/common/pref_service.h" | 180 #include "chrome/common/pref_service.h" |
181 #include "chrome/installer/util/google_update_settings.h" | 181 #include "chrome/installer/util/google_update_settings.h" |
182 #include "googleurl/src/gurl.h" | 182 #include "googleurl/src/gurl.h" |
183 #include "net/base/load_flags.h" | 183 #include "net/base/load_flags.h" |
184 #include "third_party/bzip2/bzlib.h" | 184 #include "third_party/bzip2/bzlib.h" |
185 | 185 |
| 186 using base::Time; |
| 187 using base::TimeDelta; |
| 188 |
186 // Check to see that we're being called on only one thread. | 189 // Check to see that we're being called on only one thread. |
187 static bool IsSingleThreaded(); | 190 static bool IsSingleThreaded(); |
188 | 191 |
189 static const char kMetricsURL[] = | 192 static const char kMetricsURL[] = |
190 "https://toolbarqueries.google.com/firefox/metrics/collect"; | 193 "https://toolbarqueries.google.com/firefox/metrics/collect"; |
191 | 194 |
192 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; | 195 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; |
193 | 196 |
194 // The delay, in seconds, after startup before sending the first log message. | 197 // The delay, in seconds, after startup before sending the first log message. |
195 static const int kInitialInterlogDuration = 60; // one minute | 198 static const int kInitialInterlogDuration = 60; // one minute |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 L"." + key; | 1758 L"." + key; |
1756 prof_prefs->SetInteger(pref_key.c_str(), value); | 1759 prof_prefs->SetInteger(pref_key.c_str(), value); |
1757 } | 1760 } |
1758 | 1761 |
1759 static bool IsSingleThreaded() { | 1762 static bool IsSingleThreaded() { |
1760 static int thread_id = 0; | 1763 static int thread_id = 0; |
1761 if (!thread_id) | 1764 if (!thread_id) |
1762 thread_id = GetCurrentThreadId(); | 1765 thread_id = GetCurrentThreadId(); |
1763 return GetCurrentThreadId() == thread_id; | 1766 return GetCurrentThreadId() == thread_id; |
1764 } | 1767 } |
OLD | NEW |