Bug 937201 - Fix Windows builds without MOZ_ENABLE_PROFILER_SPS. r=BenWa

This commit is contained in:
Jonas Finnemann Jensen 2013-11-18 13:21:26 -05:00
parent 67c63f72fb
commit b9058cd9ed
4 changed files with 32 additions and 17 deletions

View File

@ -2128,8 +2128,7 @@ RecordShutdownEndTimeStamp() {
// calling _exit, but on a debug build or when the user forces a full
// shutdown this is called as late as possible, so we have to
// white list this write as write poisoning will be enabled.
int fd = fileno(f);
MozillaRegisterDebugFD(fd);
MozillaRegisterDebugFILE(f);
TimeStamp now = TimeStamp::Now();
MOZ_ASSERT(now >= gRecordedShutdownStartTime);

View File

@ -10,8 +10,6 @@
#include "mozilla/Types.h"
#include <stdio.h>
#if defined(MOZ_ENABLE_PROFILER_SPS) && (defined(XP_WIN) || defined(XP_MACOSX))
MOZ_BEGIN_EXTERN_C
/** Register file descriptor to be ignored by poisoning IO interposer */
@ -28,6 +26,8 @@ void MozillaUnRegisterDebugFILE(FILE *f);
MOZ_END_EXTERN_C
#if defined(MOZ_ENABLE_PROFILER_SPS) && (defined(XP_WIN) || defined(XP_MACOSX))
#ifdef __cplusplus
namespace mozilla {
@ -65,13 +65,6 @@ void ClearPoisonIOInterposer();
#else /* MOZ_ENABLE_PROFILER_SPS && (XP_WIN || XP_MACOSX) */
MOZ_BEGIN_EXTERN_C
inline void MozillaRegisterDebugFD(int fd){}
inline void MozillaRegisterDebugFILE(FILE *f){}
inline void MozillaUnRegisterDebugFD(int fd){}
inline void MozillaUnRegisterDebugFILE(FILE *f){}
MOZ_END_EXTERN_C
#ifdef __cplusplus
namespace mozilla {
inline bool IsDebugFile(intptr_t aFileID){ return true; }

View File

@ -0,0 +1,18 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 ci et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stdio.h>
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) {}
void MozillaUnRegisterDebugFILE(FILE *f) {}
}

View File

@ -27,17 +27,22 @@ EXPORTS.mozilla += [
if CONFIG['OS_ARCH'] == 'WINNT':
EXPORTS.mozilla += ['perfprobe.h']
SOURCES += [
'perfprobe.cpp',
'PoisonIOInterposerBase.cpp',
'PoisonIOInterposerWin.cpp',
]
elif CONFIG['OS_ARCH'] == 'Darwin':
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 += [
'mach_override.c',
'PoisonIOInterposerBase.cpp',
'PoisonIOInterposerMac.cpp',
]
else:
SOURCES += ['PoisonIOInterposerStub.cpp']
include('../glue/objs.mozbuild')