author | Wes Kocher <wkocher@mozilla.com> |
Mon, 17 Mar 2014 15:19:53 -0700 | |
changeset 192470 | cfe51017482ed83079c0101b99d10e363bbabc97 |
parent 192469 | c2bc849c4169c0d0704fe2756bd37c01d0c66b96 |
child 192471 | 3347b7314302397b0b363ad3ce01a424623fa582 |
push id | 3624 |
push user | asasaki@mozilla.com |
push date | Mon, 09 Jun 2014 21:49:01 +0000 |
treeherder | mozilla-beta@b1a5da15899a [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 514280 |
milestone | 31.0a1 |
backs out | 2a015b45d8085e960f6bdd88e891989d96a2ee9e a01f97c1ed02e49e8d4289d8e9b5544f67c856bb |
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
|
--- a/content/canvas/src/DocumentRendererChild.cpp +++ b/content/canvas/src/DocumentRendererChild.cpp @@ -42,17 +42,17 @@ DocumentRendererChild::RenderDocument(ns uint32_t renderFlags, bool flushLayout, const nsIntSize& renderSize, nsCString& data) { if (flushLayout) nsContentUtils::FlushLayoutForTree(window); - nsRefPtr<nsPresContext> presContext; + nsCOMPtr<nsPresContext> presContext; nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window); if (win) { nsIDocShell* docshell = win->GetDocShell(); if (docshell) { docshell->GetPresContext(getter_AddRefs(presContext)); } } if (!presContext)
--- a/content/media/MediaDecoder.h +++ b/content/media/MediaDecoder.h @@ -1020,17 +1020,17 @@ protected: * The following member variables can be accessed from any thread. ******/ // The state machine object for handling the decoding. It is safe to // call methods of this object from other threads. Its internal data // 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. - nsRefPtr<MediaDecoderStateMachine> mDecoderStateMachine; + nsCOMPtr<MediaDecoderStateMachine> mDecoderStateMachine; // Media data resource. nsRefPtr<MediaResource> mResource; // |ReentrantMonitor| for detecting when the video play state changes. A call // to |Wait| on this monitor will block the thread until the next state // change. // Using a wrapper class to restrict direct access to the |ReentrantMonitor|
--- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -2055,17 +2055,17 @@ public: mStateMachine->ReleaseDecoder(); mDecoder->ReleaseStateMachine(); mStateMachine = nullptr; mDecoder = nullptr; return NS_OK; } private: nsRefPtr<MediaDecoder> mDecoder; - nsRefPtr<MediaDecoderStateMachine> mStateMachine; + nsCOMPtr<MediaDecoderStateMachine> mStateMachine; }; // Runnable which dispatches an event to the main thread to dispose of the // decoder and state machine. This runs on the state machine thread after // the state machine has shutdown, and all events for that state machine have // finished running. class nsDispatchDisposeEvent : public nsRunnable { public: @@ -2074,17 +2074,17 @@ public: : mDecoder(aDecoder), mStateMachine(aStateMachine) {} NS_IMETHOD Run() { NS_DispatchToMainThread(new nsDecoderDisposeEvent(mDecoder.forget(), mStateMachine.forget())); return NS_OK; } private: nsRefPtr<MediaDecoder> mDecoder; - nsRefPtr<MediaDecoderStateMachine> mStateMachine; + nsCOMPtr<MediaDecoderStateMachine> mStateMachine; }; nsresult MediaDecoderStateMachine::RunStateMachine() { AssertCurrentThreadInMonitor(); MediaResource* resource = mDecoder->GetResource(); NS_ENSURE_TRUE(resource, NS_ERROR_NULL_POINTER);
--- a/content/media/plugins/MediaPluginHost.h +++ b/content/media/plugins/MediaPluginHost.h @@ -11,17 +11,17 @@ #include "MPAPI.h" #include "MediaResourceServer.h" namespace mozilla { class MediaPluginReader; class MediaPluginHost { - nsRefPtr<MediaResourceServer> mResourceServer; + nsCOMPtr<MediaResourceServer> mResourceServer; nsTArray<MPAPI::Manifest *> mPlugins; MPAPI::Manifest *FindPlugin(const nsACString& aMimeType); public: MediaPluginHost(); ~MediaPluginHost(); static void Shutdown();
--- a/content/media/plugins/MediaResourceServer.cpp +++ b/content/media/plugins/MediaResourceServer.cpp @@ -107,17 +107,17 @@ private: // Reading from this reads the data sent from the client. nsCOMPtr<nsIInputStream> mInput; // Writing to this sends data to the client. nsCOMPtr<nsIOutputStream> mOutput; // The MediaResourceServer that owns the MediaResource instances // served. This is used to lookup the MediaResource from the URL. - nsRefPtr<MediaResourceServer> mServer; + nsCOMPtr<MediaResourceServer> mServer; // Write 'aBufferLength' bytes from 'aBuffer' to 'mOutput'. This // method ensures all the data is written by checking the number // of bytes returned from the output streams 'Write' method and // looping until done. nsresult WriteAll(char const* aBuffer, int32_t aBufferLength); public: @@ -337,17 +337,17 @@ ServeResourceEvent::Shutdown() from the MediaResourceServer that created this listener, using the URL the client requested. */ class ResourceSocketListener : public nsIServerSocketListener { public: // The MediaResourceServer used to look up the MediaResource // on requests. - nsRefPtr<MediaResourceServer> mServer; + nsCOMPtr<MediaResourceServer> mServer; public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISERVERSOCKETLISTENER ResourceSocketListener(MediaResourceServer* aServer) : mServer(aServer) { @@ -411,17 +411,17 @@ MediaResourceServer::Run() return NS_OK; } /* static */ already_AddRefed<MediaResourceServer> MediaResourceServer::Start() { - nsRefPtr<MediaResourceServer> server = new MediaResourceServer(); + nsCOMPtr<MediaResourceServer> server = new MediaResourceServer(); NS_DispatchToMainThread(server, NS_DISPATCH_SYNC); return server.forget(); } void MediaResourceServer::Stop() { MutexAutoLock lock(mMutex);
--- a/content/media/webaudio/AudioContext.cpp +++ b/content/media/webaudio/AudioContext.cpp @@ -455,17 +455,17 @@ AudioContext::DecodeAudioData(const Arra { // Sniff the content of the media. // Failed type sniffing will be handled by AsyncDecodeMedia. nsAutoCString contentType; NS_SniffContent(NS_DATA_SNIFFER_CATEGORY, nullptr, aBuffer.Data(), aBuffer.Length(), contentType); - nsRefPtr<DecodeErrorCallback> failureCallback; + nsCOMPtr<DecodeErrorCallback> failureCallback; if (aFailureCallback.WasPassed()) { failureCallback = &aFailureCallback.Value(); } nsRefPtr<WebAudioDecodeJob> job( new WebAudioDecodeJob(contentType, this, aBuffer, &aSuccessCallback, failureCallback)); mDecoder.AsyncDecodeMedia(contentType.get(), aBuffer.Data(), aBuffer.Length(), *job);
--- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -197,17 +197,17 @@ nsXMLContentSink::MaybePrettyPrint() mDocument->RemoveObserver(this); mIsDocumentObserver = false; // Reenable the CSSLoader so that the prettyprinting stylesheets can load if (mCSSLoader) { mCSSLoader->SetEnabled(true); } - nsRefPtr<nsXMLPrettyPrinter> printer; + nsCOMPtr<nsXMLPrettyPrinter> printer; nsresult rv = NS_NewXMLPrettyPrinter(getter_AddRefs(printer)); NS_ENSURE_SUCCESS(rv, rv); bool isPrettyPrinting; rv = printer->PrettyPrint(mDocument, &isPrettyPrinting); NS_ENSURE_SUCCESS(rv, rv); mPrettyPrinting = isPrettyPrinting;
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h +++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h @@ -39,17 +39,17 @@ class nsXULTemplateResultRDF; /** * An object that generates results from a query on an RDF graph */ class nsXULTemplateQueryProcessorRDF MOZ_FINAL : public nsIXULTemplateQueryProcessor, public nsIRDFObserver { public: - typedef nsTArray<nsRefPtr<nsXULTemplateResultRDF> > ResultArray; + typedef nsTArray<nsCOMPtr<nsXULTemplateResultRDF> > ResultArray; nsXULTemplateQueryProcessorRDF(); ~nsXULTemplateQueryProcessorRDF(); nsresult InitGlobals(); // nsISupports interface
--- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -333,17 +333,17 @@ private: nsRefPtr<network::Connection> mConnection; #ifdef MOZ_B2G_RIL nsRefPtr<MobileConnectionArray> mMobileConnections; nsRefPtr<CellBroadcast> mCellBroadcast; nsRefPtr<IccManager> mIccManager; nsRefPtr<Voicemail> mVoicemail; #endif #ifdef MOZ_B2G_BT - nsRefPtr<bluetooth::BluetoothManager> mBluetooth; + nsCOMPtr<bluetooth::BluetoothManager> mBluetooth; #endif #ifdef MOZ_AUDIO_CHANNEL_MANAGER nsRefPtr<system::AudioChannelManager> mAudioChannelManager; #endif nsRefPtr<nsDOMCameraManager> mCameraManager; nsCOMPtr<nsIDOMNavigatorSystemMessages> mMessagesManager; nsTArray<nsRefPtr<nsDOMDeviceStorage> > mDeviceStorageStores; nsRefPtr<time::TimeManager> mTimeManager;
--- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -37,17 +37,17 @@ class ContentPermissionRequestParent : p Element* element, const IPC::Principal& principal); virtual ~ContentPermissionRequestParent(); bool IsBeingDestroyed(); nsCOMPtr<nsIPrincipal> mPrincipal; nsCOMPtr<Element> mElement; - nsRefPtr<nsContentPermissionRequestProxy> mProxy; + nsCOMPtr<nsContentPermissionRequestProxy> mProxy; nsTArray<PermissionRequest> mRequests; private: virtual bool Recvprompt(); virtual void ActorDestroy(ActorDestroyReason why); }; ContentPermissionRequestParent::ContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
--- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -5028,17 +5028,17 @@ float nsGlobalWindow::GetDevicePixelRatio(ErrorResult& aError) { FORWARD_TO_OUTER_OR_THROW(GetDevicePixelRatio, (aError), aError, 0.0); if (!mDocShell) { return 1.0; } - nsRefPtr<nsPresContext> presContext; + nsCOMPtr<nsPresContext> presContext; mDocShell->GetPresContext(getter_AddRefs(presContext)); if (!presContext) { return 1.0; } return float(nsPresContext::AppUnitsPerCSSPixel())/ presContext->AppUnitsPerDevPixel(); }
--- a/dom/camera/DOMCameraControl.cpp +++ b/dom/camera/DOMCameraControl.cpp @@ -608,58 +608,58 @@ nsDOMCameraControl::SensorAngle() int32_t angle = 0; mCameraControl->Get(CAMERA_PARAM_SENSORANGLE, angle); return angle; } already_AddRefed<CameraShutterCallback> nsDOMCameraControl::GetOnShutter() { - nsRefPtr<CameraShutterCallback> cb = mOnShutterCb; + nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb; return cb.forget(); } void nsDOMCameraControl::SetOnShutter(CameraShutterCallback* aCb) { mOnShutterCb = aCb; } /* attribute CameraClosedCallback onClosed; */ already_AddRefed<CameraClosedCallback> nsDOMCameraControl::GetOnClosed() { - nsRefPtr<CameraClosedCallback> onClosed = mOnClosedCb; + nsCOMPtr<CameraClosedCallback> onClosed = mOnClosedCb; return onClosed.forget(); } void nsDOMCameraControl::SetOnClosed(CameraClosedCallback* aCb) { mOnClosedCb = aCb; } already_AddRefed<CameraRecorderStateChange> nsDOMCameraControl::GetOnRecorderStateChange() { - nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb; + nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb; return cb.forget(); } void nsDOMCameraControl::SetOnRecorderStateChange(CameraRecorderStateChange* aCb) { mOnRecorderStateChangeCb = aCb; } /* attribute CameraPreviewStateChange onPreviewStateChange; */ already_AddRefed<CameraPreviewStateChange> nsDOMCameraControl::GetOnPreviewStateChange() { - nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb; + nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb; return cb.forget(); } void nsDOMCameraControl::SetOnPreviewStateChange(CameraPreviewStateChange* aCb) { mOnPreviewStateChangeCb = aCb; } @@ -778,17 +778,17 @@ nsDOMCameraControl::ResumePreview(ErrorR void nsDOMCameraControl::SetConfiguration(const CameraConfiguration& aConfiguration, const Optional<OwningNonNull<CameraSetConfigurationCallback> >& aOnSuccess, const Optional<OwningNonNull<CameraErrorCallback> >& aOnError, ErrorResult& aRv) { MOZ_ASSERT(mCameraControl); - nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb; + nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb; if (cb) { // We're busy taking a picture, can't change modes right now. if (aOnError.WasPassed()) { ErrorResult ignored; aOnError.Value().Call(NS_LITERAL_STRING("Busy"), ignored); } aRv = NS_ERROR_FAILURE; return; @@ -817,22 +817,22 @@ nsDOMCameraControl::SetConfiguration(con void nsDOMCameraControl::AutoFocus(CameraAutoFocusCallback& aOnSuccess, const Optional<OwningNonNull<CameraErrorCallback> >& aOnError, ErrorResult& aRv) { MOZ_ASSERT(mCameraControl); - nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget(); + nsCOMPtr<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 - nsRefPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget(); + nsCOMPtr<CameraErrorCallback> ecb = mAutoFocusOnErrorCb.forget(); if (ecb) { ErrorResult ignored; ecb->Call(NS_LITERAL_STRING("Interrupted"), ignored); } cancel = true; } mAutoFocusOnSuccessCb = &aOnSuccess; @@ -847,17 +847,17 @@ nsDOMCameraControl::AutoFocus(CameraAuto void nsDOMCameraControl::TakePicture(const CameraPictureOptions& aOptions, CameraTakePictureCallback& aOnSuccess, const Optional<OwningNonNull<CameraErrorCallback> >& aOnError, ErrorResult& aRv) { MOZ_ASSERT(mCameraControl); - nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb; + nsCOMPtr<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). if (aOnError.WasPassed()) { ErrorResult ignored; aOnError.Value().Call(NS_LITERAL_STRING("TakePictureAlreadyInProgress"), ignored); } aRv = NS_ERROR_FAILURE; @@ -966,49 +966,49 @@ nsDOMCameraControl::OnHardwareStateChang DOM_CAMERA_LOGI("DOM OnHardwareStateChange(%d)\n", aState); switch (aState) { case CameraControlListener::kHardwareOpen: // The hardware is open, so we can return a camera to JS, even if // the preview hasn't started yet. if (mGetCameraOnSuccessCb) { - nsRefPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget(); + nsCOMPtr<GetCameraCallback> cb = mGetCameraOnSuccessCb.forget(); ErrorResult ignored; mGetCameraOnErrorCb = nullptr; cb->Call(*this, *mCurrentConfiguration, ignored); } break; case CameraControlListener::kHardwareClosed: if (mReleaseOnSuccessCb) { // If we have this event handler, this was a solicited hardware close. - nsRefPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget(); + nsCOMPtr<CameraReleaseCallback> cb = mReleaseOnSuccessCb.forget(); mReleaseOnErrorCb = nullptr; cb->Call(ignored); } else if(mOnClosedCb) { // If not, something else closed the hardware. - nsRefPtr<CameraClosedCallback> cb = mOnClosedCb; + nsCOMPtr<CameraClosedCallback> cb = mOnClosedCb; cb->Call(ignored); } break; default: MOZ_ASSUME_UNREACHABLE("Unanticipated camera hardware state"); } } void nsDOMCameraControl::OnShutter() { MOZ_ASSERT(NS_IsMainThread()); DOM_CAMERA_LOGI("DOM ** SNAP **\n"); - nsRefPtr<CameraShutterCallback> cb = mOnShutterCb; + nsCOMPtr<CameraShutterCallback> cb = mOnShutterCb; if (cb) { ErrorResult ignored; cb->Call(ignored); } } void nsDOMCameraControl::OnPreviewStateChange(CameraControlListener::PreviewState aState) @@ -1025,17 +1025,17 @@ nsDOMCameraControl::OnPreviewStateChange state = NS_LITERAL_STRING("started"); break; default: state = NS_LITERAL_STRING("stopped"); break; } - nsRefPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb; + nsCOMPtr<CameraPreviewStateChange> cb = mOnPreviewStateChangeCb; ErrorResult ignored; cb->Call(state, ignored); } void nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState aState, int32_t aArg, int32_t aTrackNum) { @@ -1043,17 +1043,17 @@ nsDOMCameraControl::OnRecorderStateChang MOZ_ASSERT(NS_IsMainThread()); ErrorResult ignored; nsString state; switch (aState) { case CameraControlListener::kRecorderStarted: if (mStartRecordingOnSuccessCb) { - nsRefPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget(); + nsCOMPtr<CameraStartRecordingCallback> cb = mStartRecordingOnSuccessCb.forget(); mStartRecordingOnErrorCb = nullptr; cb->Call(ignored); } state = NS_LITERAL_STRING("Started"); break; case CameraControlListener::kRecorderStopped: NotifyRecordingStatusChange(NS_LITERAL_STRING("shutdown")); @@ -1086,17 +1086,17 @@ nsDOMCameraControl::OnRecorderStateChang break; #endif default: MOZ_ASSUME_UNREACHABLE("Unanticipated video recorder error"); return; } - nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb; + nsCOMPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb; if (cb) { cb->Call(state, ignored); } } void nsDOMCameraControl::OnConfigurationChange(DOMCameraConfiguration* aConfiguration) { @@ -1112,43 +1112,43 @@ nsDOMCameraControl::OnConfigurationChang mCurrentConfiguration->mMaxFocusAreas); DOM_CAMERA_LOGI(" maximum metering areas : %d\n", mCurrentConfiguration->mMaxMeteringAreas); DOM_CAMERA_LOGI(" preview size (w x h) : %d x %d\n", mCurrentConfiguration->mPreviewSize.mWidth, mCurrentConfiguration->mPreviewSize.mHeight); DOM_CAMERA_LOGI(" recorder profile : %s\n", NS_ConvertUTF16toUTF8(mCurrentConfiguration->mRecorderProfile).get()); - nsRefPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget(); + nsCOMPtr<CameraSetConfigurationCallback> cb = mSetConfigurationOnSuccessCb.forget(); mSetConfigurationOnErrorCb = nullptr; if (cb) { ErrorResult ignored; cb->Call(*mCurrentConfiguration, ignored); } } void nsDOMCameraControl::OnAutoFocusComplete(bool aAutoFocusSucceeded) { MOZ_ASSERT(NS_IsMainThread()); - nsRefPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget(); + nsCOMPtr<CameraAutoFocusCallback> cb = mAutoFocusOnSuccessCb.forget(); mAutoFocusOnErrorCb = nullptr; if (cb) { ErrorResult ignored; cb->Call(aAutoFocusSucceeded, ignored); } } void nsDOMCameraControl::OnTakePictureComplete(nsIDOMBlob* aPicture) { MOZ_ASSERT(NS_IsMainThread()); - nsRefPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget(); + nsCOMPtr<CameraTakePictureCallback> cb = mTakePictureOnSuccessCb.forget(); mTakePictureOnErrorCb = nullptr; if (!cb) { // Warn because it shouldn't be possible to get here without // having passed a success callback into takePicture(), even // though we guard against a nullptr dereference. NS_WARNING("DOM Null success callback in OnTakePictureComplete()"); return; } @@ -1159,17 +1159,17 @@ nsDOMCameraControl::OnTakePictureComplet void nsDOMCameraControl::OnError(CameraControlListener::CameraErrorContext aContext, const nsAString& aError) { DOM_CAMERA_LOGI("DOM OnError context=%d, error='%s'\n", aContext, NS_LossyConvertUTF16toASCII(aError).get()); MOZ_ASSERT(NS_IsMainThread()); - nsRefPtr<CameraErrorCallback>* errorCb; + nsCOMPtr<CameraErrorCallback>* errorCb; switch (aContext) { case CameraControlListener::kInStartCamera: mGetCameraOnSuccessCb = nullptr; errorCb = &mGetCameraOnErrorCb; break; case CameraControlListener::kInStopCamera: mReleaseOnSuccessCb = nullptr; @@ -1235,13 +1235,13 @@ nsDOMCameraControl::OnError(CameraContro if (!*errorCb) { DOM_CAMERA_LOGW("DOM No error handler for error '%s' in context=%d\n", NS_LossyConvertUTF16toASCII(aError).get(), aContext); return; } // kung-fu death grip - nsRefPtr<CameraErrorCallback> cb = (*errorCb).forget(); + nsCOMPtr<CameraErrorCallback> cb = (*errorCb).forget(); ErrorResult ignored; cb->Call(aError, ignored); }
--- a/dom/camera/DOMCameraControl.h +++ b/dom/camera/DOMCameraControl.h @@ -163,34 +163,34 @@ protected: nsresult Set(JSContext* aCx, uint32_t aKey, const JS::Value& aValue, uint32_t aLimit); nsresult Get(JSContext* aCx, uint32_t aKey, JS::Value* aValue); nsRefPtr<DOMCameraConfiguration> mCurrentConfiguration; nsRefPtr<dom::CameraCapabilities> mCapabilities; // solicited camera control event handlers - 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; + 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; // unsolicited event handlers - nsRefPtr<dom::CameraShutterCallback> mOnShutterCb; - nsRefPtr<dom::CameraClosedCallback> mOnClosedCb; - nsRefPtr<dom::CameraRecorderStateChange> mOnRecorderStateChangeCb; - nsRefPtr<dom::CameraPreviewStateChange> mOnPreviewStateChangeCb; + nsCOMPtr<dom::CameraShutterCallback> mOnShutterCb; + nsCOMPtr<dom::CameraClosedCallback> mOnClosedCb; + nsCOMPtr<dom::CameraRecorderStateChange> mOnRecorderStateChangeCb; + nsCOMPtr<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 // with it. DOMCameraControlListener* mListener; // our viewfinder stream CameraPreviewMediaStream* mInput;
--- a/dom/camera/DOMCameraManager.cpp +++ b/dom/camera/DOMCameraManager.cpp @@ -114,17 +114,17 @@ nsDOMCameraManager::GetCamera(const nsAS { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); uint32_t cameraId = 0; // back (or forward-facing) camera by default if (aCamera.EqualsLiteral("front")) { cameraId = 1; } - nsRefPtr<CameraErrorCallback> errorCallback = nullptr; + nsCOMPtr<CameraErrorCallback> errorCallback = nullptr; if (aOnError.WasPassed()) { errorCallback = &aOnError.Value(); } // Creating this object will trigger the aOnSuccess callback // (or the aOnError one, if it fails). nsRefPtr<nsDOMCameraControl> cameraControl = new nsDOMCameraControl(cameraId, aInitialConfig, &aOnSuccess, errorCallback, mWindow);
--- a/dom/devicestorage/DeviceStorageRequestChild.cpp +++ b/dom/devicestorage/DeviceStorageRequestChild.cpp @@ -185,17 +185,17 @@ DeviceStorageRequestChild:: uint32_t count = r.paths().Length(); for (uint32_t i = 0; i < count; i++) { nsRefPtr<DeviceStorageFile> dsf = new DeviceStorageFile(r.type(), r.paths()[i].storageName(), r.rootdir(), r.paths()[i].name()); cursor->mFiles.AppendElement(dsf); } - nsRefPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor); + nsCOMPtr<ContinueCursorEvent> event = new ContinueCursorEvent(cursor); event->Continue(); break; } default: { NS_RUNTIMEABORT("not reached"); break;
--- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -3324,31 +3324,31 @@ ContentParent::RecvGetGraphicsFeatureSta bool ContentParent::RecvAddIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS) { nsresult rv; nsCOMPtr<nsIIdleService> idleService = do_GetService("@mozilla.org/widget/idleservice;1", &rv); NS_ENSURE_SUCCESS(rv, false); - nsRefPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver); + nsCOMPtr<ParentIdleListener> listener = new ParentIdleListener(this, aObserver); mIdleListeners.Put(aObserver, listener); idleService->AddIdleObserver(listener, aIdleTimeInS); return true; } bool ContentParent::RecvRemoveIdleObserver(const uint64_t& aObserver, const uint32_t& aIdleTimeInS) { nsresult rv; nsCOMPtr<nsIIdleService> idleService = do_GetService("@mozilla.org/widget/idleservice;1", &rv); NS_ENSURE_SUCCESS(rv, false); - nsRefPtr<ParentIdleListener> listener; + nsCOMPtr<ParentIdleListener> listener; bool found = mIdleListeners.Get(aObserver, &listener); if (found) { mIdleListeners.Remove(aObserver); idleService->RemoveIdleObserver(listener, aIdleTimeInS); } return true; }
--- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -580,17 +580,17 @@ private: bool mCalledCloseWithError; bool mCalledKillHard; friend class CrashReporterParent; nsRefPtr<nsConsoleService> mConsoleService; nsConsoleService* GetConsoleService(); - nsDataHashtable<nsUint64HashKey, nsRefPtr<ParentIdleListener> > mIdleListeners; + nsDataHashtable<nsUint64HashKey, nsCOMPtr<ParentIdleListener> > mIdleListeners; #ifdef MOZ_X11 // Dup of child's X socket, used to scope its resources to this // object instead of the child process's lifetime. ScopedClose mChildXSocketFdDup; #endif };
--- a/dom/plugins/base/nsNPAPIPluginInstance.h +++ b/dom/plugins/base/nsNPAPIPluginInstance.h @@ -321,17 +321,17 @@ protected: NPDrawingModel mDrawingModel; #ifdef MOZ_WIDGET_ANDROID uint32_t mANPDrawingModel; friend class PluginEventRunnable; - nsTArray<nsRefPtr<PluginEventRunnable>> mPostedEvents; + nsTArray<nsCOMPtr<PluginEventRunnable>> mPostedEvents; void PopPostedEvent(PluginEventRunnable* r); void OnSurfaceTextureFrameAvailable(); uint32_t mFullScreenOrientation; bool mWakeLocked; bool mFullScreen; bool mInverted;
--- a/dom/smil/nsSMILTimeValueSpec.h +++ b/dom/smil/nsSMILTimeValueSpec.h @@ -119,12 +119,12 @@ protected: } NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER private: nsSMILTimeValueSpec* mSpec; }; - nsRefPtr<EventListener> mEventListener; + nsCOMPtr<EventListener> mEventListener; }; #endif // NS_SMILTIMEVALUESPEC_H_
--- a/editor/composer/src/nsEditorSpellCheck.cpp +++ b/editor/composer/src/nsEditorSpellCheck.cpp @@ -139,17 +139,17 @@ public: nsCOMPtr<nsIEditorSpellCheckCallback> mCallback; uint32_t mGroup; nsString mRootContentLang; nsString mRootDocContentLang; nsString mDictionary; private: - nsRefPtr<nsEditorSpellCheck> mSpellCheck; + nsCOMPtr<nsEditorSpellCheck> mSpellCheck; }; NS_IMPL_ISUPPORTS1(DictionaryFetcher, nsIContentPrefCallback2) NS_IMETHODIMP DictionaryFetcher::Fetch(nsIEditor* aEditor) { NS_ENSURE_ARG_POINTER(aEditor);
--- a/embedding/components/find/src/nsFind.h +++ b/embedding/components/find/src/nsFind.h @@ -3,17 +3,16 @@ * 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 nsFind_h__ #define nsFind_h__ #include "nsIFind.h" -#include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsIDOMNode.h" #include "nsIDOMRange.h" #include "nsIContentIterator.h" #include "nsIWordBreaker.h" class nsIAtom; @@ -65,12 +64,12 @@ protected: bool aContinueOk); // Reset variables before returning -- don't hold any references. void ResetAll(); // The iterator we use to move through the document: nsresult InitIterator(nsIDOMNode* aStartNode, int32_t aStartOffset, nsIDOMNode* aEndNode, int32_t aEndOffset); - nsRefPtr<nsFindContentIterator> mIterator; + nsCOMPtr<nsFindContentIterator> mIterator; }; #endif // nsFind_h__
--- a/extensions/auth/nsAuthFactory.cpp +++ b/extensions/auth/nsAuthFactory.cpp @@ -1,15 +1,14 @@ /* 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/. */ #include "mozilla/ModuleUtils.h" #include "nsAuth.h" -#include "nsAutoPtr.h" //----------------------------------------------------------------------------- #define NS_HTTPNEGOTIATEAUTH_CID \ { /* 75c80fd0-accb-432c-af59-ec60668c3990 */ \ 0x75c80fd0, \ 0xaccb, \ 0x432c, \ @@ -108,17 +107,17 @@ nsKerbSSPIAuthConstructor(nsISupports *o #include "nsAuthSambaNTLM.h" static nsresult nsSambaNTLMAuthConstructor(nsISupports *outer, REFNSIID iid, void **result) { if (outer) return NS_ERROR_NO_AGGREGATION; - nsRefPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM(); + nsCOMPtr<nsAuthSambaNTLM> auth = new nsAuthSambaNTLM(); if (!auth) return NS_ERROR_OUT_OF_MEMORY; nsresult rv = auth->SpawnNTLMAuthHelper(); if (NS_FAILED(rv)) { // Failure here probably means that cached credentials were not available return rv; }
--- a/extensions/spellcheck/src/mozInlineSpellChecker.h +++ b/extensions/spellcheck/src/mozInlineSpellChecker.h @@ -166,17 +166,17 @@ private: // This number is incremented each time the spell checker is disabled so that // pending scheduled spell checks and UpdateCurrentDictionary calls can be // ignored when they finish. uint32_t mDisabledAsyncToken; // When mPendingSpellCheck is non-null, this is the callback passed when // it was initialized. - nsRefPtr<InitEditorSpellCheckCallback> mPendingInitEditorSpellCheckCallback; + nsCOMPtr<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. bool mNeedsCheckAfterNavigation; // Set when we have a pending mozInlineSpellResume which will check // the whole document. bool mFullSpellCheckScheduled;
--- a/gfx/layers/LayerScope.cpp +++ b/gfx/layers/LayerScope.cpp @@ -309,17 +309,17 @@ public: return (mHandlers.Length() != 0) ? true : false; } void AppendDebugData(DebugGLData *aDebugData); void DispatchDebugData(); private: nsTArray<nsRefPtr<LayerScopeWebSocketHandler> > mHandlers; nsCOMPtr<nsIThread> mDebugSenderThread; - nsRefPtr<DebugDataSender> mCurrentSender; + nsCOMPtr<DebugDataSender> mCurrentSender; nsCOMPtr<nsIServerSocket> mServerSocket; }; static StaticAutoPtr<LayerScopeWebSocketManager> gLayerScopeWebSocketManager; class DebugGLData : public LinkedListElement<DebugGLData> { public: typedef enum {
--- a/ipc/glue/BackgroundImpl.cpp +++ b/ipc/glue/BackgroundImpl.cpp @@ -1516,17 +1516,17 @@ ChildImpl::GetOrCreateForCurrentThread( if (NS_IsMainThread()) { if (NS_WARN_IF(!OpenProtocolOnMainThread(NS_GetCurrentThread()))) { return false; } return true; } - nsRefPtr<CreateActorRunnable> runnable = new CreateActorRunnable(); + nsCOMPtr<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; } return true; }
--- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -1037,17 +1037,17 @@ EndSwapDocShellsForDocument(nsIDocument* // Our docshell and view trees have been updated for the new hierarchy. // Now also update all nsDeviceContext::mWidget to that of the // container view in the new hierarchy. nsCOMPtr<nsIDocShell> ds = aDocument->GetDocShell(); if (ds) { nsCOMPtr<nsIContentViewer> cv; ds->GetContentViewer(getter_AddRefs(cv)); while (cv) { - nsRefPtr<nsPresContext> pc; + nsCOMPtr<nsPresContext> pc; cv->GetPresContext(getter_AddRefs(pc)); if (pc && pc->GetPresShell()) { pc->GetPresShell()->SetNeverPainting(ds->IsInvisible()); } nsDeviceContext* dc = pc ? pc->DeviceContext() : nullptr; if (dc) { nsView* v = cv->FindContainerView(); dc->Init(v ? v->GetNearestWidget(nullptr) : nullptr);
--- a/layout/inspector/nsFontFaceList.cpp +++ b/layout/inspector/nsFontFaceList.cpp @@ -79,17 +79,17 @@ nsFontFaceList::AddFontsFromTextRun(gfxT // if we have already listed this face, just make sure the match type is // recorded nsFontFace* existingFace = static_cast<nsFontFace*>(mFontFaces.GetWeak(fe)); if (existingFace) { existingFace->AddMatchType(iter.GetGlyphRun()->mMatchType); } else { // A new font entry we haven't seen before - nsRefPtr<nsFontFace> ff = + nsCOMPtr<nsFontFace> ff = new nsFontFace(fe, aTextRun->GetFontGroup(), iter.GetGlyphRun()->mMatchType); mFontFaces.Put(fe, ff); } } return NS_OK; }
--- a/layout/mathml/nsMathMLmactionFrame.h +++ b/layout/mathml/nsMathMLmactionFrame.h @@ -57,16 +57,16 @@ protected: nsMathMLmactionFrame(nsStyleContext* aContext) : nsMathMLSelectedFrame(aContext) {} virtual ~nsMathMLmactionFrame(); private: int32_t mActionType; int32_t mChildCount; int32_t mSelection; - nsRefPtr<MouseListener> mListener; + nsCOMPtr<MouseListener> mListener; // helper to return the frame for the attribute selection="number" nsIFrame* GetSelectedFrame() MOZ_OVERRIDE; }; #endif /* nsMathMLmactionFrame_h___ */
--- a/layout/style/MediaQueryList.h +++ b/layout/style/MediaQueryList.h @@ -6,16 +6,17 @@ /* implements DOM interface for querying and observing media queries */ #ifndef mozilla_dom_MediaQueryList_h #define mozilla_dom_MediaQueryList_h #include "nsISupports.h" #include "nsCycleCollectionParticipant.h" #include "nsAutoPtr.h" +#include "nsCOMPtr.h" #include "nsTArray.h" #include "prclist.h" #include "mozilla/Attributes.h" #include "nsWrapperCache.h" #include "mozilla/dom/MediaQueryListBinding.h" class nsPresContext; class nsMediaList; @@ -38,17 +39,17 @@ private: public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaQueryList) nsISupports* GetParentObject() const; struct HandleChangeData { nsRefPtr<MediaQueryList> mql; - nsRefPtr<mozilla::dom::MediaQueryListListener> callback; + nsCOMPtr<mozilla::dom::MediaQueryListListener> callback; }; typedef FallibleTArray< nsRefPtr<mozilla::dom::MediaQueryListListener> > CallbackList; typedef FallibleTArray<HandleChangeData> NotifyList; // Appends listeners that need notification to aListenersToNotify void MediumFeaturesChanged(NotifyList &aListenersToNotify);
--- a/media/mtransport/nriceresolver.cpp +++ b/media/mtransport/nriceresolver.cpp @@ -144,17 +144,17 @@ int NrIceResolver::resolve(void *obj, int NrIceResolver::resolve(nr_resolver_resource *resource, int (*cb)(void *cb_arg, nr_transport_addr *addr), void *cb_arg, void **handle) { int _status; MOZ_ASSERT(allocated_resolvers_ > 0); ASSERT_ON_THREAD(sts_thread_); - nsRefPtr<PendingResolution> pr; + nsCOMPtr<PendingResolution> pr; if (resource->transport_protocol != IPPROTO_UDP && resource->transport_protocol != IPPROTO_TCP) { MOZ_MTLOG(ML_ERROR, "Only UDP and TCP are is supported."); ABORT(R_NOT_FOUND); } pr = new PendingResolution(sts_thread_, resource->port? resource->port : 3478,
--- a/media/mtransport/transportlayerprsock.h +++ b/media/mtransport/transportlayerprsock.h @@ -104,17 +104,17 @@ class TransportLayerPrsock : public Tran TL_SET_STATE(TS_CLOSED); } void IsLocal(bool *aIsLocal) { // TODO(jesup): better check? Does it matter? (likely no) *aIsLocal = false; } PRFileDesc *fd_; - nsRefPtr<SocketHandler> handler_; + nsCOMPtr<SocketHandler> handler_; nsCOMPtr<nsISocketTransportService> stservice_; }; } // close namespace #endif
--- a/netwerk/base/src/BackgroundFileSaver.cpp +++ b/netwerk/base/src/BackgroundFileSaver.cpp @@ -77,17 +77,17 @@ public: } NS_IMETHODIMP Run() { return mSaver->NotifyTargetChange(mTarget); } private: - nsRefPtr<BackgroundFileSaver> mSaver; + nsCOMPtr<BackgroundFileSaver> mSaver; nsCOMPtr<nsIFile> mTarget; }; //////////////////////////////////////////////////////////////////////////////// //// BackgroundFileSaver uint32_t BackgroundFileSaver::sThreadCount = 0; uint32_t BackgroundFileSaver::sTelemetryMaxThreadCount = 0;
--- a/netwerk/base/src/nsUDPSocket.cpp +++ b/netwerk/base/src/nsUDPSocket.cpp @@ -347,17 +347,17 @@ nsUDPSocket::OnSocketReady(PRFileDesc *f net_ResolveSegmentParams(segsize, segcount); nsresult rv = NS_NewPipe2(getter_AddRefs(pipeIn), getter_AddRefs(pipeOut), true, true, segsize, segcount); if (NS_FAILED(rv)) { return; } - nsRefPtr<nsUDPOutputStream> os = new nsUDPOutputStream(this, mFD, prClientAddr); + nsCOMPtr<nsUDPOutputStream> os = new nsUDPOutputStream(this, mFD, prClientAddr); rv = NS_AsyncCopy(pipeIn, os, mSts, NS_ASYNCCOPY_VIA_READSEGMENTS, 1400); if (NS_FAILED(rv)) { return; } nsCOMPtr<nsIUDPMessage> message = new nsUDPMessage(&prClientAddr, pipeOut, data);
--- a/netwerk/cache/nsCacheEntryDescriptor.cpp +++ b/netwerk/cache/nsCacheEntryDescriptor.cpp @@ -59,17 +59,17 @@ public: // posted event will release the reference on the correct thread mListener = nullptr; } return NS_OK; } private: - nsRefPtr<nsCacheEntryDescriptor> mDescriptor; + nsCOMPtr<nsCacheEntryDescriptor> mDescriptor; nsICacheListener *mListener; nsCOMPtr<nsIThread> mThread; }; NS_IMPL_ISUPPORTS2(nsCacheEntryDescriptor, nsICacheEntryDescriptor, nsICacheEntryInfo)
--- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -1693,17 +1693,17 @@ private: nsresult FlushBuffer(); nsresult mStatus; PRFileDesc *mFD; char *mBuf; uint32_t mBufSize; int32_t mBufPos; - nsRefPtr<CacheHash> mHash; + nsCOMPtr<CacheHash> mHash; }; nsresult WriteLogHelper::AddEntry(CacheIndexEntry *aEntry) { nsresult rv; if (NS_FAILED(mStatus)) {
--- a/netwerk/test/TestUDPSocket.cpp +++ b/netwerk/test/TestUDPSocket.cpp @@ -208,27 +208,27 @@ main(int32_t argc, char *argv[]) // Create UDPSocket nsCOMPtr<nsIUDPSocket> server, client; server = do_CreateInstance("@mozilla.org/network/udp-socket;1", &rv); NS_ENSURE_SUCCESS(rv, -1); client = do_CreateInstance("@mozilla.org/network/udp-socket;1", &rv); NS_ENSURE_SUCCESS(rv, -1); // Create UDPServerListener to process UDP packets - nsRefPtr<UDPServerListener> serverListener = new UDPServerListener(); + nsCOMPtr<UDPServerListener> serverListener = new UDPServerListener(); // Bind server socket to 127.0.0.1 rv = server->Init(0, true); NS_ENSURE_SUCCESS(rv, -1); int32_t serverPort; server->GetPort(&serverPort); server->AsyncListen(serverListener); // Bind clinet on arbitrary port - nsRefPtr<UDPClientListener> clientListener = new UDPClientListener(); + nsCOMPtr<UDPClientListener> clientListener = new UDPClientListener(); client->Init(0, true); client->AsyncListen(clientListener); // Write data to server uint32_t count; const uint32_t data = REQUEST; phase = TEST_OUTPUT_STREAM;
--- a/parser/xml/src/nsSAXXMLReader.cpp +++ b/parser/xml/src/nsSAXXMLReader.cpp @@ -82,17 +82,17 @@ nsSAXXMLReader::HandleStartElement(const const char16_t **aAtts, uint32_t aAttsCount, int32_t aIndex, uint32_t aLineNumber) { if (!mContentHandler) return NS_OK; - nsRefPtr<nsSAXAttributes> atts = new nsSAXAttributes(); + nsCOMPtr<nsSAXAttributes> atts = new nsSAXAttributes(); if (!atts) return NS_ERROR_OUT_OF_MEMORY; nsAutoString uri, localName, qName; for (; *aAtts; aAtts += 2) { SplitExpatName(aAtts[0], uri, localName, qName); // XXX don't have attr type information NS_NAMED_LITERAL_STRING(cdataType, "CDATA"); // could support xmlns reporting, it's a standard SAX feature
--- a/security/manager/ssl/src/nsNSSCallbacks.cpp +++ b/security/manager/ssl/src/nsNSSCallbacks.cpp @@ -54,17 +54,17 @@ class nsHTTPDownloadEvent : public nsRun public: nsHTTPDownloadEvent(); ~nsHTTPDownloadEvent(); NS_IMETHOD Run(); nsNSSHttpRequestSession *mRequestSession; - nsRefPtr<nsHTTPListener> mListener; + nsCOMPtr<nsHTTPListener> mListener; bool mResponsibleForDoneSignal; TimeStamp mStartTime; }; nsHTTPDownloadEvent::nsHTTPDownloadEvent() :mResponsibleForDoneSignal(true) { } @@ -162,17 +162,17 @@ nsHTTPDownloadEvent::Run() mListener->mLoadGroup = nullptr; mListener->mLoadGroupOwnerThread = nullptr; } return NS_OK; } struct nsCancelHTTPDownloadEvent : nsRunnable { - nsRefPtr<nsHTTPListener> mListener; + nsCOMPtr<nsHTTPListener> mListener; NS_IMETHOD Run() { mListener->FreeLoadGroup(true); mListener = nullptr; return NS_OK; } };
--- a/security/manager/ssl/src/nsNSSCallbacks.h +++ b/security/manager/ssl/src/nsNSSCallbacks.h @@ -2,17 +2,16 @@ * * 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 _NSNSSCALLBACKS_H_ #define _NSNSSCALLBACKS_H_ -#include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "pk11func.h" #include "nspr.h" #include "ocspt.h" #include "nsIStreamLoader.h" #include "mozilla/CondVar.h" #include "mozilla/Mutex.h" #include "mozilla/Attributes.h" @@ -116,17 +115,17 @@ public: nsCString mRequestMethod; bool mHasPostData; nsCString mPostData; nsCString mPostContentType; PRIntervalTime mTimeoutInterval; - nsRefPtr<nsHTTPListener> mListener; + nsCOMPtr<nsHTTPListener> mListener; protected: nsNSSHttpRequestSession(); ~nsNSSHttpRequestSession(); SECStatus internal_send_receive_attempt(bool &retryable_error, PRPollDesc **pPollDesc, uint16_t *http_response_code,
--- a/storage/src/VacuumManager.cpp +++ b/storage/src/VacuumManager.cpp @@ -201,17 +201,17 @@ Vacuumer::execute() // vacuum, if they are executed in the same transaction. nsCOMPtr<mozIStorageAsyncStatement> pageSizeStmt; nsAutoCString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size = "); pageSizeQuery.AppendInt(expectedPageSize); rv = mDBConn->CreateAsyncStatement(pageSizeQuery, getter_AddRefs(pageSizeStmt)); NS_ENSURE_SUCCESS(rv, false); - nsRefPtr<BaseCallback> callback = new BaseCallback(); + nsCOMPtr<BaseCallback> callback = new BaseCallback(); nsCOMPtr<mozIStoragePendingStatement> ps; rv = pageSizeStmt->ExecuteAsync(callback, getter_AddRefs(ps)); NS_ENSURE_SUCCESS(rv, false); nsCOMPtr<mozIStorageAsyncStatement> stmt; rv = mDBConn->CreateAsyncStatement(NS_LITERAL_CSTRING( "VACUUM" ), getter_AddRefs(stmt)); @@ -370,17 +370,17 @@ VacuumManager::Observe(nsISupports *aSub // skipping some, since we run daily. So we use a starting index. static const char* kPrefName = PREF_VACUUM_BRANCH "index"; int32_t startIndex = Preferences::GetInt(kPrefName, 0); if (startIndex >= entries.Count()) { startIndex = 0; } int32_t index; for (index = startIndex; index < entries.Count(); ++index) { - nsRefPtr<Vacuumer> vacuum = new Vacuumer(entries[index]); + nsCOMPtr<Vacuumer> vacuum = new Vacuumer(entries[index]); // Only vacuum one database per day. if (vacuum->execute()) { break; } } DebugOnly<nsresult> rv = Preferences::SetInt(kPrefName, index); MOZ_ASSERT(NS_SUCCEEDED(rv), "Should be able to set a preference"); }
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.h +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.h @@ -76,17 +76,17 @@ private: // Close db connection and join the background thread if it exists. nsresult Shutdown(); // Check if the key is on a known-clean host. nsresult CheckClean(const nsACString &lookupKey, bool *clean); - nsRefPtr<nsUrlClassifierDBServiceWorker> mWorker; + nsCOMPtr<nsUrlClassifierDBServiceWorker> mWorker; nsCOMPtr<nsIUrlClassifierDBServiceWorker> mWorkerProxy; nsInterfaceHashtable<nsCStringHashKey, nsIUrlClassifierHashCompleter> mCompleters; // TRUE if the nsURIClassifier implementation should check for malware // uris on document loads. bool mCheckMalware;
--- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -45,17 +45,17 @@ using namespace mozilla; class nsToolkitProfile MOZ_FINAL : public nsIToolkitProfile { public: NS_DECL_ISUPPORTS NS_DECL_NSITOOLKITPROFILE friend class nsToolkitProfileService; - nsRefPtr<nsToolkitProfile> mNext; + nsCOMPtr<nsToolkitProfile> mNext; nsToolkitProfile *mPrev; ~nsToolkitProfile() { } private: nsToolkitProfile(const nsACString& aName, nsIFile* aRootDir, nsIFile* aLocalDir, @@ -80,17 +80,17 @@ public: nsresult Init(nsToolkitProfile* aProfile, nsIProfileUnlocker* *aUnlocker); nsresult Init(nsIFile* aDirectory, nsIFile* aLocalDirectory, nsIProfileUnlocker* *aUnlocker); nsToolkitProfileLock() { } ~nsToolkitProfileLock(); private: - nsRefPtr<nsToolkitProfile> mProfile; + nsCOMPtr<nsToolkitProfile> mProfile; nsCOMPtr<nsIFile> mDirectory; nsCOMPtr<nsIFile> mLocalDirectory; nsProfileLock mLock; }; class nsToolkitProfileFactory MOZ_FINAL : public nsIFactory { @@ -151,17 +151,17 @@ private: public: NS_DECL_ISUPPORTS NS_DECL_NSISIMPLEENUMERATOR ProfileEnumerator(nsToolkitProfile *first) { mCurrent = first; } private: ~ProfileEnumerator() { } - nsRefPtr<nsToolkitProfile> mCurrent; + nsCOMPtr<nsToolkitProfile> mCurrent; }; }; nsToolkitProfile::nsToolkitProfile(const nsACString& aName, nsIFile* aRootDir, nsIFile* aLocalDir, nsToolkitProfile* aPrev, bool aForExternalApp) : @@ -269,17 +269,17 @@ nsToolkitProfile::Remove(bool removeFile NS_IMETHODIMP nsToolkitProfile::Lock(nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult) { if (mLock) { NS_ADDREF(*aResult = mLock); return NS_OK; } - nsRefPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock(); + nsCOMPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock(); if (!lock) return NS_ERROR_OUT_OF_MEMORY; nsresult rv = lock->Init(this, aUnlocker); if (NS_FAILED(rv)) return rv; NS_ADDREF(*aResult = lock); return NS_OK; } @@ -590,17 +590,17 @@ nsToolkitProfileService::LockProfilePath { return NS_LockProfilePath(aDirectory, aLocalDirectory, nullptr, aResult); } nsresult NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath, nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult) { - nsRefPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock(); + nsCOMPtr<nsToolkitProfileLock> lock = new nsToolkitProfileLock(); if (!lock) return NS_ERROR_OUT_OF_MEMORY; nsresult rv = lock->Init(aPath, aTempPath, aUnlocker); if (NS_FAILED(rv)) return rv; NS_ADDREF(*aResult = lock); return NS_OK; }
--- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp +++ b/uriloader/exthandler/android/nsExternalSharingAppService.cpp @@ -47,14 +47,14 @@ nsExternalSharingAppService::GetSharingA return NS_OK; AndroidBridge::Bridge()->GetHandlersForMimeType(aMIMEType, array, nullptr, sendAction); array->GetLength(aLen); *aHandlers = static_cast<nsISharingHandlerApp**>(NS_Alloc(sizeof(nsISharingHandlerApp*) * *aLen)); for (uint32_t i = 0; i < *aLen; i++) { - rv = array->QueryElementAt(i, NS_GET_IID(nsISharingHandlerApp), + rv = array->QueryElementAt(i, nsISharingHandlerApp::GetIID(), (void**)(*aHandlers + i)); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; }
--- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -357,17 +357,17 @@ nsAppShell::ProcessNextNativeEvent(bool case AndroidGeckoEvent::THUMBNAIL: { if (!mBrowserApp) break; int32_t tabId = curEvent->MetaState(); const nsTArray<nsIntPoint>& points = curEvent->Points(); RefCountedJavaObject* buffer = curEvent->ByteBuffer(); - nsRefPtr<ThumbnailRunnable> sr = new ThumbnailRunnable(mBrowserApp, tabId, points, buffer); + nsCOMPtr<ThumbnailRunnable> sr = new ThumbnailRunnable(mBrowserApp, tabId, points, buffer); MessageLoop::current()->PostIdleTask(FROM_HERE, NewRunnableMethod(sr.get(), &ThumbnailRunnable::Run)); break; } case AndroidGeckoEvent::VIEWPORT: case AndroidGeckoEvent::BROADCAST: { if (curEvent->Characters().Length() == 0) break;
--- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -401,17 +401,17 @@ protected: nsIWidgetListener* mWidgetListener; nsIWidgetListener* mAttachedWidgetListener; nsDeviceContext* mContext; nsRefPtr<LayerManager> mLayerManager; nsRefPtr<LayerManager> mBasicLayerManager; nsRefPtr<CompositorChild> mCompositorChild; nsRefPtr<CompositorParent> mCompositorParent; - nsRefPtr<WidgetShutdownObserver> mShutdownObserver; + nsCOMPtr<WidgetShutdownObserver> mShutdownObserver; nscolor mBackground; nscolor mForeground; nsCursor mCursor; nsWindowType mWindowType; nsBorderStyle mBorderStyle; bool mUseLayersAcceleration; bool mForceLayersAcceleration; bool mTemporarilyUseBasicLayerManager;
--- a/xpcom/ds/nsINIParserImpl.cpp +++ b/xpcom/ds/nsINIParserImpl.cpp @@ -29,17 +29,17 @@ NS_IMPL_ISUPPORTS2(nsINIParserFactory, nsIFactory) NS_IMETHODIMP nsINIParserFactory::CreateINIParser(nsIFile* aINIFile, nsIINIParser* *aResult) { *aResult = nullptr; - nsRefPtr<nsINIParserImpl> p(new nsINIParserImpl()); + nsCOMPtr<nsINIParserImpl> p(new nsINIParserImpl()); if (!p) return NS_ERROR_OUT_OF_MEMORY; nsresult rv = p->Init(aINIFile); if (NS_SUCCEEDED(rv)) NS_ADDREF(*aResult = p);
--- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -118,17 +118,18 @@ typedef nsID nsIID; * merged on windows). Dummy should always be instantiated as "int". */ #define NS_DECLARE_STATIC_IID_ACCESSOR(the_iid) \ template <class Dummy> \ struct COMTypeInfo \ { \ static const nsIID kIID NS_HIDDEN; \ - }; + }; \ + static const nsIID& GetIID() {return COMTypeInfo<int>::kIID;} #define NS_DEFINE_STATIC_IID_ACCESSOR(the_interface, the_iid) \ template <class Dummy> \ const nsIID the_interface::COMTypeInfo<Dummy>::kIID NS_HIDDEN = the_iid; /** * A macro to build the static const CID accessor method */
--- a/xpcom/tests/TestCOMPtr.cpp +++ b/xpcom/tests/TestCOMPtr.cpp @@ -132,17 +132,17 @@ IFoo::Release() nsresult IFoo::QueryInterface( const nsIID& aIID, void** aResult ) { printf("IFoo@%p::QueryInterface()\n", static_cast<void*>(this)); nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(NS_GET_IID(IFoo)) ) + if ( aIID.Equals(GetIID()) ) rawPtr = this; else { nsID iid_of_ISupports = NS_ISUPPORTS_IID; if ( aIID.Equals(iid_of_ISupports) ) rawPtr = static_cast<nsISupports*>(this); else status = NS_ERROR_NO_INTERFACE; @@ -222,17 +222,17 @@ IBar::~IBar() nsresult IBar::QueryInterface( const nsID& aIID, void** aResult ) { printf("IBar@%p::QueryInterface()\n", static_cast<void*>(this)); nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(NS_GET_IID(IBar)) ) + if ( aIID.Equals(GetIID()) ) rawPtr = this; else if ( aIID.Equals(NS_GET_IID(IFoo)) ) rawPtr = static_cast<IFoo*>(this); else { nsID iid_of_ISupports = NS_ISUPPORTS_IID; if ( aIID.Equals(iid_of_ISupports) ) rawPtr = static_cast<nsISupports*>(this);
--- a/xpcom/tests/TestHashtables.cpp +++ b/xpcom/tests/TestHashtables.cpp @@ -276,17 +276,17 @@ IFoo::Release() nsresult IFoo::QueryInterface( const nsIID& aIID, void** aResult ) { printf("IFoo@%p::QueryInterface()\n", static_cast<void*>(this)); nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(NS_GET_IID(IFoo)) ) + if ( aIID.Equals(GetIID()) ) rawPtr = this; else { nsID iid_of_ISupports = NS_ISUPPORTS_IID; if ( aIID.Equals(iid_of_ISupports) ) rawPtr = static_cast<nsISupports*>(this); else status = NS_ERROR_NO_INTERFACE;
--- a/xpcom/tests/TestRefPtr.cpp +++ b/xpcom/tests/TestRefPtr.cpp @@ -133,17 +133,17 @@ Foo::Release() nsresult Foo::QueryInterface( const nsIID& aIID, void** aResult ) { printf("Foo@%p::QueryInterface()\n", static_cast<void*>(this)); nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(NS_GET_IID(Foo)) ) + if ( aIID.Equals(GetIID()) ) rawPtr = this; else { nsID iid_of_ISupports = NS_ISUPPORTS_IID; if ( aIID.Equals(iid_of_ISupports) ) rawPtr = static_cast<nsISupports*>(this); else status = NS_ERROR_NO_INTERFACE; @@ -223,17 +223,17 @@ Bar::~Bar() nsresult Bar::QueryInterface( const nsID& aIID, void** aResult ) { printf("Bar@%p::QueryInterface()\n", static_cast<void*>(this)); nsISupports* rawPtr = 0; nsresult status = NS_OK; - if ( aIID.Equals(NS_GET_IID(Bar)) ) + if ( aIID.Equals(GetIID()) ) rawPtr = this; else if ( aIID.Equals(NS_GET_IID(Foo)) ) rawPtr = static_cast<Foo*>(this); else { nsID iid_of_ISupports = NS_ISUPPORTS_IID; if ( aIID.Equals(iid_of_ISupports) ) rawPtr = static_cast<nsISupports*>(this);