aboutsummaryrefslogtreecommitdiff
path: root/src/system_wrappers/source/trace_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/system_wrappers/source/trace_impl.h')
-rw-r--r--src/system_wrappers/source/trace_impl.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/system_wrappers/source/trace_impl.h b/src/system_wrappers/source/trace_impl.h
index 42e82fec70..455a3d5523 100644
--- a/src/system_wrappers/source/trace_impl.h
+++ b/src/system_wrappers/source/trace_impl.h
@@ -14,23 +14,11 @@
#include "system_wrappers/interface/critical_section_wrapper.h"
#include "system_wrappers/interface/event_wrapper.h"
#include "system_wrappers/interface/file_wrapper.h"
+#include "system_wrappers/interface/static_instance.h"
#include "system_wrappers/interface/trace.h"
#include "system_wrappers/interface/thread_wrapper.h"
namespace webrtc {
-enum TraceCount
-{
- WEBRTC_TRACE_DEC = 0,
- WEBRTC_TRACE_INC = 1,
- WEBRTC_TRACE_INC_NO_CREATE = 2
-};
-
-enum TraceCreate
-{
- WEBRTC_TRACE_EXIST = 0,
- WEBRTC_TRACE_CREATE = 1,
- WEBRTC_TRACE_DESTROY = 2
-};
// TODO (pwestin) WEBRTC_TRACE_MAX_QUEUE needs to be tweaked
// TODO (hellner) the buffer should be close to how much the system can write to
@@ -58,12 +46,9 @@ class TraceImpl : public Trace
public:
virtual ~TraceImpl();
- static Trace* CreateTrace();
+ static TraceImpl* CreateInstance();
static TraceImpl* GetTrace(const TraceLevel level = kTraceAll);
- static Trace* StaticInstance(TraceCount inc,
- const TraceLevel level = kTraceAll);
-
WebRtc_Word32 SetTraceFileImpl(const WebRtc_Word8* fileName,
const bool addFileCounter);
WebRtc_Word32 TraceFileImpl(
@@ -81,6 +66,9 @@ public:
protected:
TraceImpl();
+ static TraceImpl* StaticInstance(CountOperation count_operation,
+ const TraceLevel level = kTraceAll);
+
// OS specific implementations
virtual WebRtc_Word32 AddThreadId(char* traceMessage) const = 0;
virtual WebRtc_Word32 AddTime(char* traceMessage,
@@ -93,6 +81,8 @@ protected:
bool Process();
private:
+ friend class Trace;
+
WebRtc_Word32 AddLevel(char* szMessage, const TraceLevel level) const;
WebRtc_Word32 AddModuleAndId(char* traceMessage, const TraceModule module,
@@ -119,7 +109,7 @@ private:
void WriteToFile();
- CriticalSectionWrapper& _critsectInterface;
+ CriticalSectionWrapper* _critsectInterface;
TraceCallback* _callback;
WebRtc_UWord32 _rowCountText;
WebRtc_UWord32 _fileCountText;
@@ -129,7 +119,7 @@ private:
EventWrapper& _event;
// _critsectArray protects _activeQueue
- CriticalSectionWrapper& _critsectArray;
+ CriticalSectionWrapper* _critsectArray;
WebRtc_UWord16 _nextFreeIdx[WEBRTC_TRACE_NUM_ARRAY];
TraceLevel _level[WEBRTC_TRACE_NUM_ARRAY][WEBRTC_TRACE_MAX_QUEUE];
WebRtc_UWord16 _length[WEBRTC_TRACE_NUM_ARRAY][WEBRTC_TRACE_MAX_QUEUE];