Bug 772987 - Part 2: Use Static{Auto,Ref}Ptr where appropriate. r=mounir

--HG--
extra : rebase_source : 4e3e72ba53cd0177160f80231eebeb4972119eec
This commit is contained in:
Justin Lebar 2012-07-26 15:33:45 -04:00
Родитель b019de5fa4
Коммит a9916a6e83
10 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -60,6 +60,7 @@
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/StandardInteger.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -3057,7 +3058,7 @@ nsresult nsScriptSecurityManager::Init()
return NS_OK;
}
static nsRefPtr<nsScriptSecurityManager> gScriptSecMan;
static StaticRefPtr<nsScriptSecurityManager> gScriptSecMan;
jsid nsScriptSecurityManager::sEnabledID = JSID_VOID;

Просмотреть файл

@ -25,7 +25,7 @@ AlarmHalService::Init()
}
}
/* static */ nsRefPtr<AlarmHalService> AlarmHalService::sSingleton;
/* static */ StaticRefPtr<AlarmHalService> AlarmHalService::sSingleton;
/* static */ already_AddRefed<nsIAlarmHalService>
AlarmHalService::GetInstance()

Просмотреть файл

@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Hal.h"
#include "mozilla/Services.h"
#include "nsIAlarmHalService.h"
@ -28,7 +29,6 @@ public:
void Init();
virtual ~AlarmHalService();
static nsRefPtr<AlarmHalService> sSingleton;
static already_AddRefed<nsIAlarmHalService> GetInstance();
// Implementing hal::AlarmObserver
@ -37,6 +37,7 @@ public:
private:
bool mAlarmEnabled;
nsCOMPtr<nsIAlarmFiredCb> mAlarmFiredCb;
static StaticRefPtr<AlarmHalService> sSingleton;
// TODO The mTimezoneChangedCb would be called
// when a timezone-changed event is detected

Просмотреть файл

@ -35,6 +35,7 @@
#include "mozilla/Hal.h"
#include "nsIWebNavigation.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "Connection.h"
#include "MobileConnection.h"
#include "nsIIdleObserver.h"
@ -608,7 +609,7 @@ private:
NS_IMPL_ISUPPORTS1(VibrateWindowListener, nsIDOMEventListener)
nsRefPtr<VibrateWindowListener> gVibrateWindowListener;
StaticRefPtr<VibrateWindowListener> gVibrateWindowListener;
NS_IMETHODIMP
VibrateWindowListener::HandleEvent(nsIDOMEvent* aEvent)

Просмотреть файл

@ -17,7 +17,7 @@ namespace power {
NS_IMPL_ISUPPORTS1(PowerManagerService, nsIPowerManagerService)
/* static */ nsRefPtr<PowerManagerService> PowerManagerService::sSingleton;
/* static */ StaticRefPtr<PowerManagerService> PowerManagerService::sSingleton;
/* static */ already_AddRefed<nsIPowerManagerService>
PowerManagerService::GetInstance()

Просмотреть файл

@ -12,6 +12,7 @@
#include "nsIPowerManagerService.h"
#include "mozilla/Observer.h"
#include "Types.h"
#include "mozilla/StaticPtr.h"
namespace mozilla {
namespace dom {
@ -39,7 +40,7 @@ private:
void ComputeWakeLockState(const hal::WakeLockInformation& aWakeLockInfo,
nsAString &aState);
static nsRefPtr<PowerManagerService> sSingleton;
static StaticRefPtr<PowerManagerService> sSingleton;
nsTArray<nsCOMPtr<nsIDOMMozWakeLockListener> > mWakeLockListeners;
};

Просмотреть файл

@ -17,6 +17,7 @@
#include "nsIWebNavigation.h"
#include "nsITabChild.h"
#include "nsIDocShell.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/ClearOnShutdown.h"
#include "WindowIdentifier.h"
#include "mozilla/dom/ScreenOrientation.h"
@ -74,7 +75,7 @@ WindowIsActive(nsIDOMWindow *window)
return !hidden;
}
nsAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate;
StaticAutoPtr<WindowIdentifier::IDArrayType> gLastIDToVibrate;
void InitLastIDToVibrate()
{

Просмотреть файл

@ -138,7 +138,7 @@ DiscardingEnabled()
namespace mozilla {
namespace image {
/* static */ nsRefPtr<RasterImage::DecodeWorker> RasterImage::DecodeWorker::sSingleton;
/* static */ StaticRefPtr<RasterImage::DecodeWorker> RasterImage::DecodeWorker::sSingleton;
#ifndef DEBUG
NS_IMPL_ISUPPORTS3(RasterImage, imgIContainer, nsIProperties,

Просмотреть файл

@ -31,6 +31,7 @@
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/LinkedList.h"
#include "mozilla/StaticPtr.h"
#ifdef DEBUG
#include "imgIContainerDebug.h"
#endif
@ -425,7 +426,7 @@ private:
NS_IMETHOD Run();
private: /* statics */
static nsRefPtr<DecodeWorker> sSingleton;
static StaticRefPtr<DecodeWorker> sSingleton;
private: /* methods */
DecodeWorker()

Просмотреть файл

@ -17,6 +17,7 @@
#include "base/basictypes.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Hal.h"
#include "nsIScreen.h"
#include "nsIScreenManager.h"
@ -150,7 +151,7 @@ ConvertToDomOrientation(PRUint32 aRotation, ScreenOrientation *aResult)
// Note that all operations with sOrientationSensorObserver
// should be on the main thread.
static nsAutoPtr<OrientationObserver> sOrientationSensorObserver;
static StaticAutoPtr<OrientationObserver> sOrientationSensorObserver;
} // Anonymous namespace