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

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/performance_monitor/performance_monitor.h" 5 #include "chrome/browser/performance_monitor/performance_monitor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 17 matching lines...) Expand all
28 using content::BrowserThread; 28 using content::BrowserThread;
29 29
30 namespace performance_monitor { 30 namespace performance_monitor {
31 31
32 namespace { 32 namespace {
33 33
34 // The default interval at which PerformanceMonitor performs its timed 34 // The default interval at which PerformanceMonitor performs its timed
35 // collections. 35 // collections.
36 const int kGatherIntervalInSeconds = 120; 36 const int kGatherIntervalInSeconds = 120;
37 37
38 base::LazyInstance<PerformanceMonitor> g_monitor = LAZY_INSTANCE_INITIALIZER; 38 base::LazyInstance<PerformanceMonitor>::DestructorAtExit g_monitor =
39 LAZY_INSTANCE_INITIALIZER;
39 40
40 void GatherMetricsForRenderProcess(content::RenderProcessHost* host, 41 void GatherMetricsForRenderProcess(content::RenderProcessHost* host,
41 ProcessMetricsMetadata* data) { 42 ProcessMetricsMetadata* data) {
42 DCHECK_CURRENTLY_ON(BrowserThread::UI); 43 DCHECK_CURRENTLY_ON(BrowserThread::UI);
43 #if BUILDFLAG(ENABLE_EXTENSIONS) 44 #if BUILDFLAG(ENABLE_EXTENSIONS)
44 content::BrowserContext* browser_context = host->GetBrowserContext(); 45 content::BrowserContext* browser_context = host->GetBrowserContext();
45 extensions::ProcessMap* extension_process_map = 46 extensions::ProcessMap* extension_process_map =
46 extensions::ProcessMap::Get(browser_context); 47 extensions::ProcessMap::Get(browser_context);
47 48
48 std::set<std::string> extension_ids = 49 std::set<std::string> extension_ids =
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 208
208 void PerformanceMonitor::RunTriggersUIThread() { 209 void PerformanceMonitor::RunTriggersUIThread() {
209 DCHECK_CURRENTLY_ON(BrowserThread::UI); 210 DCHECK_CURRENTLY_ON(BrowserThread::UI);
210 for (auto& metrics : metrics_map_) 211 for (auto& metrics : metrics_map_)
211 metrics.second->RunPerformanceTriggers(); 212 metrics.second->RunPerformanceTriggers();
212 213
213 StartGatherCycle(); 214 StartGatherCycle();
214 } 215 }
215 216
216 } // namespace performance_monitor 217 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.h ('k') | chrome/browser/previews/previews_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698