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

Side by Side Diff: net/base/bandwidth_metrics.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 #include "base/lazy_instance.h" 5 #include "base/lazy_instance.h"
6 #include "net/base/bandwidth_metrics.h" 6 #include "net/base/bandwidth_metrics.h"
7 7
8 static base::LazyInstance<net::BandwidthMetrics> g_bandwidth_metrics = 8 static base::LazyInstance<net::BandwidthMetrics> g_bandwidth_metrics =
9 LAZY_INSTANCE_INITIALIZER; 9 LAZY_INSTANCE_INITIALIZER;
10 10
11 namespace net { 11 namespace net {
12 12
13 ScopedBandwidthMetrics::ScopedBandwidthMetrics() 13 ScopedBandwidthMetrics::ScopedBandwidthMetrics() : started_(false) {
14 : started_(false) {
15 } 14 }
16 15
17 ScopedBandwidthMetrics::~ScopedBandwidthMetrics() { 16 ScopedBandwidthMetrics::~ScopedBandwidthMetrics() {
18 if (started_) 17 if (started_)
19 g_bandwidth_metrics.Get().StopStream(); 18 g_bandwidth_metrics.Get().StopStream();
20 } 19 }
21 20
22 void ScopedBandwidthMetrics::StartStream() { 21 void ScopedBandwidthMetrics::StartStream() {
23 started_ = true; 22 started_ = true;
24 g_bandwidth_metrics.Get().StartStream(); 23 g_bandwidth_metrics.Get().StartStream();
25 } 24 }
26 25
27 void ScopedBandwidthMetrics::StopStream() { 26 void ScopedBandwidthMetrics::StopStream() {
28 started_ = false; 27 started_ = false;
29 g_bandwidth_metrics.Get().StopStream(); 28 g_bandwidth_metrics.Get().StopStream();
30 } 29 }
31 30
32 void ScopedBandwidthMetrics::RecordBytes(int bytes) { 31 void ScopedBandwidthMetrics::RecordBytes(int bytes) {
33 g_bandwidth_metrics.Get().RecordBytes(bytes); 32 g_bandwidth_metrics.Get().RecordBytes(bytes);
34 } 33 }
35 34
36 } // namespace net 35 } // namespace net
OLDNEW
« no previous file with comments | « net/base/bandwidth_metrics.h ('k') | net/base/cache_type.h » ('j') | net/base/mime_sniffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698