From 00f3c0417521671ed67aca933f53033a01309364 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 13 Aug 2013 09:32:03 -0400 Subject: [PATCH] Bug 904579 - convert some nsRefPtrs to StaticRefPtrs in widget/android/; r=blassey --- widget/android/nsAppShell.cpp | 2 +- widget/android/nsWindow.cpp | 8 ++++---- widget/android/nsWindow.h | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index ea2621ebe42..71de940eaa7 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -118,7 +118,7 @@ class WakeLockListener MOZ_FINAL : public nsIDOMMozWakeLockListener { NS_IMPL_ISUPPORTS1(WakeLockListener, nsIDOMMozWakeLockListener) nsCOMPtr sPowerManagerService = nullptr; -nsCOMPtr sWakeLockListener = nullptr; +StaticRefPtr sWakeLockListener; nsAppShell::nsAppShell() : mQueueLock("nsAppShell.mQueueLock"), diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 5fd88826ec4..5d22dcaedeb 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -2402,10 +2402,10 @@ nsWindow::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) // off-main-thread compositor fields and functions -nsRefPtr nsWindow::sApzcTreeManager = 0; -nsRefPtr nsWindow::sLayerManager = 0; -nsRefPtr nsWindow::sCompositorParent = 0; -nsRefPtr nsWindow::sCompositorChild = 0; +StaticRefPtr nsWindow::sApzcTreeManager; +StaticRefPtr nsWindow::sLayerManager; +StaticRefPtr nsWindow::sCompositorParent; +StaticRefPtr nsWindow::sCompositorChild; bool nsWindow::sCompositorPaused = true; void diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index bce79a77299..2f074501b56 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -11,6 +11,7 @@ #include "nsIIdleServiceInternal.h" #include "nsTArray.h" #include "AndroidJavaWrappers.h" +#include "mozilla/StaticPtr.h" class gfxASurface; @@ -232,10 +233,10 @@ private: mozilla::AndroidLayerRendererFrame mLayerRendererFrame; - static nsRefPtr sApzcTreeManager; - static nsRefPtr sLayerManager; - static nsRefPtr sCompositorParent; - static nsRefPtr sCompositorChild; + static mozilla::StaticRefPtr sApzcTreeManager; + static mozilla::StaticRefPtr sLayerManager; + static mozilla::StaticRefPtr sCompositorParent; + static mozilla::StaticRefPtr sCompositorChild; static bool sCompositorPaused; };