diff --git a/src/system_wrappers/source/system_wrappers.gyp b/src/system_wrappers/source/system_wrappers.gyp index afaa23368..1b491ab42 100644 --- a/src/system_wrappers/source/system_wrappers.gyp +++ b/src/system_wrappers/source/system_wrappers.gyp @@ -84,6 +84,7 @@ 'thread_windows.h', 'thread_windows_set_name.h', 'trace_impl.cc', + 'trace_impl_no_op.cc', 'trace_impl.h', 'trace_posix.h', 'trace_windows.h', @@ -147,10 +148,12 @@ ['build_with_chromium==1', { 'sources!': [ 'cpu.cc', + 'trace_impl.cc', ], }, { 'sources!': [ 'cpu_dummy.cc', + 'trace_impl_no_op.cc', ], }] ] # conditions diff --git a/src/system_wrappers/source/trace_impl.cc b/src/system_wrappers/source/trace_impl.cc index f964f9435..50e69f341 100644 --- a/src/system_wrappers/source/trace_impl.cc +++ b/src/system_wrappers/source/trace_impl.cc @@ -33,20 +33,6 @@ namespace webrtc { static WebRtc_UWord32 levelFilter = kTraceDefault; -#ifdef WEBRTC_NO_TRACE -class TraceNoop : public Trace -{ -public: - TraceNoop() - { - } - - virtual ~TraceNoop() - { - } -}; -#endif - // Construct On First Use idiom. Avoids "static initialization order fiasco". TraceImpl* TraceImpl::StaticInstance(CountOperation count_operation, const TraceLevel level) @@ -74,9 +60,7 @@ TraceImpl* TraceImpl::GetTrace(const TraceLevel level) TraceImpl* TraceImpl::CreateInstance() { -#ifdef WEBRTC_NO_TRACE - return new TraceNoop(); -#elif defined(_WIN32) +#if defined(_WIN32) return new TraceWindows(); #else return new TracePosix(); @@ -754,8 +738,6 @@ bool TraceImpl::CreateFileName( return true; } -#ifndef WEBRTC_NO_TRACE - void Trace::CreateTrace() { TraceImpl::StaticInstance(kAddRef); @@ -843,45 +825,5 @@ void Trace::Add(const TraceLevel level, const TraceModule module, ReturnTrace(); } } -#else -void Trace::CreateTrace() -{ -} -void Trace::ReturnTrace() -{ -} - -WebRtc_Word32 Trace::SetLevelFilter(WebRtc_UWord32 filter) -{ - return 0; -} - -WebRtc_Word32 Trace::LevelFilter(WebRtc_UWord32& filter) -{ - return 0; -} - -WebRtc_Word32 Trace::TraceFile(WebRtc_Word8 fileName[FileWrapper::kMaxFileNameSize]) -{ - return -1; -} - -WebRtc_Word32 Trace::SetTraceFile(const WebRtc_Word8* fileName, - const bool addFileCounter) -{ - return -1; -} - -WebRtc_Word32 Trace::SetTraceCallback(TraceCallback* callback) -{ - return -1; -} - -void Trace::Add(const TraceLevel level, const TraceModule module, - const WebRtc_Word32 id, const char* msg, ...) - -{ -} -#endif } // namespace webrtc diff --git a/src/system_wrappers/source/trace_impl_no_op.cc b/src/system_wrappers/source/trace_impl_no_op.cc new file mode 100644 index 000000000..17528711b --- /dev/null +++ b/src/system_wrappers/source/trace_impl_no_op.cc @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "trace.h" + +namespace webrtc { + +void Trace::CreateTrace() +{ +} + +void Trace::ReturnTrace() +{ +} + +WebRtc_Word32 Trace::SetLevelFilter(WebRtc_UWord32 /*filter*/) +{ + return 0; +} + +WebRtc_Word32 Trace::LevelFilter(WebRtc_UWord32& /*filter*/) +{ + return 0; +} + +WebRtc_Word32 Trace::TraceFile( + WebRtc_Word8 /*fileName*/[1024]) +{ + return -1; +} + +WebRtc_Word32 Trace::SetTraceFile(const WebRtc_Word8* /*fileName*/, + const bool /*addFileCounter*/) +{ + return -1; +} + +WebRtc_Word32 Trace::SetTraceCallback(TraceCallback* /*callback*/) +{ + return -1; +} + +void Trace::Add(const TraceLevel /*level*/, const TraceModule /*module*/, + const WebRtc_Word32 /*id*/, const char* /*msg*/, ...) + +{ +} + +} // namespace webrtc