# HG changeset patch # User Mike Hommey # Date 1544778438 0 # Node ID 8160b9f376eefdfba360fb8d1a851c6dcf4bcd93 # Parent 31dffdb9b027c03f28e30fe72c1ad3f6572a86d3 Bug 1514104 - Remove vpx_mem_set_functions support. r=jya vpx_mem_set_functions support is only enabled when MOZ_VPX_NO_MEM_REPORTING is not set. It is currently set unconditionally when building with the in-tree libvpx. When building with system libvpx, it is set when the vpx_mem_set_functions can't be found in the system libvpx library. Upstream removed the vpx_mem_set_functions function in version 1.5, and we require at least that version, meaning, in practice, MOZ_VPX_NO_MEM_REPORTING is now always set. We might as well remove the define and the code that's conditional to not being defined. Differential Revision: https://phabricator.services.mozilla.com/D14517 diff --git a/old-configure.in b/old-configure.in --- a/old-configure.in +++ b/old-configure.in @@ -2252,23 +2252,16 @@ if test -n "$MOZ_SYSTEM_LIBVPX"; then CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS" LIBS="$LIBS $MOZ_LIBVPX_LIBS" MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [], [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])]) AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [], [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])]) - - MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h], - [AC_CHECK_FUNC(vpx_mem_set_functions)]) - if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \ - "$ac_cv_func_vpx_mem_set_functions" = no; then - AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING) - fi fi CFLAGS=$_SAVE_CFLAGS LIBS=$_SAVE_LIBS AC_SUBST(MOZ_SYSTEM_LIBVPX) AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS) AC_SUBST_LIST(MOZ_LIBVPX_LIBS) @@ -2354,19 +2347,16 @@ if test -z "$MOZ_SYSTEM_LIBVPX"; then if test -n "$VPX_X86_ASM"; then AC_DEFINE(VPX_X86_ASM) elif test -n "$VPX_ARM_ASM"; then AC_DEFINE(VPX_ARM_ASM) else AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.]) fi - - dnl native libvpx no longer has vpx_mem_set_functions - AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING) fi dnl ======================================================== dnl = Handle dependent MEDIA defines dnl ======================================================== MOZ_WEBM_ENCODER=1 AC_DEFINE(MOZ_WEBM_ENCODER) diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -131,25 +131,16 @@ extern nsresult nsStringInputStreamConst #include "mozilla/AvailableMemoryTracker.h" #include "mozilla/ClearOnShutdown.h" #include "mozilla/CountingAllocatorBase.h" #include "mozilla/UniquePtr.h" #include "mozilla/ipc/GeckoChildProcessHost.h" #include "ogg/ogg.h" -#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) -#if defined(HAVE_STDINT_H) -// mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in -// vpx_config.h (which we include via vpx_mem.h, below). This redefinition -// triggers a build warning on MSVC, so we have to #undef it first. -#undef HAVE_STDINT_H -#endif -#include "vpx_mem/vpx_mem.h" -#endif #include "GeckoProfiler.h" #include "jsapi.h" #include "js/Initialization.h" #include "gfxPlatform.h" @@ -412,45 +403,16 @@ private: ~OggReporter() {} }; NS_IMPL_ISUPPORTS(OggReporter, nsIMemoryReporter) /* static */ template<> Atomic CountingAllocatorBase::sAmount(0); -#ifdef MOZ_VPX -class VPXReporter final - : public nsIMemoryReporter - , public CountingAllocatorBase -{ -public: - NS_DECL_ISUPPORTS - -private: - NS_IMETHOD - CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData, - bool aAnonymize) override - { - MOZ_COLLECT_REPORT( - "explicit/media/libvpx", KIND_HEAP, UNITS_BYTES, MemoryAllocated(), - "Memory allocated through libvpx for WebM media files."); - - return NS_OK; - } - - ~VPXReporter() {} -}; - -NS_IMPL_ISUPPORTS(VPXReporter, nsIMemoryReporter) - -/* static */ template<> Atomic -CountingAllocatorBase::sAmount(0); -#endif /* MOZ_VPX */ - static bool sInitializedJS = false; // Note that on OSX, aBinDirectory will point to .app/Contents/Resources/browser EXPORT_XPCOM_API(nsresult) NS_InitXPCOM2(nsIServiceManager** aResult, nsIFile* aBinDirectory, nsIDirectoryServiceProvider* aAppFileLocationProvider) { @@ -636,27 +598,16 @@ NS_InitXPCOM2(nsIServiceManager** aResul mozilla::SetICUMemoryFunctions(); // Do the same for libogg. ogg_set_mem_functions(OggReporter::CountingMalloc, OggReporter::CountingCalloc, OggReporter::CountingRealloc, OggReporter::CountingFree); -#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) - // And for VPX. - vpx_mem_set_functions(VPXReporter::CountingMalloc, - VPXReporter::CountingCalloc, - VPXReporter::CountingRealloc, - VPXReporter::CountingFree, - memcpy, - memset, - memmove); -#endif - // Initialize the JS engine. const char* jsInitFailureReason = JS_InitWithFailureDiagnostic(); if (jsInitFailureReason) { MOZ_CRASH_UNSAFE_OOL(jsInitFailureReason); } sInitializedJS = true; rv = nsComponentManagerImpl::gComponentManager->Init(); @@ -698,19 +649,16 @@ NS_InitXPCOM2(nsIServiceManager** aResul NS_XPCOM_STARTUP_OBSERVER_ID); #ifdef XP_WIN CreateAnonTempFileRemover(); #endif // The memory reporter manager is up and running -- register our reporters. RegisterStrongMemoryReporter(new ICUReporter()); RegisterStrongMemoryReporter(new OggReporter()); -#ifdef MOZ_VPX - RegisterStrongMemoryReporter(new VPXReporter()); -#endif mozilla::Telemetry::Init(); mozilla::HangMonitor::Startup(); mozilla::BackgroundHangMonitor::Startup(); const MessageLoop* const loop = MessageLoop::current(); sMainHangMonitor = new mozilla::BackgroundHangMonitor(