diff --git a/xpcom/build/IOInterposer.cpp b/xpcom/build/IOInterposer.cpp index 34658958707..b8ae223f5af 100644 --- a/xpcom/build/IOInterposer.cpp +++ b/xpcom/build/IOInterposer.cpp @@ -157,9 +157,7 @@ IOInterposeObserver::Operation IOInterposer::sObservedOperations = sIsMainThread.set(isMainThread); } // Now we initialize the various interposers depending on platform -#if defined(XP_WIN) || defined(XP_MACOSX) InitPoisonIOInterposer(); -#endif // We don't hook NSPR on Windows because PoisonIOInterposer captures a // superset of the former's events. #if !defined(XP_WIN) diff --git a/xpcom/build/IOInterposer.h b/xpcom/build/IOInterposer.h index 8ebd6a67e1d..e73ec1c0fd6 100644 --- a/xpcom/build/IOInterposer.h +++ b/xpcom/build/IOInterposer.h @@ -146,8 +146,6 @@ protected: static bool IsMainThread(); }; -#ifdef MOZ_ENABLE_PROFILER_SPS - /** * Class offering the public static IOInterposer API. * @@ -260,34 +258,14 @@ public: RegisterCurrentThread(bool aIsMainThread = false); }; -#else /* MOZ_ENABLE_PROFILER_SPS */ - -class IOInterposer MOZ_FINAL -{ - IOInterposer(); -public: - static inline void Init() {} - static inline void Clear() {} - static inline void Disable() {} - static inline void Report(IOInterposeObserver::Observation& aOb) {} - static inline void Register(IOInterposeObserver::Operation aOp, - IOInterposeObserver* aObserver) {} - static inline void Unregister(IOInterposeObserver::Operation aOp, - IOInterposeObserver* aObserver) {} - static inline bool IsObservedOperation(IOInterposeObserver::Operation aOp) { - return false; - } - static inline void RegisterCurrentThread(bool) {} -}; - -#endif /* MOZ_ENABLE_PROFILER_SPS */ - class IOInterposerInit { public: IOInterposerInit() { +#if defined(MOZ_ENABLE_PROFILER_SPS) IOInterposer::Init(); +#endif } // No destructor needed at the moment -- this stuff stays active for the diff --git a/xpcom/build/NSPRInterposer.h b/xpcom/build/NSPRInterposer.h index f307146be34..342168663f6 100644 --- a/xpcom/build/NSPRInterposer.h +++ b/xpcom/build/NSPRInterposer.h @@ -5,8 +5,6 @@ #ifndef NSPRINTERPOSER_H_ #define NSPRINTERPOSER_H_ -#ifdef MOZ_ENABLE_PROFILER_SPS - namespace mozilla { /** @@ -25,6 +23,4 @@ void ClearNSPRIOInterposing(); } // namespace mozilla -#endif // MOZ_ENABLE_PROFILER_SPS - #endif // NSPRINTERPOSER_H_ diff --git a/xpcom/build/PoisonIOInterposer.h b/xpcom/build/PoisonIOInterposer.h index 87fb932fc3f..b3ef0d3b034 100644 --- a/xpcom/build/PoisonIOInterposer.h +++ b/xpcom/build/PoisonIOInterposer.h @@ -26,7 +26,7 @@ void MozillaUnRegisterDebugFILE(FILE *f); MOZ_END_EXTERN_C -#if defined(MOZ_ENABLE_PROFILER_SPS) && (defined(XP_WIN) || defined(XP_MACOSX)) +#if defined(XP_WIN) || defined(XP_MACOSX) #ifdef __cplusplus namespace mozilla { @@ -63,7 +63,7 @@ void ClearPoisonIOInterposer(); } // namespace mozilla #endif /* __cplusplus */ -#else /* MOZ_ENABLE_PROFILER_SPS && (XP_WIN || XP_MACOSX) */ +#else /* XP_WIN || XP_MACOSX */ #ifdef __cplusplus namespace mozilla { @@ -76,6 +76,6 @@ inline void OnlyReportDirtyWrites(){} } // namespace mozilla #endif /* __cplusplus */ -#endif /* MOZ_ENABLE_PROFILER_SPS && (XP_WIN || XP_MACOSX) */ +#endif /* XP_WIN || XP_MACOSX */ #endif // mozilla_PoisonIOInterposer_h diff --git a/xpcom/build/PoisonIOInterposerStub.cpp b/xpcom/build/PoisonIOInterposerStub.cpp index addca3b1d76..4929cc4b493 100644 --- a/xpcom/build/PoisonIOInterposerStub.cpp +++ b/xpcom/build/PoisonIOInterposerStub.cpp @@ -8,8 +8,6 @@ extern "C" { - // Define empty implementations so we can compile when - // MOZ_ENABLE_PROFILER_SPS is undefined void MozillaRegisterDebugFD(int fd) {} void MozillaRegisterDebugFILE(FILE *f) {} void MozillaUnRegisterDebugFD(int fd) {} diff --git a/xpcom/build/moz.build b/xpcom/build/moz.build index d8738f79270..13f804661ba 100644 --- a/xpcom/build/moz.build +++ b/xpcom/build/moz.build @@ -27,15 +27,12 @@ EXPORTS.mozilla += [ if CONFIG['OS_ARCH'] == 'WINNT': EXPORTS += ['nsWindowsDllInterceptor.h'] EXPORTS.mozilla += ['perfprobe.h'] - SOURCES += ['perfprobe.cpp'] - if CONFIG['MOZ_ENABLE_PROFILER_SPS']: - SOURCES += [ - 'PoisonIOInterposerBase.cpp', - 'PoisonIOInterposerWin.cpp', - ] - else: - SOURCES += ['PoisonIOInterposerStub.cpp'] -elif CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['MOZ_ENABLE_PROFILER_SPS']: + SOURCES += [ + 'perfprobe.cpp', + 'PoisonIOInterposerBase.cpp', + 'PoisonIOInterposerWin.cpp', + ] +elif CONFIG['OS_ARCH'] == 'Darwin': SOURCES += [ 'mach_override.c', 'PoisonIOInterposerBase.cpp', @@ -51,20 +48,17 @@ UNIFIED_SOURCES += xpcom_glue_src_cppsrcs UNIFIED_SOURCES += [ 'FrozenFunctions.cpp', + 'IOInterposer.cpp', 'LateWriteChecks.cpp', 'nsXPComInit.cpp', 'nsXPCOMStrings.cpp', 'Services.cpp', ] -if CONFIG['MOZ_ENABLE_PROFILER_SPS']: +if CONFIG['OS_ARCH'] != 'WINNT': SOURCES += [ - 'IOInterposer.cpp', + 'NSPRInterposer.cpp', ] - if CONFIG['OS_ARCH'] != 'WINNT': - SOURCES += [ - 'NSPRInterposer.cpp', - ] # FileLocation.cpp and Omnijar.cpp cannot be built in unified mode because they # use plarena.h.