| OLD | NEW |
| 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is created at ChromeFrame startup in | 10 // A MetricsService instance is created at ChromeFrame startup in |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; | 72 static const char kMetricsType[] = "application/vnd.mozilla.metrics.bz2"; |
| 73 | 73 |
| 74 // The first UMA upload occurs after this interval. | 74 // The first UMA upload occurs after this interval. |
| 75 static const int kInitialUMAUploadTimeoutMilliSeconds = 30000; | 75 static const int kInitialUMAUploadTimeoutMilliSeconds = 30000; |
| 76 | 76 |
| 77 // Default to one UMA upload per 10 mins. | 77 // Default to one UMA upload per 10 mins. |
| 78 static const int kMinMilliSecondsPerUMAUpload = 600000; | 78 static const int kMinMilliSecondsPerUMAUpload = 600000; |
| 79 | 79 |
| 80 base::LazyInstance<base::ThreadLocalPointer<MetricsService> > | 80 base::LazyInstance<base::ThreadLocalPointer<MetricsService> > |
| 81 MetricsService::g_metrics_instance_(base::LINKER_INITIALIZED); | 81 MetricsService::g_metrics_instance_ = LAZY_INSTANCE_INITIALIZER; |
| 82 | 82 |
| 83 base::Lock MetricsService::metrics_service_lock_; | 83 base::Lock MetricsService::metrics_service_lock_; |
| 84 | 84 |
| 85 // Initialize histogram statistics gathering system. | 85 // Initialize histogram statistics gathering system. |
| 86 base::LazyInstance<base::StatisticsRecorder> | 86 base::LazyInstance<base::StatisticsRecorder> |
| 87 g_statistics_recorder_(base::LINKER_INITIALIZED); | 87 g_statistics_recorder_ = LAZY_INSTANCE_INITIALIZER; |
| 88 | 88 |
| 89 // This class provides functionality to upload the ChromeFrame UMA data to the | 89 // This class provides functionality to upload the ChromeFrame UMA data to the |
| 90 // server. An instance of this class is created whenever we have data to be | 90 // server. An instance of this class is created whenever we have data to be |
| 91 // uploaded to the server. | 91 // uploaded to the server. |
| 92 class ChromeFrameMetricsDataUploader : public BSCBImpl { | 92 class ChromeFrameMetricsDataUploader : public BSCBImpl { |
| 93 public: | 93 public: |
| 94 ChromeFrameMetricsDataUploader() | 94 ChromeFrameMetricsDataUploader() |
| 95 : cache_stream_(NULL), | 95 : cache_stream_(NULL), |
| 96 upload_data_size_(0) { | 96 upload_data_size_(0) { |
| 97 DVLOG(1) << __FUNCTION__; | 97 DVLOG(1) << __FUNCTION__; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 version += "-F"; | 459 version += "-F"; |
| 460 if (!version_info.IsOfficialBuild()) | 460 if (!version_info.IsOfficialBuild()) |
| 461 version.append("-devel"); | 461 version.append("-devel"); |
| 462 return version; | 462 return version; |
| 463 } else { | 463 } else { |
| 464 NOTREACHED() << "Unable to retrieve version string."; | 464 NOTREACHED() << "Unable to retrieve version string."; |
| 465 } | 465 } |
| 466 | 466 |
| 467 return std::string(); | 467 return std::string(); |
| 468 } | 468 } |
| OLD | NEW |