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

Side by Side Diff: chrome_frame/metrics_service.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 | « chrome_frame/external_tab.cc ('k') | chrome_frame/test/net/fake_external_tab.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 //------------------------------------------------------------------------------ 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
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
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 }
OLDNEW
« no previous file with comments | « chrome_frame/external_tab.cc ('k') | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698