Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_DELAYED_LOGGER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_DELAYED_LOGGER_H_ | |
| 13 | |
| 14 #include <string> | |
| 15 | |
| 16 #include "webrtc/base/constructormagic.h" | |
| 17 | |
| 18 namespace webrtc { | |
| 19 namespace acm2 { | |
| 20 | |
| 21 // This class handles logging of values to histograms. Registering new values | |
| 22 // and writing to histogram is handled by separate functions. | |
| 23 class DelayedLogger { | |
| 24 public: | |
| 25 explicit DelayedLogger(const std::string& histogram_name); | |
| 26 ~DelayedLogger(); | |
| 27 | |
| 28 // Logs a new value locally in the DelayedLogger object. Nothing is written | |
| 29 // to the histogram from this function. The value will be written on the next | |
| 30 // call to MaybeLogTargetBitrate. | |
| 31 void SetValue(int value); | |
|
kwiberg-webrtc
2015/06/25 09:42:44
It isn't clear from this description that a second
| |
| 32 | |
| 33 // Writes value to histogram, if SetValue was called since the last invocation | |
| 34 // of MaybeLogValue. If not, this function does nothing. | |
| 35 void MaybeLogValue(); | |
|
kwiberg-webrtc
2015/06/25 09:42:44
You don't suppress logging of a value that's ident
| |
| 36 | |
| 37 private: | |
| 38 int value_; | |
| 39 bool log_on_next_call_; | |
| 40 const std::string histogram_name_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(DelayedLogger); | |
| 43 }; | |
| 44 | |
| 45 } // namespace acm2 | |
| 46 } // namespace webrtc | |
| 47 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_DELAYED_LOGGER_H_ | |
| OLD | NEW |