Bug 514280 Stop using nsCOMPtr for concrete types r=bsmedberg

--HG--
extra : rebase_source : f8fb50de9292320eb7589dd28dc566d0f5044da6
This commit is contained in:
Neil Rashbrook 2014-03-18 00:23:03 +00:00
parent e8174bf4d2
commit 921625ab05
45 changed files with 93 additions and 91 deletions

View File

@ -47,7 +47,7 @@ DocumentRendererChild::RenderDocument(nsIDOMWindow *window,
if (flushLayout)
nsContentUtils::FlushLayoutForTree(window);
nsCOMPtr<nsPresContext> presContext;
nsRefPtr<nsPresContext> presContext;
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window);
if (win) {
nsIDocShell* docshell = win->GetDocShell();

View File

@ -1025,7 +1025,7 @@ protected:
// is synchronised on a monitor. The lifetime of this object is
// after mPlayState is LOADING and before mPlayState is SHUTDOWN. It
// is safe to access it during this period.
nsCOMPtr<MediaDecoderStateMachine> mDecoderStateMachine;
nsRefPtr<MediaDecoderStateMachine> mDecoderStateMachine;
// Media data resource.
nsRefPtr<MediaResource> mResource;

View File

@ -2060,7 +2060,7 @@ public:
}
private:
nsRefPtr<MediaDecoder> mDecoder;
nsCOMPtr<MediaDecoderStateMachine> mStateMachine;
nsRefPtr<MediaDecoderStateMachine> mStateMachine;
};
// Runnable which dispatches an event to the main thread to dispose of the
@ -2079,7 +2079,7 @@ public:
}
private:
nsRefPtr<MediaDecoder> mDecoder;
nsCOMPtr<MediaDecoderStateMachine> mStateMachine;
nsRefPtr<MediaDecoderStateMachine> mStateMachine;
};
nsresult MediaDecoderStateMachine::RunStateMachine()

View File

@ -16,7 +16,7 @@ namespace mozilla {
class MediaPluginReader;
class MediaPluginHost {
nsCOMPtr<MediaResourceServer> mResourceServer;
nsRefPtr<MediaResourceServer> mResourceServer;
nsTArray<MPAPI::Manifest *> mPlugins;
MPAPI::Manifest *FindPlugin(const nsACString& aMimeType);

View File

@ -112,7 +112,7 @@ private:
// The MediaResourceServer that owns the MediaResource instances
// served. This is used to lookup the MediaResource from the URL.
nsCOMPtr<MediaResourceServer> mServer;
nsRefPtr<MediaResourceServer> mServer;
// Write 'aBufferLength' bytes from 'aBuffer' to 'mOutput'. This
// method ensures all the data is written by checking the number
@ -342,7 +342,7 @@ class ResourceSocketListener : public nsIServerSocketListener
public:
// The MediaResourceServer used to look up the MediaResource
// on requests.
nsCOMPtr<MediaResourceServer> mServer;
nsRefPtr<MediaResourceServer> mServer;
public:
NS_DECL_THREADSAFE_ISUPPORTS
@ -416,7 +416,7 @@ MediaResourceServer::Run()
already_AddRefed<MediaResourceServer>
MediaResourceServer::Start()
{
nsCOMPtr<MediaResourceServer> server = new MediaResourceServer();
nsRefPtr<MediaResourceServer> server = new MediaResourceServer();
NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
return server.forget();
}

View File

@ -460,7 +460,7 @@ AudioContext::DecodeAudioData(const ArrayBuffer& aBuffer,
aBuffer.Data(), aBuffer.Length(),
contentType);
nsCOMPtr<DecodeErrorCallback> failureCallback;
nsRefPtr<DecodeErrorCallback> failureCallback;
if (aFailureCallback.WasPassed()) {
failureCallback = &aFailureCallback.Value();
}

View File

@ -202,7 +202,7 @@ nsXMLContentSink::MaybePrettyPrint()
mCSSLoader->SetEnabled(true);
}
nsCOMPtr<nsXMLPrettyPrinter> printer;
nsRefPtr<nsXMLPrettyPrinter> printer;
nsresult rv = NS_NewXMLPrettyPrinter(getter_AddRefs(printer));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -44,7 +44,7 @@ class nsXULTemplateQueryProcessorRDF MOZ_FINAL : public nsIXULTemplateQueryProce
public nsIRDFObserver
{
public:
typedef nsTArray<nsCOMPtr<nsXULTemplateResultRDF> > ResultArray;
typedef nsTArray<nsRefPtr<nsXULTemplateResultRDF> > ResultArray;
nsXULTemplateQueryProcessorRDF();

View File

@ -338,7 +338,7 @@ private:
nsRefPtr<Voicemail> mVoicemail;
#endif
#ifdef MOZ_B2G_BT
nsCOMPtr<bluetooth::BluetoothManager> mBluetooth;
nsRefPtr<bluetooth::BluetoothManager> mBluetooth;
#endif
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
nsRefPtr<system::AudioChannelManager> mAudioChannelManager;

View File

@ -42,7 +42,7 @@ class ContentPermissionRequestParent : public PContentPermissionRequestParent
nsCOMPtr<nsIPrincipal> mPrincipal;
nsCOMPtr<Element> mElement;
nsCOMPtr<nsContentPermissionRequestProxy> mProxy;
nsRefPtr<nsContentPermissionRequestProxy> mProxy;
nsTArray<PermissionRequest> mRequests;
private:

View File

@ -5033,7 +5033,7 @@ nsGlobalWindow::GetDevicePixelRatio(ErrorResult& aError)
return 1.0;
}
nsCOMPtr<nsPresContext> presContext;
nsRefPtr<nsPresContext> presContext;
mDocShell->GetPresContext(getter_AddRefs(presContext));
if (!presContext) {
return 1.0;

View File

@ -613,7 +613,7 @@ nsDOMCameraControl::SensorAngle()
already_AddRefed<CameraShutterCallback>
nsDOMCameraControl::GetOnShutter()
{
nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb;
nsRefPtr<CameraShutterCallback> cb = mOnShutterCb;
return cb.forget();
}
@ -627,7 +627,7 @@ nsDOMCameraControl::SetOnShutter(CameraShutterCallback* aCb)
already_AddRefed<CameraClosedCallback>
nsDOMCameraControl::GetOnClosed()
{
nsCOMPtr<CameraClosedCallback> onClosed = mOnClosedCb;
nsRefPtr<CameraClosedCallback> onClosed = mOnClosedCb;
return onClosed.forget();
}
@ -640,7 +640,7 @@ nsDOMCameraControl::SetOnClosed(CameraClosedCallback* aCb)
already_AddRefed<CameraRecorderStateChange>
nsDOMCameraControl::GetOnRecorderStateChange()
{
nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
return cb.forget();
}
@ -654,7 +654,7 @@ nsDOMCameraControl::SetOnRecorderStateChange(CameraRecorderStateChange* aCb)
already_AddRefed<CameraPreviewStateChange>
nsDOMCameraControl::GetOnPreviewStateChange()
{
nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
return cb.forget();
}
void
@ -783,7 +783,7 @@ nsDOMCameraControl::SetConfiguration(const CameraConfiguration& aConfiguration,
{
MOZ_ASSERT(mCameraControl);
nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
if (cb) {
// We're busy taking a picture, can't change modes right now.
if (aOnError.WasPassed()) {
@ -822,12 +822,12 @@ nsDOMCameraControl::AutoFocus(CameraAutoFocusCallback& aOnSuccess,
{
MOZ_ASSERT(mCameraControl);
nsCOMPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
bool cancel = false;
if (cb) {
// we have a callback, which means we're already in the process of
// auto-focusing--cancel the old callback
nsCOMPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget();
nsRefPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget();
if (ecb) {
ErrorResult ignored;
ecb->Call(NS_LITERAL_STRING("Interrupted"), ignored);
@ -852,7 +852,7 @@ nsDOMCameraControl::TakePicture(const CameraPictureOptions& aOptions,
{
MOZ_ASSERT(mCameraControl);
nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb;
if (cb) {
// There is already a call to TakePicture() in progress, abort this one and
// invoke the error callback (if one was passed in).
@ -971,7 +971,7 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
// The hardware is open, so we can return a camera to JS, even if
// the preview hasn't started yet.
if (mGetCameraOnSuccessCb) {
nsCOMPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget();
nsRefPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget();
ErrorResult ignored;
mGetCameraOnErrorCb = nullptr;
cb->Call(*this, *mCurrentConfiguration, ignored);
@ -981,12 +981,12 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
case CameraControlListener::kHardwareClosed:
if (mReleaseOnSuccessCb) {
// If we have this event handler, this was a solicited hardware close.
nsCOMPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget();
nsRefPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget();
mReleaseOnErrorCb = nullptr;
cb->Call(ignored);
} else if(mOnClosedCb) {
// If not, something else closed the hardware.
nsCOMPtr<CameraClosedCallback> cb = mOnClosedCb;
nsRefPtr<CameraClosedCallback> cb = mOnClosedCb;
cb->Call(ignored);
}
break;
@ -1003,7 +1003,7 @@ nsDOMCameraControl::OnShutter()
DOM_CAMERA_LOGI("DOM ** SNAP **\n");
nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb;
nsRefPtr<CameraShutterCallback> cb = mOnShutterCb;
if (cb) {
ErrorResult ignored;
cb->Call(ignored);
@ -1030,7 +1030,7 @@ nsDOMCameraControl::OnPreviewStateChange(CameraControlListener::PreviewState aSt
break;
}
nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb;
ErrorResult ignored;
cb->Call(state, ignored);
}
@ -1048,7 +1048,7 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
switch (aState) {
case CameraControlListener::kRecorderStarted:
if (mStartRecordingOnSuccessCb) {
nsCOMPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget();
nsRefPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget();
mStartRecordingOnErrorCb = nullptr;
cb->Call(ignored);
}
@ -1091,7 +1091,7 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
return;
}
nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
if (cb) {
cb->Call(state, ignored);
}
@ -1117,7 +1117,7 @@ nsDOMCameraControl::OnConfigurationChange(DOMCameraConfiguration* aConfiguration
DOM_CAMERA_LOGI(" recorder profile : %s\n",
NS_ConvertUTF16toUTF8(mCurrentConfiguration->mRecorderProfile).get());
nsCOMPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget();
nsRefPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget();
mSetConfigurationOnErrorCb = nullptr;
if (cb) {
ErrorResult ignored;
@ -1130,7 +1130,7 @@ nsDOMCameraControl::OnAutoFocusComplete(bool aAutoFocusSucceeded)
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget();
mAutoFocusOnErrorCb = nullptr;
if (cb) {
ErrorResult ignored;
@ -1143,7 +1143,7 @@ nsDOMCameraControl::OnTakePictureComplete(nsIDOMBlob* aPicture)
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget();
nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget();
mTakePictureOnErrorCb = nullptr;
if (!cb) {
// Warn because it shouldn't be possible to get here without
@ -1164,7 +1164,7 @@ nsDOMCameraControl::OnError(CameraControlListener::CameraErrorContext aContext,
NS_LossyConvertUTF16toASCII(aError).get());
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<CameraErrorCallback>* errorCb;
nsRefPtr<CameraErrorCallback>* errorCb;
switch (aContext) {
case CameraControlListener::kInStartCamera:
mGetCameraOnSuccessCb = nullptr;
@ -1240,7 +1240,7 @@ nsDOMCameraControl::OnError(CameraControlListener::CameraErrorContext aContext,
}
// kung-fu death grip
nsCOMPtr<CameraErrorCallback> cb = (*errorCb).forget();
nsRefPtr<CameraErrorCallback> cb = (*errorCb).forget();
ErrorResult ignored;
cb->Call(aError, ignored);
}

View File

@ -168,24 +168,24 @@ protected:
nsRefPtr<dom::CameraCapabilities> mCapabilities;
// solicited camera control event handlers
nsCOMPtr<dom::GetCameraCallback> mGetCameraOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mGetCameraOnErrorCb;
nsCOMPtr<dom::CameraAutoFocusCallback> mAutoFocusOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mAutoFocusOnErrorCb;
nsCOMPtr<dom::CameraTakePictureCallback> mTakePictureOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mTakePictureOnErrorCb;
nsCOMPtr<dom::CameraStartRecordingCallback> mStartRecordingOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mStartRecordingOnErrorCb;
nsCOMPtr<dom::CameraReleaseCallback> mReleaseOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mReleaseOnErrorCb;
nsCOMPtr<dom::CameraSetConfigurationCallback> mSetConfigurationOnSuccessCb;
nsCOMPtr<dom::CameraErrorCallback> mSetConfigurationOnErrorCb;
nsRefPtr<dom::GetCameraCallback> mGetCameraOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mGetCameraOnErrorCb;
nsRefPtr<dom::CameraAutoFocusCallback> mAutoFocusOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mAutoFocusOnErrorCb;
nsRefPtr<dom::CameraTakePictureCallback> mTakePictureOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mTakePictureOnErrorCb;
nsRefPtr<dom::CameraStartRecordingCallback> mStartRecordingOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mStartRecordingOnErrorCb;
nsRefPtr<dom::CameraReleaseCallback> mReleaseOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mReleaseOnErrorCb;
nsRefPtr<dom::CameraSetConfigurationCallback> mSetConfigurationOnSuccessCb;
nsRefPtr<dom::CameraErrorCallback> mSetConfigurationOnErrorCb;
// unsolicited event handlers
nsCOMPtr<dom::CameraShutterCallback> mOnShutterCb;
nsCOMPtr<dom::CameraClosedCallback> mOnClosedCb;
nsCOMPtr<dom::CameraRecorderStateChange> mOnRecorderStateChangeCb;
nsCOMPtr<dom::CameraPreviewStateChange> mOnPreviewStateChangeCb;
nsRefPtr<dom::CameraShutterCallback> mOnShutterCb;
nsRefPtr<dom::CameraClosedCallback> mOnClosedCb;
nsRefPtr<dom::CameraRecorderStateChange> mOnRecorderStateChangeCb;
nsRefPtr<dom::CameraPreviewStateChange> mOnPreviewStateChangeCb;
// Camera event listener; we only need this weak reference so that
// we can remove the listener from the camera when we're done

View File

@ -119,7 +119,7 @@ nsDOMCameraManager::GetCamera(const nsAString& aCamera,
cameraId = 1;
}
nsCOMPtr<CameraErrorCallback> errorCallback = nullptr;
nsRefPtr<CameraErrorCallback> errorCallback = nullptr;
if (aOnError.WasPassed()) {
errorCallback = &aOnError.Value();
}

View File

@ -190,7 +190,7 @@ DeviceStorageRequestChild::
cursor->mFiles.AppendElement(dsf);
}
nsCOMPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor);
nsRefPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor);
event->Continue();
break;
}

View File

@ -3329,7 +3329,7 @@ ContentParent::RecvAddIdleObserver(const uint64_t& aObserver, const uint32_t& aI
do_GetService("@mozilla.org/widget/idleservice;1", &rv);
NS_ENSURE_SUCCESS(rv, false);
nsCOMPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver);
nsRefPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver);
mIdleListeners.Put(aObserver, listener);
idleService->AddIdleObserver(listener, aIdleTimeInS);
return true;
@ -3343,7 +3343,7 @@ ContentParent::RecvRemoveIdleObserver(const uint64_t& aObserver, const uint32_t&
do_GetService("@mozilla.org/widget/idleservice;1", &rv);
NS_ENSURE_SUCCESS(rv, false);
nsCOMPtr<ParentIdleListener> listener;
nsRefPtr<ParentIdleListener> listener;
bool found = mIdleListeners.Get(aObserver, &listener);
if (found) {
mIdleListeners.Remove(aObserver);

View File

@ -585,7 +585,7 @@ private:
nsRefPtr<nsConsoleService> mConsoleService;
nsConsoleService* GetConsoleService();
nsDataHashtable<nsUint64HashKey, nsCOMPtr<ParentIdleListener> > mIdleListeners;
nsDataHashtable<nsUint64HashKey, nsRefPtr<ParentIdleListener> > mIdleListeners;
#ifdef MOZ_X11
// Dup of child's X socket, used to scope its resources to this

View File

@ -326,7 +326,7 @@ protected:
friend class PluginEventRunnable;
nsTArray<nsCOMPtr<PluginEventRunnable>> mPostedEvents;
nsTArray<nsRefPtr<PluginEventRunnable>> mPostedEvents;
void PopPostedEvent(PluginEventRunnable* r);
void OnSurfaceTextureFrameAvailable();

View File

@ -124,7 +124,7 @@ protected:
private:
nsSMILTimeValueSpec* mSpec;
};
nsCOMPtr<EventListener> mEventListener;
nsRefPtr<EventListener> mEventListener;
};
#endif // NS_SMILTIMEVALUESPEC_H_

View File

@ -144,7 +144,7 @@ public:
nsString mDictionary;
private:
nsCOMPtr<nsEditorSpellCheck> mSpellCheck;
nsRefPtr<nsEditorSpellCheck> mSpellCheck;
};
NS_IMPL_ISUPPORTS1(DictionaryFetcher, nsIContentPrefCallback2)

View File

@ -8,6 +8,7 @@
#include "nsIFind.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDOMNode.h"
@ -69,7 +70,7 @@ protected:
// The iterator we use to move through the document:
nsresult InitIterator(nsIDOMNode* aStartNode, int32_t aStartOffset,
nsIDOMNode* aEndNode, int32_t aEndOffset);
nsCOMPtr<nsFindContentIterator> mIterator;
nsRefPtr<nsFindContentIterator> mIterator;
};
#endif // nsFind_h__

View File

@ -4,6 +4,7 @@
#include "mozilla/ModuleUtils.h"
#include "nsAuth.h"
#include "nsAutoPtr.h"
//-----------------------------------------------------------------------------
@ -112,7 +113,7 @@ nsSambaNTLMAuthConstructor(nsISupports *outer, REFNSIID iid, void **result)
if (outer)
return NS_ERROR_NO_AGGREGATION;
nsCOMPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM();
nsRefPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM();
if (!auth)
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -171,7 +171,7 @@ private:
// When mPendingSpellCheck is non-null, this is the callback passed when
// it was initialized.
nsCOMPtr<InitEditorSpellCheckCallback> mPendingInitEditorSpellCheckCallback;
nsRefPtr<InitEditorSpellCheckCallback> mPendingInitEditorSpellCheckCallback;
// Set when we have spellchecked after the last edit operation. See the
// commment at the top of the .cpp file for more info.

View File

@ -314,7 +314,7 @@ public:
private:
nsTArray<nsRefPtr<LayerScopeWebSocketHandler> > mHandlers;
nsCOMPtr<nsIThread> mDebugSenderThread;
nsCOMPtr<DebugDataSender> mCurrentSender;
nsRefPtr<DebugDataSender> mCurrentSender;
nsCOMPtr<nsIServerSocket> mServerSocket;
};

View File

@ -1521,7 +1521,7 @@ ChildImpl::GetOrCreateForCurrentThread(
return true;
}
nsCOMPtr<CreateActorRunnable> runnable = new CreateActorRunnable();
nsRefPtr<CreateActorRunnable> runnable = new CreateActorRunnable();
if (NS_FAILED(NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL))) {
CRASH_IN_CHILD_PROCESS("Failed to dispatch to main thread!");
return false;

View File

@ -1042,7 +1042,7 @@ EndSwapDocShellsForDocument(nsIDocument* aDocument, void*)
nsCOMPtr<nsIContentViewer> cv;
ds->GetContentViewer(getter_AddRefs(cv));
while (cv) {
nsCOMPtr<nsPresContext> pc;
nsRefPtr<nsPresContext> pc;
cv->GetPresContext(getter_AddRefs(pc));
if (pc && pc->GetPresShell()) {
pc->GetPresShell()->SetNeverPainting(ds->IsInvisible());

View File

@ -84,7 +84,7 @@ nsFontFaceList::AddFontsFromTextRun(gfxTextRun* aTextRun,
existingFace->AddMatchType(iter.GetGlyphRun()->mMatchType);
} else {
// A new font entry we haven't seen before
nsCOMPtr<nsFontFace> ff =
nsRefPtr<nsFontFace> ff =
new nsFontFace(fe, aTextRun->GetFontGroup(),
iter.GetGlyphRun()->mMatchType);
mFontFaces.Put(fe, ff);

View File

@ -62,7 +62,7 @@ private:
int32_t mActionType;
int32_t mChildCount;
int32_t mSelection;
nsCOMPtr<MouseListener> mListener;
nsRefPtr<MouseListener> mListener;
// helper to return the frame for the attribute selection="number"
nsIFrame*

View File

@ -11,7 +11,6 @@
#include "nsISupports.h"
#include "nsCycleCollectionParticipant.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "prclist.h"
#include "mozilla/Attributes.h"
@ -44,7 +43,7 @@ public:
struct HandleChangeData {
nsRefPtr<MediaQueryList> mql;
nsCOMPtr<mozilla::dom::MediaQueryListListener> callback;
nsRefPtr<mozilla::dom::MediaQueryListListener> callback;
};
typedef FallibleTArray< nsRefPtr<mozilla::dom::MediaQueryListListener> > CallbackList;

View File

@ -149,7 +149,7 @@ int NrIceResolver::resolve(nr_resolver_resource *resource,
int _status;
MOZ_ASSERT(allocated_resolvers_ > 0);
ASSERT_ON_THREAD(sts_thread_);
nsCOMPtr<PendingResolution> pr;
nsRefPtr<PendingResolution> pr;
if (resource->transport_protocol != IPPROTO_UDP &&
resource->transport_protocol != IPPROTO_TCP) {

View File

@ -109,7 +109,7 @@ class TransportLayerPrsock : public TransportLayer {
}
PRFileDesc *fd_;
nsCOMPtr<SocketHandler> handler_;
nsRefPtr<SocketHandler> handler_;
nsCOMPtr<nsISocketTransportService> stservice_;
};

View File

@ -82,7 +82,7 @@ public:
}
private:
nsCOMPtr<BackgroundFileSaver> mSaver;
nsRefPtr<BackgroundFileSaver> mSaver;
nsCOMPtr<nsIFile> mTarget;
};

View File

@ -352,7 +352,7 @@ nsUDPSocket::OnSocketReady(PRFileDesc *fd, int16_t outFlags)
return;
}
nsCOMPtr<nsUDPOutputStream> os = new nsUDPOutputStream(this, mFD, prClientAddr);
nsRefPtr<nsUDPOutputStream> os = new nsUDPOutputStream(this, mFD, prClientAddr);
rv = NS_AsyncCopy(pipeIn, os, mSts,
NS_ASYNCCOPY_VIA_READSEGMENTS, 1400);

View File

@ -64,7 +64,7 @@ public:
}
private:
nsCOMPtr<nsCacheEntryDescriptor> mDescriptor;
nsRefPtr<nsCacheEntryDescriptor> mDescriptor;
nsICacheListener *mListener;
nsCOMPtr<nsIThread> mThread;
};

View File

@ -1698,7 +1698,7 @@ private:
char *mBuf;
uint32_t mBufSize;
int32_t mBufPos;
nsCOMPtr<CacheHash> mHash;
nsRefPtr<CacheHash> mHash;
};
nsresult

View File

@ -213,7 +213,7 @@ main(int32_t argc, char *argv[])
NS_ENSURE_SUCCESS(rv, -1);
// Create UDPServerListener to process UDP packets
nsCOMPtr<UDPServerListener> serverListener = new UDPServerListener();
nsRefPtr<UDPServerListener> serverListener = new UDPServerListener();
// Bind server socket to 127.0.0.1
rv = server->Init(0, true);
@ -223,7 +223,7 @@ main(int32_t argc, char *argv[])
server->AsyncListen(serverListener);
// Bind clinet on arbitrary port
nsCOMPtr<UDPClientListener> clientListener = new UDPClientListener();
nsRefPtr<UDPClientListener> clientListener = new UDPClientListener();
client->Init(0, true);
client->AsyncListen(clientListener);

View File

@ -87,7 +87,7 @@ nsSAXXMLReader::HandleStartElement(const char16_t *aName,
if (!mContentHandler)
return NS_OK;
nsCOMPtr<nsSAXAttributes> atts = new nsSAXAttributes();
nsRefPtr<nsSAXAttributes> atts = new nsSAXAttributes();
if (!atts)
return NS_ERROR_OUT_OF_MEMORY;
nsAutoString uri, localName, qName;

View File

@ -59,7 +59,7 @@ public:
nsNSSHttpRequestSession *mRequestSession;
nsCOMPtr<nsHTTPListener> mListener;
nsRefPtr<nsHTTPListener> mListener;
bool mResponsibleForDoneSignal;
TimeStamp mStartTime;
};
@ -167,7 +167,7 @@ nsHTTPDownloadEvent::Run()
}
struct nsCancelHTTPDownloadEvent : nsRunnable {
nsCOMPtr<nsHTTPListener> mListener;
nsRefPtr<nsHTTPListener> mListener;
NS_IMETHOD Run() {
mListener->FreeLoadGroup(true);

View File

@ -7,6 +7,7 @@
#ifndef _NSNSSCALLBACKS_H_
#define _NSNSSCALLBACKS_H_
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "pk11func.h"
#include "nspr.h"
@ -120,7 +121,7 @@ public:
PRIntervalTime mTimeoutInterval;
nsCOMPtr<nsHTTPListener> mListener;
nsRefPtr<nsHTTPListener> mListener;
protected:
nsNSSHttpRequestSession();

View File

@ -206,7 +206,7 @@ Vacuumer::execute()
rv = mDBConn->CreateAsyncStatement(pageSizeQuery,
getter_AddRefs(pageSizeStmt));
NS_ENSURE_SUCCESS(rv, false);
nsCOMPtr<BaseCallback> callback = new BaseCallback();
nsRefPtr<BaseCallback> callback = new BaseCallback();
nsCOMPtr<mozIStoragePendingStatement> ps;
rv = pageSizeStmt->ExecuteAsync(callback, getter_AddRefs(ps));
NS_ENSURE_SUCCESS(rv, false);
@ -375,7 +375,7 @@ VacuumManager::Observe(nsISupports *aSubject,
}
int32_t index;
for (index = startIndex; index < entries.Count(); ++index) {
nsCOMPtr<Vacuumer> vacuum = new Vacuumer(entries[index]);
nsRefPtr<Vacuumer> vacuum = new Vacuumer(entries[index]);
// Only vacuum one database per day.
if (vacuum->execute()) {
break;

View File

@ -81,7 +81,7 @@ private:
nsresult CheckClean(const nsACString &lookupKey,
bool *clean);
nsCOMPtr<nsUrlClassifierDBServiceWorker> mWorker;
nsRefPtr<nsUrlClassifierDBServiceWorker> mWorker;
nsCOMPtr<nsIUrlClassifierDBServiceWorker> mWorkerProxy;
nsInterfaceHashtable<nsCStringHashKey, nsIUrlClassifierHashCompleter> mCompleters;

View File

@ -50,7 +50,7 @@ public:
NS_DECL_NSITOOLKITPROFILE
friend class nsToolkitProfileService;
nsCOMPtr<nsToolkitProfile> mNext;
nsRefPtr<nsToolkitProfile> mNext;
nsToolkitProfile *mPrev;
~nsToolkitProfile() { }
@ -85,7 +85,7 @@ public:
~nsToolkitProfileLock();
private:
nsCOMPtr<nsToolkitProfile> mProfile;
nsRefPtr<nsToolkitProfile> mProfile;
nsCOMPtr<nsIFile> mDirectory;
nsCOMPtr<nsIFile> mLocalDirectory;
@ -156,7 +156,7 @@ private:
{ mCurrent = first; }
private:
~ProfileEnumerator() { }
nsCOMPtr<nsToolkitProfile> mCurrent;
nsRefPtr<nsToolkitProfile> mCurrent;
};
};
@ -274,7 +274,7 @@ nsToolkitProfile::Lock(nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult)
return NS_OK;
}
nsCOMPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock();
nsRefPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock();
if (!lock) return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = lock->Init(this, aUnlocker);
@ -595,7 +595,7 @@ nsresult
NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath,
nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult)
{
nsCOMPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock();
nsRefPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock();
if (!lock) return NS_ERROR_OUT_OF_MEMORY;
nsresult rv = lock->Init(aPath, aTempPath, aUnlocker);

View File

@ -362,7 +362,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
int32_t tabId = curEvent->MetaState();
const nsTArray<nsIntPoint>& points = curEvent->Points();
RefCountedJavaObject* buffer = curEvent->ByteBuffer();
nsCOMPtr<ThumbnailRunnable> sr = new ThumbnailRunnable(mBrowserApp, tabId, points, buffer);
nsRefPtr<ThumbnailRunnable> sr = new ThumbnailRunnable(mBrowserApp, tabId, points, buffer);
MessageLoop::current()->PostIdleTask(FROM_HERE, NewRunnableMethod(sr.get(), &ThumbnailRunnable::Run));
break;
}

View File

@ -406,7 +406,7 @@ protected:
nsRefPtr<LayerManager> mBasicLayerManager;
nsRefPtr<CompositorChild> mCompositorChild;
nsRefPtr<CompositorParent> mCompositorParent;
nsCOMPtr<WidgetShutdownObserver> mShutdownObserver;
nsRefPtr<WidgetShutdownObserver> mShutdownObserver;
nscolor mBackground;
nscolor mForeground;
nsCursor mCursor;

View File

@ -34,7 +34,7 @@ nsINIParserFactory::CreateINIParser(nsIFile* aINIFile,
{
*aResult = nullptr;
nsCOMPtr<nsINIParserImpl> p(new nsINIParserImpl());
nsRefPtr<nsINIParserImpl> p(new nsINIParserImpl());
if (!p)
return NS_ERROR_OUT_OF_MEMORY;