Bug 947736 - Build modules/libpref/ in unified mode; r=bsmedberg
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 10 Dec 2013 18:10:01 -0500
changeset 159804 98be0e9cbc152f4313ef9adbbc0b6925ef7d0123
parent 159803 70e76314c8a7ee99ee8666c3a5aacb662ee4fe49
child 159805 57197340e1daf668f471fef1341065e2d9777b97
push id25814
push usercbook@mozilla.com
push dateWed, 11 Dec 2013 09:13:21 +0000
treeherdermozilla-central@d14c74014d95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs947736
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 947736 - Build modules/libpref/ in unified mode; r=bsmedberg
content/events/src/nsEventStateManager.cpp
content/events/src/nsEventStateManager.h
content/media/AudioStream.cpp
content/media/AudioStream.h
content/xul/document/src/XULDocument.cpp
content/xul/document/src/XULDocument.h
content/xul/document/src/nsXULPrototypeCache.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
dom/encoding/FallbackEncoding.cpp
dom/encoding/FallbackEncoding.h
dom/ipc/ProcessPriorityManager.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
dom/workers/RuntimeService.cpp
dom/workers/RuntimeService.h
editor/libeditor/text/nsPlaintextEditor.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
image/src/DiscardTracker.cpp
image/src/DiscardTracker.h
layout/base/nsLayoutUtils.cpp
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameSetFrame.h
layout/style/nsComputedDOMStyle.cpp
layout/xul/nsXULTooltipListener.cpp
layout/xul/nsXULTooltipListener.h
modules/libpref/public/Preferences.h
modules/libpref/src/Preferences.cpp
modules/libpref/src/moz.build
modules/libpref/src/nsPrefBranch.cpp
modules/libpref/src/nsPrefBranch.h
modules/libpref/src/prefapi.cpp
modules/libpref/src/prefapi.h
modules/libpref/src/prefapi_private_data.h
widget/windows/WinMouseScrollHandler.h
widget/xpwidgets/nsXPLookAndFeel.cpp
widget/xpwidgets/nsXPLookAndFeel.h
xpcom/threads/HangMonitor.cpp
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -5506,24 +5506,23 @@ nsEventStateManager::WheelPrefs::GetInst
 void
 nsEventStateManager::WheelPrefs::Shutdown()
 {
   delete sInstance;
   sInstance = nullptr;
 }
 
 // static
-int
+void
 nsEventStateManager::WheelPrefs::OnPrefChanged(const char* aPrefName,
                                                void* aClosure)
 {
   // forget all prefs, it's not problem for performance.
   sInstance->Reset();
   DeltaAccumulator::GetInstance()->Reset();
-  return 0;
 }
 
 nsEventStateManager::WheelPrefs::WheelPrefs()
 {
   Reset();
   Preferences::RegisterCallback(OnPrefChanged, "mousewheel.", nullptr);
 }
 
@@ -5795,24 +5794,23 @@ nsEventStateManager::Prefs::Init()
              "Failed to observe \"ui.key.contentAccess\"");
 
   rv = Preferences::RegisterCallback(OnChange, "dom.popup_allowed_events");
   MOZ_ASSERT(NS_SUCCEEDED(rv),
              "Failed to observe \"dom.popup_allowed_events\"");
 }
 
 // static
-int
+void
 nsEventStateManager::Prefs::OnChange(const char* aPrefName, void*)
 {
   nsDependentCString prefName(aPrefName);
   if (prefName.EqualsLiteral("dom.popup_allowed_events")) {
     nsDOMEvent::PopupAllowedEventsChanged();
   }
-  return 0;
 }
 
 // static
 void
 nsEventStateManager::Prefs::Shutdown()
 {
   Preferences::UnregisterCallback(OnChange, "dom.popup_allowed_events");
 }
--- a/content/events/src/nsEventStateManager.h
+++ b/content/events/src/nsEventStateManager.h
@@ -222,17 +222,17 @@ protected:
   {
   public:
     static bool KeyCausesActivation() { return sKeyCausesActivation; }
     static bool ClickHoldContextMenu() { return sClickHoldContextMenu; }
     static int32_t ChromeAccessModifierMask();
     static int32_t ContentAccessModifierMask();
 
     static void Init();
-    static int OnChange(const char* aPrefName, void*);
+    static void OnChange(const char* aPrefName, void*);
     static void Shutdown();
 
   private:
     static bool sKeyCausesActivation;
     static bool sClickHoldContextMenu;
     static int32_t sGenericAccessModifierKey;
     static int32_t sChromeAccessModifierMask;
     static int32_t sContentAccessModifierMask;
@@ -404,17 +404,17 @@ protected:
      */
     bool IsOverOnePageScrollAllowedX(mozilla::WidgetWheelEvent* aEvent);
     bool IsOverOnePageScrollAllowedY(mozilla::WidgetWheelEvent* aEvent);
 
   private:
     WheelPrefs();
     ~WheelPrefs();
 
-    static int OnPrefChanged(const char* aPrefName, void* aClosure);
+    static void OnPrefChanged(const char* aPrefName, void* aClosure);
 
     enum Index
     {
       INDEX_DEFAULT = 0,
       INDEX_ALT,
       INDEX_CONTROL,
       INDEX_META,
       INDEX_SHIFT,
--- a/content/media/AudioStream.cpp
+++ b/content/media/AudioStream.cpp
@@ -37,17 +37,17 @@ static const uint32_t CUBEB_NORMAL_LATEN
 
 StaticMutex AudioStream::sMutex;
 cubeb* AudioStream::sCubebContext;
 uint32_t AudioStream::sPreferredSampleRate;
 double AudioStream::sVolumeScale;
 uint32_t AudioStream::sCubebLatency;
 bool AudioStream::sCubebLatencyPrefSet;
 
-/*static*/ int AudioStream::PrefChanged(const char* aPref, void* aClosure)
+/*static*/ void AudioStream::PrefChanged(const char* aPref, void* aClosure)
 {
   if (strcmp(aPref, PREF_VOLUME_SCALE) == 0) {
     nsAdoptingString value = Preferences::GetString(aPref);
     StaticMutexAutoLock lock(sMutex);
     if (value.IsEmpty()) {
       sVolumeScale = 1.0;
     } else {
       NS_ConvertUTF16toUTF8 utf8(value);
@@ -57,17 +57,16 @@ bool AudioStream::sCubebLatencyPrefSet;
     // Arbitrary default stream latency of 100ms.  The higher this
     // value, the longer stream volume changes will take to become
     // audible.
     sCubebLatencyPrefSet = Preferences::HasUserValue(aPref);
     uint32_t value = Preferences::GetUint(aPref, CUBEB_NORMAL_LATENCY_MS);
     StaticMutexAutoLock lock(sMutex);
     sCubebLatency = std::min<uint32_t>(std::max<uint32_t>(value, 1), 1000);
   }
-  return 0;
 }
 
 /*static*/ double AudioStream::GetVolumeScale()
 {
   StaticMutexAutoLock lock(sMutex);
   return sVolumeScale;
 }
 
--- a/content/media/AudioStream.h
+++ b/content/media/AudioStream.h
@@ -254,17 +254,17 @@ public:
   nsresult EnsureTimeStretcherInitialized();
   // Set playback rate as a multiple of the intrinsic playback rate. This is to
   // be called only with aPlaybackRate > 0.0.
   nsresult SetPlaybackRate(double aPlaybackRate);
   // Switch between resampling (if false) and time stretching (if true, default).
   nsresult SetPreservesPitch(bool aPreservesPitch);
 
 private:
-  static int PrefChanged(const char* aPref, void* aClosure);
+  static void PrefChanged(const char* aPref, void* aClosure);
   static double GetVolumeScale();
   static cubeb* GetCubebContext();
   static cubeb* GetCubebContextUnlocked();
   static uint32_t GetCubebLatency();
   static bool CubebLatencyPrefSet();
 
   static long DataCallback_S(cubeb_stream*, void* aThis, void* aBuffer, long aFrames)
   {
--- a/content/xul/document/src/XULDocument.cpp
+++ b/content/xul/document/src/XULDocument.cpp
@@ -4735,26 +4735,24 @@ XULDocument::IsDocumentRightToLeft()
 }
 
 void
 XULDocument::ResetDocumentDirection()
 {
     DocumentStatesChanged(NS_DOCUMENT_STATE_RTL_LOCALE);
 }
 
-int
+void
 XULDocument::DirectionChanged(const char* aPrefName, void* aData)
 {
   // Reset the direction and restyle the document if necessary.
   XULDocument* doc = (XULDocument *)aData;
   if (doc) {
       doc->ResetDocumentDirection();
   }
-
-  return 0;
 }
 
 int
 XULDocument::GetDocumentLWTheme()
 {
     if (mDocLWTheme == Doc_Theme_Uninitialized) {
         mDocLWTheme = Doc_Theme_None; // No lightweight theme by default
 
--- a/content/xul/document/src/XULDocument.h
+++ b/content/xul/document/src/XULDocument.h
@@ -274,17 +274,17 @@ protected:
     BroadcastAttributeChangeFromOverlay(nsIContent* aNode,
                                         int32_t aNameSpaceID,
                                         nsIAtom* aAttribute,
                                         nsIAtom* aPrefix,
                                         const nsAString& aValue);
 
     already_AddRefed<nsPIWindowRoot> GetWindowRoot();
 
-    static NS_HIDDEN_(int) DirectionChanged(const char* aPrefName, void* aData);
+    static NS_HIDDEN_(void) DirectionChanged(const char* aPrefName, void* aData);
 
     // pseudo constants
     static int32_t gRefCnt;
 
     static nsIAtom** kIdentityAttrs[];
 
     static nsIRDFService* gRDFService;
     static nsIRDFResource* kNC_persist;
--- a/content/xul/document/src/nsXULPrototypeCache.cpp
+++ b/content/xul/document/src/nsXULPrototypeCache.cpp
@@ -48,27 +48,25 @@ UpdategDisableXULCache()
 
     // Sets the flag if the XUL cache is disabled
     if (gDisableXULCache) {
         Telemetry::Accumulate(Telemetry::XUL_CACHE_DISABLED, true);
     }
     
 }
 
-static int
+static void
 DisableXULCacheChangedCallback(const char* aPref, void* aClosure)
 {
     UpdategDisableXULCache();
 
     // Flush the cache, regardless
     nsXULPrototypeCache* cache = nsXULPrototypeCache::GetInstance();
     if (cache)
         cache->Flush();
-
-    return 0;
 }
 
 //----------------------------------------------------------------------
 
 nsXULPrototypeCache*  nsXULPrototypeCache::sInstance = nullptr;
 
 
 nsXULPrototypeCache::nsXULPrototypeCache()
@@ -456,31 +454,30 @@ nsXULPrototypeCache::HasData(nsIURI* uri
     else {
         *exists = false;
         return NS_OK;
     }
     *exists = NS_SUCCEEDED(rv);
     return NS_OK;
 }
 
-static int
+static void
 CachePrefChangedCallback(const char* aPref, void* aClosure)
 {
     bool wasEnabled = !gDisableXULDiskCache;
     gDisableXULDiskCache =
         Preferences::GetBool(kDisableXULCachePref,
                              gDisableXULDiskCache);
 
     if (wasEnabled && gDisableXULDiskCache) {
         nsXULPrototypeCache* cache = nsXULPrototypeCache::GetInstance();
 
         if (cache)
             cache->AbortCaching();
     }
-    return 0;
 }
 
 nsresult
 nsXULPrototypeCache::BeginCaching(nsIURI* aURI)
 {
     nsresult rv, tmp;
 
     nsAutoCString path;
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -717,17 +717,17 @@ static const char js_baselinejit_content
 static const char js_baselinejit_chrome_str[]  = JS_OPTIONS_DOT_STR "baselinejit.chrome";
 static const char js_baselinejit_eager_str[]  = JS_OPTIONS_DOT_STR "baselinejit.unsafe_eager_compilation";
 static const char js_ion_content_str[]        = JS_OPTIONS_DOT_STR "ion.content";
 static const char js_ion_chrome_str[]         = JS_OPTIONS_DOT_STR "ion.chrome";
 static const char js_ion_eager_str[]          = JS_OPTIONS_DOT_STR "ion.unsafe_eager_compilation";
 static const char js_parallel_parsing_str[]   = JS_OPTIONS_DOT_STR "parallel_parsing";
 static const char js_ion_parallel_compilation_str[] = JS_OPTIONS_DOT_STR "ion.parallel_compilation";
 
-int
+void
 nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
 {
   nsJSContext *context = reinterpret_cast<nsJSContext *>(data);
   JSContext *cx = context->mContext;
 
   sPostGCEventsToConsole = Preferences::GetBool(js_memlog_option_str);
   sPostGCEventsToObserver = Preferences::GetBool(js_memnotify_option_str);
 
@@ -802,18 +802,16 @@ nsJSContext::JSOptionChangedCallback(con
   JS_SetJitHardening(rt, useHardening);
 
 #ifdef JS_GC_ZEAL
   int32_t zeal = Preferences::GetInt(js_zeal_option_str, -1);
   int32_t frequency = Preferences::GetInt(js_zeal_frequency_str, JS_DEFAULT_ZEAL_FREQ);
   if (zeal >= 0)
     ::JS_SetGCZeal(context->mContext, (uint8_t)zeal, frequency);
 #endif
-
-  return 0;
 }
 
 nsJSContext::nsJSContext(bool aGCOnDestruction,
                          nsIScriptGlobalObject* aGlobalObject)
   : mWindowProxy(nullptr)
   , mGCOnDestruction(aGCOnDestruction)
   , mGlobalObjectRef(aGlobalObject)
 {
@@ -2678,95 +2676,87 @@ mozilla::dom::StartupJSEnvironment()
   sIsInitialized = false;
   sDidShutdown = false;
   sShuttingDown = false;
   sContextCount = 0;
   sSecurityManager = nullptr;
   gCCStats.Clear();
 }
 
-static int
+static void
 ReportAllJSExceptionsPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   bool reportAll = Preferences::GetBool(aPrefName, false);
   nsContentUtils::XPConnect()->SetReportAllJSExceptions(reportAll);
-  return 0;
 }
 
-static int
+static void
 SetMemoryHighWaterMarkPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   int32_t highwatermark = Preferences::GetInt(aPrefName, 128);
 
   JS_SetGCParameter(sRuntime, JSGC_MAX_MALLOC_BYTES,
                     highwatermark * 1024L * 1024L);
-  return 0;
 }
 
-static int
+static void
 SetMemoryMaxPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   int32_t pref = Preferences::GetInt(aPrefName, -1);
   // handle overflow and negative pref values
   uint32_t max = (pref <= 0 || pref >= 0x1000) ? -1 : (uint32_t)pref * 1024 * 1024;
   JS_SetGCParameter(sRuntime, JSGC_MAX_BYTES, max);
-  return 0;
 }
 
-static int
+static void
 SetMemoryGCModePrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   bool enableCompartmentGC = Preferences::GetBool("javascript.options.mem.gc_per_compartment");
   bool enableIncrementalGC = Preferences::GetBool("javascript.options.mem.gc_incremental");
   JSGCMode mode;
   if (enableIncrementalGC) {
     mode = JSGC_MODE_INCREMENTAL;
   } else if (enableCompartmentGC) {
     mode = JSGC_MODE_COMPARTMENT;
   } else {
     mode = JSGC_MODE_GLOBAL;
   }
   JS_SetGCParameter(sRuntime, JSGC_MODE, mode);
-  return 0;
 }
 
-static int
+static void
 SetMemoryGCSliceTimePrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   int32_t pref = Preferences::GetInt(aPrefName, -1);
   // handle overflow and negative pref values
   if (pref > 0 && pref < 100000)
     JS_SetGCParameter(sRuntime, JSGC_SLICE_TIME_BUDGET, pref);
-  return 0;
 }
 
-static int
+static void
 SetMemoryGCPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   int32_t pref = Preferences::GetInt(aPrefName, -1);
   // handle overflow and negative pref values
   if (pref >= 0 && pref < 10000)
     JS_SetGCParameter(sRuntime, (JSGCParamKey)(intptr_t)aClosure, pref);
-  return 0;
 }
 
-static int
+static void
 SetMemoryGCDynamicHeapGrowthPrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   bool pref = Preferences::GetBool(aPrefName);
   JS_SetGCParameter(sRuntime, JSGC_DYNAMIC_HEAP_GROWTH, pref);
-  return 0;
 }
 
-static int
+static void
 SetMemoryGCDynamicMarkSlicePrefChangedCallback(const char* aPrefName, void* aClosure)
 {
   bool pref = Preferences::GetBool(aPrefName);
   JS_SetGCParameter(sRuntime, JSGC_DYNAMIC_MARK_SLICE, pref);
-  return 0;
 }
 
 JSObject*
 NS_DOMReadStructuredClone(JSContext* cx,
                           JSStructuredCloneReader* reader,
                           uint32_t tag,
                           uint32_t data,
                           void* closure)
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -176,17 +176,17 @@ private:
 
   nsJSContext *mNext;
   nsJSContext **mPrev;
 
   // mGlobalObjectRef ensures that the outer window stays alive as long as the
   // context does. It is eventually collected by the cycle collector.
   nsCOMPtr<nsIScriptGlobalObject> mGlobalObjectRef;
 
-  static int JSOptionChangedCallback(const char *pref, void *data);
+  static void JSOptionChangedCallback(const char *pref, void *data);
 
   static bool DOMOperationCallback(JSContext *cx);
 };
 
 class nsIJSRuntimeService;
 class nsIPrincipal;
 class nsPIDOMWindow;
 
--- a/dom/encoding/FallbackEncoding.cpp
+++ b/dom/encoding/FallbackEncoding.cpp
@@ -96,23 +96,22 @@ void
 FallbackEncoding::FromLocale(nsACString& aFallback)
 {
   MOZ_ASSERT(FallbackEncoding::sInstance,
              "Using uninitialized fallback cache.");
   FallbackEncoding::sInstance->Get(aFallback);
 }
 
 // PrefChangedFunc
-int
+void
 FallbackEncoding::PrefChanged(const char*, void*)
 {
   MOZ_ASSERT(FallbackEncoding::sInstance,
              "Pref callback called with null fallback cache.");
   FallbackEncoding::sInstance->Invalidate();
-  return 0;
 }
 
 void
 FallbackEncoding::Initialize()
 {
   MOZ_ASSERT(!FallbackEncoding::sInstance,
              "Initializing pre-existing fallback cache.");
   FallbackEncoding::sInstance = new FallbackEncoding;
--- a/dom/encoding/FallbackEncoding.h
+++ b/dom/encoding/FallbackEncoding.h
@@ -49,17 +49,17 @@ private:
   /**
    * Invalidates the cache.
    */
   void Invalidate()
   {
     mFallback.Truncate();
   }
 
-  static int PrefChanged(const char*, void*);
+  static void PrefChanged(const char*, void*);
 
   /**
    * Gets the fallback encoding label.
    * @param aFallback the fallback encoding
    */
   void Get(nsACString& aFallback);
 
   nsCString mFallback;
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -153,17 +153,17 @@ public:
     ParticularProcessPriorityManager* aParticularManager,
     hal::ProcessPriority aOldPriority);
 
 private:
   static bool sPrefListenersRegistered;
   static bool sInitialized;
   static StaticRefPtr<ProcessPriorityManagerImpl> sSingleton;
 
-  static int PrefChangedCallback(const char* aPref, void* aClosure);
+  static void PrefChangedCallback(const char* aPref, void* aClosure);
 
   ProcessPriorityManagerImpl();
   ~ProcessPriorityManagerImpl() {}
   DISALLOW_EVIL_CONSTRUCTORS(ProcessPriorityManagerImpl);
 
   void Init();
 
   already_AddRefed<ParticularProcessPriorityManager>
@@ -340,22 +340,21 @@ private:
 /* static */ bool ProcessPriorityManagerImpl::sInitialized = false;
 /* static */ bool ProcessPriorityManagerImpl::sPrefListenersRegistered = false;
 /* static */ StaticRefPtr<ProcessPriorityManagerImpl>
   ProcessPriorityManagerImpl::sSingleton;
 
 NS_IMPL_ISUPPORTS1(ProcessPriorityManagerImpl,
                    nsIObserver);
 
-/* static */ int
+/* static */ void
 ProcessPriorityManagerImpl::PrefChangedCallback(const char* aPref,
                                                 void* aClosure)
 {
   StaticInit();
-  return 0;
 }
 
 /* static */ bool
 ProcessPriorityManagerImpl::PrefsEnabled()
 {
   return Preferences::GetBool("dom.ipc.processPriorityManager.enabled") &&
          !Preferences::GetBool("dom.ipc.tabs.disabled");
 }
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -259,17 +259,17 @@ PluginModuleParent::WriteExtraDataForMin
 void
 PluginModuleParent::SetChildTimeout(const int32_t aChildTimeout)
 {
     int32_t timeoutMs = (aChildTimeout > 0) ? (1000 * aChildTimeout) :
                       MessageChannel::kNoTimeout;
     SetReplyTimeoutMs(timeoutMs);
 }
 
-int
+void
 PluginModuleParent::TimeoutChanged(const char* aPref, void* aModule)
 {
     NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 #ifndef XP_WIN
     if (!strcmp(aPref, kChildTimeoutPref)) {
       // The timeout value used by the parent for children
       int32_t timeoutSecs = Preferences::GetInt(kChildTimeoutPref, 0);
       static_cast<PluginModuleParent*>(aModule)->SetChildTimeout(timeoutSecs);
@@ -279,17 +279,16 @@ PluginModuleParent::TimeoutChanged(const
         !strcmp(aPref, kHangUITimeoutPref)) {
       static_cast<PluginModuleParent*>(aModule)->EvaluateHangUIState(true);
 #endif // XP_WIN
     } else if (!strcmp(aPref, kParentTimeoutPref)) {
       // The timeout value used by the child for its parent
       int32_t timeoutSecs = Preferences::GetInt(kParentTimeoutPref, 0);
       unused << static_cast<PluginModuleParent*>(aModule)->SendSetParentHangTimeout(timeoutSecs);
     }
-    return 0;
 }
 
 void
 PluginModuleParent::CleanupFromTimeout(const bool aFromHangUI)
 {
     if (mShutdown) {
       return;
     }
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -282,17 +282,17 @@ private:
     CrashReporterParent* CrashReporter();
 
 #ifdef MOZ_CRASHREPORTER
     void ProcessFirstMinidump();
     void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
 #endif
     void CleanupFromTimeout(const bool aByHangUI);
     void SetChildTimeout(const int32_t aChildTimeout);
-    static int TimeoutChanged(const char* aPref, void* aModule);
+    static void TimeoutChanged(const char* aPref, void* aModule);
     void NotifyPluginCrashed();
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
     void InitPluginProfiling();
     void ShutdownPluginProfiling();
 #endif
 
     PluginProcessParent* mSubprocess;
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -265,46 +265,46 @@ GetWorkerPref(const nsACString& aPref,
     else {
       result = aDefault;
     }
   }
 
   return result;
 }
 
-int
+void
 LoadJSContextOptions(const char* aPrefName, void* /* aClosure */)
 {
   AssertIsOnMainThread();
 
   RuntimeService* rts = RuntimeService::GetService();
   if (!rts && !gRuntimeServiceDuringInit) {
     // May be shutting down, just bail.
-    return 0;
+    return;
   }
 
   const nsDependentCString prefName(aPrefName);
 
   // Several other pref branches will get included here so bail out if there is
   // another callback that will handle this change.
   if (StringBeginsWith(prefName,
                        NS_LITERAL_CSTRING(PREF_JS_OPTIONS_PREFIX
                                           PREF_MEM_OPTIONS_PREFIX)) ||
       StringBeginsWith(prefName,
                        NS_LITERAL_CSTRING(PREF_WORKERS_OPTIONS_PREFIX
                                           PREF_MEM_OPTIONS_PREFIX)) ||
       prefName.EqualsLiteral(PREF_JS_OPTIONS_PREFIX PREF_JIT_HARDENING) ||
       prefName.EqualsLiteral(PREF_WORKERS_OPTIONS_PREFIX PREF_JIT_HARDENING)) {
-    return 0;
+    return;
   }
 
 #ifdef JS_GC_ZEAL
   if (prefName.EqualsLiteral(PREF_JS_OPTIONS_PREFIX PREF_GCZEAL) ||
       prefName.EqualsLiteral(PREF_WORKERS_OPTIONS_PREFIX PREF_GCZEAL)) {
-    return 0;
+    return;
   }
 #endif
 
   // Common options.
   JS::ContextOptions commonOptions = kRequiredJSContextOptions;
   if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("strict"))) {
     commonOptions.setExtraWarnings(true);
   }
@@ -344,30 +344,28 @@ LoadJSContextOptions(const char* aPrefNa
   }
 #endif
 
   RuntimeService::SetDefaultJSContextOptions(contentOptions, chromeOptions);
 
   if (rts) {
     rts->UpdateAllWorkerJSContextOptions();
   }
-
-  return 0;
 }
 
 #ifdef JS_GC_ZEAL
-int
+void
 LoadGCZealOptions(const char* /* aPrefName */, void* /* aClosure */)
 {
   AssertIsOnMainThread();
 
   RuntimeService* rts = RuntimeService::GetService();
   if (!rts && !gRuntimeServiceDuringInit) {
     // May be shutting down, just bail.
-    return 0;
+    return;
   }
 
   int32_t gczeal = GetWorkerPref<int32_t>(NS_LITERAL_CSTRING(PREF_GCZEAL), -1);
   if (gczeal < 0) {
     gczeal = 0;
   }
 
   int32_t frequency =
@@ -376,18 +374,16 @@ LoadGCZealOptions(const char* /* aPrefNa
     frequency = JS_DEFAULT_ZEAL_FREQ;
   }
 
   RuntimeService::SetDefaultGCZeal(uint8_t(gczeal), uint32_t(frequency));
 
   if (rts) {
     rts->UpdateAllWorkerGCZeal();
   }
-
-  return 0;
 }
 #endif
 
 void
 UpdateCommonJSGCMemoryOption(RuntimeService* aRuntimeService,
                              const nsACString& aPrefName, JSGCParamKey aKey)
 {
   AssertIsOnMainThread();
@@ -413,26 +409,26 @@ UpdatOtherJSGCMemoryOption(RuntimeServic
   RuntimeService::SetDefaultJSGCSettings(aKey, aValue);
 
   if (aRuntimeService) {
     aRuntimeService->UpdateAllWorkerMemoryParameter(aKey, aValue);
   }
 }
 
 
-int
+void
 LoadJSGCMemoryOptions(const char* aPrefName, void* /* aClosure */)
 {
   AssertIsOnMainThread();
 
   RuntimeService* rts = RuntimeService::GetService();
 
   if (!rts && !gRuntimeServiceDuringInit) {
     // May be shutting down, just bail.
-    return 0;
+    return;
   }
 
   NS_NAMED_LITERAL_CSTRING(jsPrefix, PREF_JS_OPTIONS_PREFIX);
   NS_NAMED_LITERAL_CSTRING(workersPrefix, PREF_WORKERS_OPTIONS_PREFIX);
 
   const nsDependentCString fullPrefName(aPrefName);
 
   // Pull out the string that actually distinguishes the parameter we need to
@@ -441,17 +437,17 @@ LoadJSGCMemoryOptions(const char* aPrefN
   if (StringBeginsWith(fullPrefName, jsPrefix)) {
     memPrefName.Rebind(fullPrefName, jsPrefix.Length());
   }
   else if (StringBeginsWith(fullPrefName, workersPrefix)) {
     memPrefName.Rebind(fullPrefName, workersPrefix.Length());
   }
   else {
     NS_ERROR("Unknown pref name!");
-    return 0;
+    return;
   }
 
 #ifdef DEBUG
   // During Init() we get called back with a branch string here, so there should
   // be no just a "mem." pref here.
   if (!rts) {
     NS_ASSERTION(memPrefName.EqualsLiteral(PREF_MEM_OPTIONS_PREFIX), "Huh?!");
   }
@@ -564,41 +560,37 @@ LoadJSGCMemoryOptions(const char* aPrefN
 
 #ifdef DEBUG
     nsAutoCString message("Workers don't support the 'mem.");
     message.Append(memPrefName);
     message.AppendLiteral("' preference!");
     NS_WARNING(message.get());
 #endif
   }
-
-  return 0;
 }
 
-int
+void
 LoadJITHardeningOption(const char* /* aPrefName */, void* /* aClosure */)
 {
   AssertIsOnMainThread();
 
   RuntimeService* rts = RuntimeService::GetService();
 
   if (!rts && !gRuntimeServiceDuringInit) {
     // May be shutting down, just bail.
-    return 0;
+    return;
   }
 
   bool value = GetWorkerPref(NS_LITERAL_CSTRING(PREF_JIT_HARDENING), false);
 
   RuntimeService::SetDefaultJITHardening(value);
 
   if (rts) {
     rts->UpdateAllWorkerJITHardening(value);
   }
-
-  return 0;
 }
 
 void
 ErrorReporter(JSContext* aCx, const char* aMessage, JSErrorReport* aReport)
 {
   WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx);
   return worker->ReportError(aCx, aMessage, aReport);
 }
@@ -2307,17 +2299,17 @@ RuntimeService::Observe(nsISupports* aSu
     CycleCollectAllWorkers();
     return NS_OK;
   }
 
   NS_NOTREACHED("Unknown observer topic!");
   return NS_OK;
 }
 
-/* static */ int
+/* static */ void
 RuntimeService::WorkerPrefChanged(const char* aPrefName, void* aClosure)
 {
   AssertIsOnMainThread();
 
   uintptr_t tmp = reinterpret_cast<uintptr_t>(aClosure);
   MOZ_ASSERT(tmp < WORKERPREF_COUNT);
   WorkerPreference key = static_cast<WorkerPreference>(tmp);
 
@@ -2335,10 +2327,9 @@ RuntimeService::WorkerPrefChanged(const 
   // This function should never be registered as a callback for a preference it
   // does not handle.
   MOZ_ASSERT(key != WORKERPREF_COUNT);
 
   RuntimeService* rts = RuntimeService::GetService();
   if (rts) {
     rts->UpdateAllWorkerPreference(key, sDefaultPreferences[key]);
   }
-  return 0;
 }
--- a/dom/workers/RuntimeService.h
+++ b/dom/workers/RuntimeService.h
@@ -288,15 +288,15 @@ private:
                       nsTArray<WorkerPrivate*>& aWorkers);
 
   bool
   ScheduleWorker(JSContext* aCx, WorkerPrivate* aWorkerPrivate);
 
   static void
   ShutdownIdleThreads(nsITimer* aTimer, void* aClosure);
 
-  static int
+  static void
   WorkerPrefChanged(const char* aPrefName, void* aClosure);
 };
 
 END_WORKERS_NAMESPACE
 
 #endif /* mozilla_dom_workers_runtimeservice_h__ */
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -141,34 +141,33 @@ NS_IMETHODIMP nsPlaintextEditor::Init(ns
 
   NS_ENSURE_SUCCESS(rulesRes, rulesRes);
   return res;
 }
 
 static int32_t sNewlineHandlingPref = -1,
                sCaretStylePref = -1;
 
-static int
+static void
 EditorPrefsChangedCallback(const char *aPrefName, void *)
 {
   if (nsCRT::strcmp(aPrefName, "editor.singleLine.pasteNewlines") == 0) {
     sNewlineHandlingPref =
       Preferences::GetInt("editor.singleLine.pasteNewlines",
                           nsIPlaintextEditor::eNewlinesPasteToFirst);
   } else if (nsCRT::strcmp(aPrefName, "layout.selection.caret_style") == 0) {
     sCaretStylePref = Preferences::GetInt("layout.selection.caret_style",
 #ifdef XP_WIN
                                                  1);
     if (sCaretStylePref == 0)
       sCaretStylePref = 1;
 #else
                                                  0);
 #endif
   }
-  return 0;
 }
 
 // static
 void
 nsPlaintextEditor::GetDefaultEditorPrefs(int32_t &aNewlineHandling,
                                          int32_t &aCaretStyle)
 {
   if (sNewlineHandlingPref == -1) {
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -318,48 +318,46 @@ gfxPlatform*
 gfxPlatform::GetPlatform()
 {
     if (!gPlatform) {
         Init();
     }
     return gPlatform;
 }
 
-int RecordingPrefChanged(const char *aPrefName, void *aClosure)
+void RecordingPrefChanged(const char *aPrefName, void *aClosure)
 {
   if (Preferences::GetBool("gfx.2d.recording", false)) {
     nsAutoCString fileName;
     nsAdoptingString prefFileName = Preferences::GetString("gfx.2d.recordingfile");
 
     if (prefFileName) {
       fileName.Append(NS_ConvertUTF16toUTF8(prefFileName));
     } else {
       nsCOMPtr<nsIFile> tmpFile;
       if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpFile)))) {
-        return 0;
+        return;
       }
       fileName.AppendPrintf("moz2drec_%i_%i.aer", XRE_GetProcessType(), getpid());
 
       nsresult rv = tmpFile->AppendNative(fileName);
       if (NS_FAILED(rv))
-        return 0;
+        return;
 
       rv = tmpFile->GetNativePath(fileName);
       if (NS_FAILED(rv))
-        return 0;
+        return;
     }
 
     gPlatform->mRecorder = Factory::CreateEventRecorderForFile(fileName.BeginReading());
     printf_stderr("Recording to %s\n", fileName.get());
     Factory::SetGlobalEventRecorder(gPlatform->mRecorder);
   } else {
     Factory::SetGlobalEventRecorder(nullptr);
   }
-
-  return 0;
 }
 
 void
 gfxPlatform::Init()
 {
     if (gEverInitialized) {
         NS_RUNTIMEABORT("Already started???");
     }
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -697,17 +697,17 @@ protected:
 private:
     /**
      * Start up Thebes.
      */
     static void Init();
 
     static void CreateCMSOutputProfile();
 
-    friend int RecordingPrefChanged(const char *aPrefName, void *aClosure);
+    friend void RecordingPrefChanged(const char *aPrefName, void *aClosure);
 
     virtual qcms_profile* GetPlatformCMSOutputProfile();
 
     virtual bool SupportsOffMainThreadCompositing() { return true; }
 
     nsRefPtr<gfxASurface> mScreenReferenceSurface;
     mozilla::RefPtr<mozilla::gfx::DrawTarget> mScreenReferenceDrawTarget;
     nsTArray<uint32_t> mCJKPrefLangs;
--- a/image/src/DiscardTracker.cpp
+++ b/image/src/DiscardTracker.cpp
@@ -34,21 +34,20 @@ NS_IMETHODIMP
 DiscardTracker::DiscardRunnable::Run()
 {
   sDiscardRunnablePending = 0;
 
   DiscardTracker::DiscardNow();
   return NS_OK;
 }
 
-int
+void
 DiscardTimeoutChangedCallback(const char* aPref, void *aClosure)
 {
   DiscardTracker::ReloadTimeout();
-  return 0;
 }
 
 nsresult
 DiscardTracker::Reset(Node *node)
 {
   // We shouldn't call Reset() with a null |img| pointer, on images which can't
   // be discarded, or on animated images (which should be marked as
   // non-discardable, anyway).
--- a/image/src/DiscardTracker.h
+++ b/image/src/DiscardTracker.h
@@ -88,17 +88,17 @@ class DiscardTracker
      * can be called from any thread and is thread-safe.
      */
     static void InformAllocation(int64_t bytes);
 
   private:
     /**
      * This is called when the discard timer fires; it calls into DiscardNow().
      */
-    friend int DiscardTimeoutChangedCallback(const char* aPref, void *aClosure);
+    friend void DiscardTimeoutChangedCallback(const char* aPref, void *aClosure);
 
     /**
      * When run, this runnable sets sDiscardRunnablePending to false and calls
      * DiscardNow().
      */
     class DiscardRunnable : public nsRunnable
     {
       NS_IMETHOD Run();
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -123,17 +123,17 @@ static ContentMap& GetContentMap() {
     sContentMap = new ContentMap();
   }
   return *sContentMap;
 }
 
 // When the pref "layout.css.sticky.enabled" changes, this function is invoked
 // to let us update kPositionKTable, to selectively disable or restore the
 // entry for "sticky" in that table.
-static int
+static void
 StickyEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
 {
   MOZ_ASSERT(strncmp(aPrefName, STICKY_ENABLED_PREF_NAME,
                      NS_ARRAY_LENGTH(STICKY_ENABLED_PREF_NAME)) == 0,
              "We only registered this callback for a single pref, so it "
              "should only be called for that pref");
 
   static int32_t sIndexOfStickyInPositionTable;
@@ -151,24 +151,22 @@ StickyEnabledPrefChangeCallback(const ch
                "Couldn't find sticky in kPositionKTable");
     sIsStickyKeywordIndexInitialized = true;
   }
 
   // OK -- now, stomp on or restore the "sticky" entry in kPositionKTable,
   // depending on whether the sticky pref is enabled vs. disabled.
   nsCSSProps::kPositionKTable[sIndexOfStickyInPositionTable] =
     isStickyEnabled ? eCSSKeyword_sticky : eCSSKeyword_UNKNOWN;
-
-  return 0;
 }
 
 // When the pref "layout.css.text-align-true-value.enabled" changes, this
 // function is called to let us update kTextAlignKTable & kTextAlignLastKTable,
 // to selectively disable or restore the entries for "true" in those tables.
-static int
+static void
 TextAlignTrueEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
 {
   NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_TRUE_ENABLED_PREF_NAME) == 0,
                "Did you misspell " TEXT_ALIGN_TRUE_ENABLED_PREF_NAME " ?");
 
   static bool sIsInitialized;
   static int32_t sIndexOfTrueInTextAlignTable;
   static int32_t sIndexOfTrueInTextAlignLastTable;
@@ -190,18 +188,16 @@ TextAlignTrueEnabledPrefChangeCallback(c
   // OK -- now, stomp on or restore the "true" entry in the keyword tables,
   // depending on whether the pref is enabled vs. disabled.
   MOZ_ASSERT(sIndexOfTrueInTextAlignTable >= 0);
   nsCSSProps::kTextAlignKTable[sIndexOfTrueInTextAlignTable] =
     isTextAlignTrueEnabled ? eCSSKeyword_true : eCSSKeyword_UNKNOWN;
   MOZ_ASSERT(sIndexOfTrueInTextAlignLastTable >= 0);
   nsCSSProps::kTextAlignLastKTable[sIndexOfTrueInTextAlignLastTable] =
     isTextAlignTrueEnabled ? eCSSKeyword_true : eCSSKeyword_UNKNOWN;
-
-  return 0;
 }
 
 template <class AnimationsOrTransitions>
 static AnimationsOrTransitions*
 HasAnimationOrTransitionForCompositor(nsIContent* aContent,
                                       nsIAtom* aAnimationProperty,
                                       nsCSSProperty aProperty)
 {
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -135,27 +135,26 @@ nsPresContext::IsDOMPaintEventPending()
     // invalidation doesn't invalidate anything further.
     NotifyInvalidation(nsRect(0, 0, 0, 0), 0);
     NS_ASSERTION(mFireAfterPaintEvents, "Why aren't we planning to fire the event?");
     return true;
   }
   return false;
 }
 
-int
+void
 nsPresContext::PrefChangedCallback(const char* aPrefName, void* instance_data)
 {
   nsRefPtr<nsPresContext>  presContext =
     static_cast<nsPresContext*>(instance_data);
 
   NS_ASSERTION(nullptr != presContext, "bad instance data");
   if (nullptr != presContext) {
     presContext->PreferenceChanged(aPrefName);
   }
-  return 0;  // PREF_OK
 }
 
 
 void
 nsPresContext::PrefChangedUpdateTimerCallback(nsITimer *aTimer, void *aClosure)
 {
   nsPresContext*  presContext = (nsPresContext*)aClosure;
   NS_ASSERTION(presContext != nullptr, "bad instance data");
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1014,17 +1014,17 @@ protected:
   UIResolutionChangedSubdocumentCallback(nsIDocument* aDocument, void* aData);
 
   NS_HIDDEN_(void) SetImgAnimations(nsIContent *aParent, uint16_t aMode);
   NS_HIDDEN_(void) SetSMILAnimations(nsIDocument *aDoc, uint16_t aNewMode,
                                      uint16_t aOldMode);
   NS_HIDDEN_(void) GetDocumentColorPreferences();
 
   NS_HIDDEN_(void) PreferenceChanged(const char* aPrefName);
-  static NS_HIDDEN_(int) PrefChangedCallback(const char*, void*);
+  static NS_HIDDEN_(void) PrefChangedCallback(const char*, void*);
 
   NS_HIDDEN_(void) UpdateAfterPreferencesChanged();
   static NS_HIDDEN_(void) PrefChangedUpdateTimerCallback(nsITimer *aTimer, void *aClosure);
 
   NS_HIDDEN_(void) GetUserPreferences();
 
   // Allow nsAutoPtr<LangGroupFontPrefs> dtor to access this protected struct's
   // dtor:
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -208,17 +208,17 @@ nsHTMLFramesetFrame::~nsHTMLFramesetFram
                                   kFrameResizePref, this);
 }
 
 NS_QUERYFRAME_HEAD(nsHTMLFramesetFrame)
   NS_QUERYFRAME_ENTRY(nsHTMLFramesetFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 // static
-int
+void
 nsHTMLFramesetFrame::FrameResizePrefCallback(const char* aPref, void* aClosure)
 {
   nsHTMLFramesetFrame *frame =
     reinterpret_cast<nsHTMLFramesetFrame *>(aClosure);
 
   nsIDocument* doc = frame->mContent->GetDocument();
   mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, true);
   if (doc) {
@@ -233,18 +233,16 @@ nsHTMLFramesetFrame::FrameResizePrefCall
 
   frame->RecalculateBorderResize();
   if (doc) {
     nsNodeUtils::AttributeChanged(frame->GetContent()->AsElement(),
                                   kNameSpaceID_None,
                                   nsGkAtoms::frameborder,
                                   nsIDOMMutationEvent::MODIFICATION);
   }
-
-  return 0;
 }
 
 void
 nsHTMLFramesetFrame::Init(nsIContent*      aContent,
                           nsIFrame*        aParent,
                           nsIFrame*        aPrevInFlow)
 {
   nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
--- a/layout/generic/nsFrameSetFrame.h
+++ b/layout/generic/nsFrameSetFrame.h
@@ -180,17 +180,17 @@ protected:
                         nsIntPoint*              aCellIndex = 0);
   
   bool CanResize(bool aVertical, bool aLeft); 
 
   bool CanChildResize(bool aVertical, bool aLeft, int32_t aChildX);
   
   void SetBorderResize(nsHTMLFramesetBorderFrame* aBorderFrame);
 
-  static int FrameResizePrefCallback(const char* aPref, void* aClosure);
+  static void FrameResizePrefCallback(const char* aPref, void* aClosure);
 
   nsFramesetDrag   mDrag;
   nsBorderColor    mEdgeColors;
   nsHTMLFramesetBorderFrame* mDragger;
   nsHTMLFramesetFrame* mTopLevelFrameset;
   nsHTMLFramesetBorderFrame** mVerBorders;  // vertical borders
   nsHTMLFramesetBorderFrame** mHorBorders;  // horizontal borders
   nsFrameborder*   mChildFrameborder; // the frameborder attr of children
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -5200,21 +5200,20 @@ nsComputedDOMStyle::DoGetAnimationPlaySt
     playState->SetIdent(
       nsCSSProps::ValueToKeywordEnum(animation->GetPlayState(),
                                      nsCSSProps::kAnimationPlayStateKTable));
   } while (++i < display->mAnimationPlayStateCount);
 
   return valueList;
 }
 
-static int
+static void
 MarkComputedStyleMapDirty(const char* aPref, void* aData)
 {
   static_cast<nsComputedStyleMap*>(aData)->MarkDirty();
-  return 0;
 }
 
 /* static */ nsComputedStyleMap*
 nsComputedDOMStyle::GetComputedStyleMap()
 {
   static nsComputedStyleMap map = {
     {
 #define COMPUTED_STYLE_PROP(prop_, method_) \
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -268,24 +268,22 @@ nsXULTooltipListener::HandleEvent(nsIDOM
 
   return NS_OK;
 }
 
 //////////////////////////////////////////////////////////////////////////
 //// nsXULTooltipListener
 
 // static
-int
+void
 nsXULTooltipListener::ToolbarTipsPrefChanged(const char *aPref,
                                              void *aClosure)
 {
   sShowTooltips =
     Preferences::GetBool("browser.chrome.toolbar_tips", sShowTooltips);
-
-  return 0;
 }
 
 //////////////////////////////////////////////////////////////////////////
 //// nsXULTooltipListener
 
 bool nsXULTooltipListener::sShowTooltips = false;
 uint32_t nsXULTooltipListener::sTooltipListenerCount = 0;
 
--- a/layout/xul/nsXULTooltipListener.h
+++ b/layout/xul/nsXULTooltipListener.h
@@ -61,17 +61,17 @@ protected:
   nsresult DestroyTooltip();
   // This method tries to find a tooltip for aTarget.
   nsresult FindTooltip(nsIContent* aTarget, nsIContent** aTooltip);
   // This method calls FindTooltip and checks that the tooltip
   // can be really used (i.e. tooltip is not a menu).
   nsresult GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip);
 
   static nsXULTooltipListener* mInstance;
-  static int ToolbarTipsPrefChanged(const char *aPref, void *aClosure);
+  static void ToolbarTipsPrefChanged(const char *aPref, void *aClosure);
 
   nsWeakPtr mSourceNode;
   nsWeakPtr mTargetNode;
   nsWeakPtr mCurrentTooltip;
 
   // a timer for showing the tooltip
   nsCOMPtr<nsITimer> mTooltipTimer;
   static void sTooltipCallback (nsITimer* aTimer, void* aListener);
--- a/modules/libpref/public/Preferences.h
+++ b/modules/libpref/public/Preferences.h
@@ -21,17 +21,17 @@
 
 class nsIFile;
 class nsCString;
 class nsString;
 class nsAdoptingString;
 class nsAdoptingCString;
 
 #ifndef have_PrefChangedFunc_typedef
-typedef int (*PrefChangedFunc)(const char *, void *);
+typedef void (*PrefChangedFunc)(const char *, void *);
 #define have_PrefChangedFunc_typedef
 #endif
 
 namespace mozilla {
 
 namespace dom {
 class PrefSetting;
 }
--- a/modules/libpref/src/Preferences.cpp
+++ b/modules/libpref/src/Preferences.cpp
@@ -1667,22 +1667,21 @@ Preferences::UnregisterCallback(PrefChan
   observer->RemoveClosure(aClosure);
   if (observer->HasNoClosures()) {
     // Delete the callback since its list of closures is empty.
     gObserverTable->Remove(observer);
   }
   return NS_OK;
 }
 
-static int BoolVarChanged(const char* aPref, void* aClosure)
+static void BoolVarChanged(const char* aPref, void* aClosure)
 {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *((bool*)cache->cacheLocation) =
     Preferences::GetBool(aPref, cache->defaultValueBool);
-  return 0;
 }
 
 // static
 nsresult
 Preferences::AddBoolVarCache(bool* aCache,
                              const char* aPref,
                              bool aDefault)
 {
@@ -1690,22 +1689,21 @@ Preferences::AddBoolVarCache(bool* aCach
   *aCache = GetBool(aPref, aDefault);
   CacheData* data = new CacheData();
   data->cacheLocation = aCache;
   data->defaultValueBool = aDefault;
   gCacheData->AppendElement(data);
   return RegisterCallback(BoolVarChanged, aPref, data);
 }
 
-static int IntVarChanged(const char* aPref, void* aClosure)
+static void IntVarChanged(const char* aPref, void* aClosure)
 {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *((int32_t*)cache->cacheLocation) =
     Preferences::GetInt(aPref, cache->defaultValueInt);
-  return 0;
 }
 
 // static
 nsresult
 Preferences::AddIntVarCache(int32_t* aCache,
                             const char* aPref,
                             int32_t aDefault)
 {
@@ -1713,22 +1711,21 @@ Preferences::AddIntVarCache(int32_t* aCa
   *aCache = Preferences::GetInt(aPref, aDefault);
   CacheData* data = new CacheData();
   data->cacheLocation = aCache;
   data->defaultValueInt = aDefault;
   gCacheData->AppendElement(data);
   return RegisterCallback(IntVarChanged, aPref, data);
 }
 
-static int UintVarChanged(const char* aPref, void* aClosure)
+static void UintVarChanged(const char* aPref, void* aClosure)
 {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *((uint32_t*)cache->cacheLocation) =
     Preferences::GetUint(aPref, cache->defaultValueUint);
-  return 0;
 }
 
 // static
 nsresult
 Preferences::AddUintVarCache(uint32_t* aCache,
                              const char* aPref,
                              uint32_t aDefault)
 {
@@ -1736,22 +1733,21 @@ Preferences::AddUintVarCache(uint32_t* a
   *aCache = Preferences::GetUint(aPref, aDefault);
   CacheData* data = new CacheData();
   data->cacheLocation = aCache;
   data->defaultValueUint = aDefault;
   gCacheData->AppendElement(data);
   return RegisterCallback(UintVarChanged, aPref, data);
 }
 
-static int FloatVarChanged(const char* aPref, void* aClosure)
+static void FloatVarChanged(const char* aPref, void* aClosure)
 {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *((float*)cache->cacheLocation) =
     Preferences::GetFloat(aPref, cache->defaultValueFloat);
-  return 0;
 }
 
 // static
 nsresult
 Preferences::AddFloatVarCache(float* aCache,
                              const char* aPref,
                              float aDefault)
 {
--- a/modules/libpref/src/moz.build
+++ b/modules/libpref/src/moz.build
@@ -1,22 +1,26 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-SOURCES += [
+UNIFIED_SOURCES += [
     'nsPrefBranch.cpp',
     'nsPrefsFactory.cpp',
-    'prefapi.cpp',
     'Preferences.cpp',
     'prefread.cpp',
 ]
 
+# prefapi.cpp cannot be built in unified mode because it uses plarena.h
+SOURCES += [
+    'prefapi.cpp',
+]
+
 MSVC_ENABLE_PGO = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
 DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
--- a/modules/libpref/src/nsPrefBranch.cpp
+++ b/modules/libpref/src/nsPrefBranch.cpp
@@ -676,36 +676,35 @@ NS_IMETHODIMP nsPrefBranch::Observe(nsIS
   // watch for xpcom shutdown and free our observers to eliminate any cyclic references
   if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     freeObserverList();
   }
   return NS_OK;
 }
 
 /* static */
-nsresult nsPrefBranch::NotifyObserver(const char *newpref, void *data)
+void nsPrefBranch::NotifyObserver(const char *newpref, void *data)
 {
   PrefCallback *pCallback = (PrefCallback *)data;
 
   nsCOMPtr<nsIObserver> observer = pCallback->GetObserver();
   if (!observer) {
     // The observer has expired.  Let's remove this callback.
     pCallback->GetPrefBranch()->RemoveExpiredCallback(pCallback);
-    return NS_OK;
+    return;
   }
 
   // remove any root this string may contain so as to not confuse the observer
   // by passing them something other than what they passed us as a topic
   uint32_t len = pCallback->GetPrefBranch()->GetRootLength();
   nsAutoCString suffix(newpref + len);
 
   observer->Observe(static_cast<nsIPrefBranch *>(pCallback->GetPrefBranch()),
                     NS_PREFBRANCH_PREFCHANGE_TOPIC_ID,
                     NS_ConvertASCIItoUTF16(suffix).get());
-  return NS_OK;
 }
 
 PLDHashOperator
 FreeObserverFunc(PrefCallback *aKey,
                  nsAutoPtr<PrefCallback> &aCallback,
                  void *aArgs)
 {
   // Calling NS_RELEASE below might trigger a call to
--- a/modules/libpref/src/nsPrefBranch.h
+++ b/modules/libpref/src/nsPrefBranch.h
@@ -1,13 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
+#ifndef nsPrefBranch_h
+#define nsPrefBranch_h
+
 #include "nsCOMPtr.h"
 #include "nsIObserver.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefBranchInternal.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIRelativeFilePref.h"
@@ -186,17 +189,17 @@ public:
 
   nsPrefBranch(const char *aPrefRoot, bool aDefaultBranch);
   virtual ~nsPrefBranch();
 
   int32_t GetRootLength() { return mPrefRootLength; }
 
   nsresult RemoveObserverFromMap(const char *aDomain, nsISupports *aObserver);
 
-  static nsresult NotifyObserver(const char *newpref, void *data);
+  static void NotifyObserver(const char *newpref, void *data);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
 protected:
   nsPrefBranch()    /* disallow use of this constructer */
     { }
 
   nsresult   GetDefaultFromPropertiesFile(const char *aPrefName, PRUnichar **return_buf);
@@ -255,8 +258,10 @@ public:
   
                 nsRelativeFilePref();
   virtual       ~nsRelativeFilePref();
   
 private:
   nsCOMPtr<nsIFile> mFile;
   nsCString mRelativeToKey;
 };
+
+#endif
--- a/modules/libpref/src/prefapi.cpp
+++ b/modules/libpref/src/prefapi.cpp
@@ -948,19 +948,17 @@ static nsresult pref_DoCallback(const ch
 
     for (node = gCallbacks; node != nullptr; node = node->next)
     {
         if ( node->func &&
              PL_strncmp(changed_pref,
                         node->domain,
                         strlen(node->domain)) == 0 )
         {
-            nsresult rv2 = (*node->func) (changed_pref, node->data);
-            if (NS_FAILED(rv2))
-                rv = rv2;
+            (*node->func) (changed_pref, node->data);
         }
     }
 
     gCallbacksInProgress = reentered;
 
     if (gShouldCleanupDeadNodes && !gCallbacksInProgress)
     {
         struct CallbackNode* prev_node = nullptr;
--- a/modules/libpref/src/prefapi.h
+++ b/modules/libpref/src/prefapi.h
@@ -149,17 +149,17 @@ nsresult PREF_ClearAllUserPrefs();
 */
 /* Temporarily conditionally compile PrefChangedFunc typedef.
 ** During migration from old libpref to nsIPref we need it in
 ** both header files.  Eventually prefapi.h will become a private
 ** file.  The two types need to be in sync for now.  Certain
 ** compilers were having problems with multiple definitions.
 */
 #ifndef have_PrefChangedFunc_typedef
-typedef nsresult (*PrefChangedFunc) (const char *, void *); 
+typedef void (*PrefChangedFunc) (const char *, void *);
 #define have_PrefChangedFunc_typedef
 #endif
 
 /*
 // <font color=blue>
 // Register a callback.  This takes a node in the preference tree and will
 // call the callback function if anything below that node is modified.
 // Unregister returns PREF_NOERROR if a callback was found that
--- a/modules/libpref/src/prefapi_private_data.h
+++ b/modules/libpref/src/prefapi_private_data.h
@@ -1,15 +1,18 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 /* Data shared between prefapi.c and nsPref.cpp */
 
+#ifndef prefapi_private_data_h
+#define prefapi_private_data_h
+
 #include "mozilla/MemoryReporting.h"
 
 extern PLDHashTable			gHashTable;
 extern bool                 gDirty;
 
 namespace mozilla {
 namespace dom {
 class PrefSetting;
@@ -37,8 +40,10 @@ pref_SetPref(const mozilla::dom::PrefSet
 int pref_CompareStrings(const void *v1, const void *v2, void* unused);
 PrefHashEntry* pref_HashTableLookup(const void *key);
 
 void pref_GetPrefFromEntry(PrefHashEntry *aHashEntry,
                            mozilla::dom::PrefSetting* aPref);
 
 size_t
 pref_SizeOfPrivateData(mozilla::MallocSizeOf aMallocSizeOf);
+
+#endif
--- a/widget/windows/WinMouseScrollHandler.h
+++ b/widget/windows/WinMouseScrollHandler.h
@@ -329,20 +329,19 @@ private:
     {
       Init();
       return mMouseScrollTransactionTimeout;
     }
 
   private:
     void Init();
 
-    static int OnChange(const char* aPrefName, void* aClosure)
+    static void OnChange(const char* aPrefName, void* aClosure)
     {
       static_cast<UserPrefs*>(aClosure)->MarkDirty();
-      return 0;
     }
 
     bool mInitialized;
     bool mScrollMessageHandledAsWheelMessage;
     int32_t mOverriddenVerticalScrollAmount;
     int32_t mOverriddenHorizontalScrollAmount;
     int32_t mMouseScrollTransactionTimeout;
   };
@@ -511,9 +510,9 @@ public:
 
     static bool sFakeScrollableWindowNeeded;
   }; // class Device
 };
 
 } // namespace widget
 } // namespace mozilla
 
-#endif // mozilla_widget_WinMouseScrollHandler_h__
\ No newline at end of file
+#endif // mozilla_widget_WinMouseScrollHandler_h__
--- a/widget/xpwidgets/nsXPLookAndFeel.cpp
+++ b/widget/xpwidgets/nsXPLookAndFeel.cpp
@@ -379,46 +379,44 @@ nsXPLookAndFeel::InitColorFromPref(int32
       CACHE_COLOR(i, thecolor);
     }
   } else if (NS_ColorNameToRGB(colorStr, &thecolor)) {
     CACHE_COLOR(i, thecolor);
   }
 }
 
 // static
-int
+void
 nsXPLookAndFeel::OnPrefChanged(const char* aPref, void* aClosure)
 {
 
   // looping in the same order as in ::Init
 
   nsDependentCString prefName(aPref);
   unsigned int i;
   for (i = 0; i < ArrayLength(sIntPrefs); ++i) {
     if (prefName.Equals(sIntPrefs[i].name)) {
       IntPrefChanged(&sIntPrefs[i]);
-      return 0;
+      return;
     }
   }
 
   for (i = 0; i < ArrayLength(sFloatPrefs); ++i) {
     if (prefName.Equals(sFloatPrefs[i].name)) {
       FloatPrefChanged(&sFloatPrefs[i]);
-      return 0;
+      return;
     }
   }
 
   for (i = 0; i < ArrayLength(sColorPrefs); ++i) {
     if (prefName.Equals(sColorPrefs[i])) {
       ColorPrefChanged(i, sColorPrefs[i]);
-      return 0;
+      return;
     }
   }
-
-  return 0;
 }
 
 //
 // Read values from the user's preferences.
 // This is done once at startup, but since the user's preferences
 // haven't actually been read yet at that time, we also have to
 // set a callback to inform us of changes to each pref.
 //
--- a/widget/xpwidgets/nsXPLookAndFeel.h
+++ b/widget/xpwidgets/nsXPLookAndFeel.h
@@ -86,17 +86,17 @@ protected:
   static void FloatPrefChanged(nsLookAndFeelFloatPref *data);
   static void ColorPrefChanged(unsigned int index, const char *prefName);
   void InitFromPref(nsLookAndFeelIntPref* aPref);
   void InitFromPref(nsLookAndFeelFloatPref* aPref);
   void InitColorFromPref(int32_t aIndex);
   virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) = 0;
   bool IsSpecialColor(ColorID aID, nscolor &aColor);
 
-  static int OnPrefChanged(const char* aPref, void* aClosure);
+  static void OnPrefChanged(const char* aPref, void* aClosure);
 
   static bool sInitialized;
   static nsLookAndFeelIntPref sIntPrefs[];
   static nsLookAndFeelFloatPref sFloatPrefs[];
   /* this length must not be shorter than the length of the longest string in the array
    * see nsXPLookAndFeel.cpp
    */
   static const char sColorPrefs[][38];
--- a/xpcom/threads/HangMonitor.cpp
+++ b/xpcom/threads/HangMonitor.cpp
@@ -65,17 +65,17 @@ static HANDLE winMainThreadHandle = null
 // Default timeout for reporting chrome hangs to Telemetry (5 seconds)
 static const int32_t DEFAULT_CHROME_HANG_INTERVAL = 5;
 
 // Maximum number of PCs to gather from the stack
 static const int32_t MAX_CALL_STACK_PCS = 400;
 #endif
 
 // PrefChangedFunc
-int
+void
 PrefChanged(const char*, void*)
 {
   int32_t newval = Preferences::GetInt(kHangMonitorPrefName);
 #ifdef REPORT_CHROME_HANGS
   // Monitor chrome hangs on the profiling branch if Telemetry enabled
   if (newval == 0) {
     bool telemetryEnabled = Preferences::GetBool(kTelemetryPrefName);
     if (telemetryEnabled) {
@@ -83,18 +83,16 @@ PrefChanged(const char*, void*)
     }
   }
 #endif
   MonitorAutoLock lock(*gMonitor);
   if (newval != gTimeout) {
     gTimeout = newval;
     lock.Notify();
   }
-
-  return 0;
 }
 
 void
 Crash()
 {
   if (gDebugDisableHangMonitor) {
     return;
   }