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

Side by Side Diff: talk/app/webrtc/fakemetricsobserver.cc

Issue 1305113002: Clean up some code change (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 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 | « no previous file | webrtc/base/network.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 18 matching lines...) Expand all
29 #include "webrtc/base/checks.h" 29 #include "webrtc/base/checks.h"
30 30
31 namespace webrtc { 31 namespace webrtc {
32 32
33 FakeMetricsObserver::FakeMetricsObserver() { 33 FakeMetricsObserver::FakeMetricsObserver() {
34 Reset(); 34 Reset();
35 } 35 }
36 36
37 void FakeMetricsObserver::Reset() { 37 void FakeMetricsObserver::Reset() {
38 DCHECK(thread_checker_.CalledOnValidThread()); 38 DCHECK(thread_checker_.CalledOnValidThread());
39 counters_ = std::vector<std::vector<int>>(); 39 counters_.clear();
40 memset(int_histogram_samples_, 0, sizeof(int_histogram_samples_)); 40 memset(int_histogram_samples_, 0, sizeof(int_histogram_samples_));
41 for (std::string& type : string_histogram_samples_) { 41 for (std::string& type : string_histogram_samples_) {
42 type.clear(); 42 type.clear();
43 } 43 }
44 } 44 }
45 45
46 void FakeMetricsObserver::IncrementEnumCounter( 46 void FakeMetricsObserver::IncrementEnumCounter(
47 PeerConnectionEnumCounterType type, 47 PeerConnectionEnumCounterType type,
48 int counter, 48 int counter,
49 int counter_max) { 49 int counter_max) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return int_histogram_samples_[type]; 85 return int_histogram_samples_[type];
86 } 86 }
87 87
88 const std::string& FakeMetricsObserver::GetStringHistogramSample( 88 const std::string& FakeMetricsObserver::GetStringHistogramSample(
89 PeerConnectionMetricsName type) const { 89 PeerConnectionMetricsName type) const {
90 DCHECK(thread_checker_.CalledOnValidThread()); 90 DCHECK(thread_checker_.CalledOnValidThread());
91 return string_histogram_samples_[type]; 91 return string_histogram_samples_[type];
92 } 92 }
93 93
94 } // namespace webrtc 94 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/network.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698