diff --git a/src/build/common.gypi b/src/build/common.gypi index 0484d74dfb..1af2e0481a 100644 --- a/src/build/common.gypi +++ b/src/build/common.gypi @@ -95,6 +95,14 @@ '..','../..', # common_types.h, typedefs.h ], 'conditions': [ + ['build_with_chromium==1', { + 'defines': [ + # This turns off tracing in webrtc to reduce the noise from + # the Chrome memory bots. Down the line we will enable WebRTC + # tracing for Chromium and remove this. + 'WEBRTC_NO_TRACE', + ], + }], ['OS=="linux"', { 'defines': [ 'WEBRTC_TARGET_PC', diff --git a/src/system_wrappers/interface/trace.h b/src/system_wrappers/interface/trace.h index 0f7df4d46e..3addfcf4da 100644 --- a/src/system_wrappers/interface/trace.h +++ b/src/system_wrappers/interface/trace.h @@ -19,12 +19,24 @@ #include "typedefs.h" #ifdef WEBRTC_NO_TRACE - #define WEBRTC_TRACE +#ifdef WIN32 + // Use __noop to avoid the C4353 compiler warning on Windows. + #define WEBRTC_TRACE __noop() #else - // Ideally we would use __VA_ARGS__ but it's not supported by all compilers - // such as VS2003 (it's supported in VS2005). TODO (hellner) why - // would this be better than current implementation (not convinced)? - #define WEBRTC_TRACE Trace::Add + // This is a workaround. Ideally we should be able to do + // something like: + // #define WEBRTC_TRACE(...) ((void)0) + // However, we have code that creates variables with the only + // intent of tracing out their value. So, if we take the above + // approach, then we'll get a compiler error about unused variables. :( + inline void WebRtcNoTrace(...) {} + #define WEBRTC_TRACE WebRtcNoTrace +#endif +#else + // Ideally we would use _VA_ARGS_ but it's not supported by all compilers + // such as VS2003 (it's supported in VS2005). TODO (hellner) why + // would this be better than current implementation (not convinced)? + #define WEBRTC_TRACE Trace::Add #endif namespace webrtc {