| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_VOICE_ENGINE_STATISTICS_H | 11 #ifndef WEBRTC_VOICE_ENGINE_STATISTICS_H |
| 12 #define WEBRTC_VOICE_ENGINE_STATISTICS_H | 12 #define WEBRTC_VOICE_ENGINE_STATISTICS_H |
| 13 | 13 |
| 14 #include "webrtc/base/criticalsection.h" |
| 14 #include "webrtc/common_types.h" | 15 #include "webrtc/common_types.h" |
| 15 #include "webrtc/typedefs.h" | 16 #include "webrtc/typedefs.h" |
| 16 #include "webrtc/voice_engine/include/voe_errors.h" | 17 #include "webrtc/voice_engine/include/voe_errors.h" |
| 17 #include "webrtc/voice_engine/voice_engine_defines.h" | 18 #include "webrtc/voice_engine/voice_engine_defines.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 class CriticalSectionWrapper; | |
| 21 | |
| 22 namespace voe { | 21 namespace voe { |
| 23 | 22 |
| 24 class Statistics | 23 class Statistics |
| 25 { | 24 { |
| 26 public: | 25 public: |
| 27 enum {KTraceMaxMessageSize = 256}; | 26 enum {KTraceMaxMessageSize = 256}; |
| 28 public: | 27 public: |
| 29 Statistics(uint32_t instanceId); | 28 Statistics(uint32_t instanceId); |
| 30 ~Statistics(); | 29 ~Statistics(); |
| 31 | 30 |
| 32 int32_t SetInitialized(); | 31 int32_t SetInitialized(); |
| 33 int32_t SetUnInitialized(); | 32 int32_t SetUnInitialized(); |
| 34 bool Initialized() const; | 33 bool Initialized() const; |
| 35 int32_t SetLastError(int32_t error) const; | 34 int32_t SetLastError(int32_t error) const; |
| 36 int32_t SetLastError(int32_t error, TraceLevel level) const; | 35 int32_t SetLastError(int32_t error, TraceLevel level) const; |
| 37 int32_t SetLastError(int32_t error, | 36 int32_t SetLastError(int32_t error, |
| 38 TraceLevel level, | 37 TraceLevel level, |
| 39 const char* msg) const; | 38 const char* msg) const; |
| 40 int32_t LastError() const; | 39 int32_t LastError() const; |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 CriticalSectionWrapper* _critPtr; | 42 mutable rtc::CriticalSection lock_; |
| 44 const uint32_t _instanceId; | 43 const uint32_t _instanceId; |
| 45 mutable int32_t _lastError; | 44 mutable int32_t _lastError; |
| 46 bool _isInitialized; | 45 bool _isInitialized; |
| 47 }; | 46 }; |
| 48 | 47 |
| 49 } // namespace voe | 48 } // namespace voe |
| 50 | 49 |
| 51 } // namespace webrtc | 50 } // namespace webrtc |
| 52 | 51 |
| 53 #endif // WEBRTC_VOICE_ENGINE_STATISTICS_H | 52 #endif // WEBRTC_VOICE_ENGINE_STATISTICS_H |
| OLD | NEW |