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

Side by Side Diff: content/renderer/media/webrtc_uma_histograms.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
« no previous file with comments | « content/renderer/media/webrtc_uma_histograms.h ('k') | content/renderer/render_widget.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/media/webrtc_uma_histograms.h" 5 #include "content/renderer/media/webrtc_uma_histograms.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 12 matching lines...) Expand all
23 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name; 23 DVLOG(3) << "Incrementing WebRTC.webkitApiCount for " << api_name;
24 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME); 24 UMA_HISTOGRAM_ENUMERATION("WebRTC.webkitApiCount", api_name, INVALID_NAME);
25 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name); 25 PerSessionWebRTCAPIMetrics::GetInstance()->LogUsageOnlyOnce(api_name);
26 } 26 }
27 27
28 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() { 28 PerSessionWebRTCAPIMetrics::~PerSessionWebRTCAPIMetrics() {
29 } 29 }
30 30
31 // static 31 // static
32 PerSessionWebRTCAPIMetrics* PerSessionWebRTCAPIMetrics::GetInstance() { 32 PerSessionWebRTCAPIMetrics* PerSessionWebRTCAPIMetrics::GetInstance() {
33 return Singleton<PerSessionWebRTCAPIMetrics>::get(); 33 return base::Singleton<PerSessionWebRTCAPIMetrics>::get();
34 } 34 }
35 35
36 void PerSessionWebRTCAPIMetrics::IncrementStreamCounter() { 36 void PerSessionWebRTCAPIMetrics::IncrementStreamCounter() {
37 DCHECK(CalledOnValidThread()); 37 DCHECK(CalledOnValidThread());
38 ++num_streams_; 38 ++num_streams_;
39 } 39 }
40 40
41 void PerSessionWebRTCAPIMetrics::DecrementStreamCounter() { 41 void PerSessionWebRTCAPIMetrics::DecrementStreamCounter() {
42 DCHECK(CalledOnValidThread()); 42 DCHECK(CalledOnValidThread());
43 if (--num_streams_ == 0) { 43 if (--num_streams_ == 0) {
(...skipping 18 matching lines...) Expand all
62 LogUsage(api_name); 62 LogUsage(api_name);
63 } 63 }
64 } 64 }
65 65
66 void PerSessionWebRTCAPIMetrics::ResetUsage() { 66 void PerSessionWebRTCAPIMetrics::ResetUsage() {
67 for (size_t i = 0; i < arraysize(has_used_api_); ++i) 67 for (size_t i = 0; i < arraysize(has_used_api_); ++i)
68 has_used_api_[i] = false; 68 has_used_api_[i] = false;
69 } 69 }
70 70
71 } // namespace content 71 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_uma_histograms.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698