Fixes a build error when disabling trace (which is done when building with chrome flag is set).

Review URL: http://webrtc-codereview.appspot.com/318006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1155 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2011-12-10 00:44:47 +00:00
parent c6b286fc04
commit 2f47b5a70f
3 changed files with 60 additions and 59 deletions

View File

@ -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

View File

@ -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

View File

@ -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