Bug 983957 - Remove SPS ifdef from IOInterposer to unbreak non-SPS platforms; r=aklotz

This commit is contained in:
Jan Beich 2014-03-18 16:24:36 -06:00
parent a1e2106893
commit e341c88dbe
6 changed files with 14 additions and 50 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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) {}

View File

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