mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 514280 Only use nsCOMPtr for interfaces r=bsmedberg
This commit is contained in:
parent
60238a9741
commit
a8a5decf6f
@ -797,7 +797,7 @@ nsDOMTemporaryFileBlob::CreateSlice(uint64_t aStart, uint64_t aLength,
|
||||
NS_IMETHODIMP
|
||||
nsDOMTemporaryFileBlob::GetInternalStream(nsIInputStream **aStream)
|
||||
{
|
||||
nsCOMPtr<nsTemporaryFileInputStream> stream =
|
||||
nsCOMPtr<nsIInputStream> stream =
|
||||
new nsTemporaryFileInputStream(mFileDescOwner, mStartPos, mStartPos + mLength);
|
||||
stream.forget(aStream);
|
||||
return NS_OK;
|
||||
|
@ -61,7 +61,7 @@ static bool GetIntPref(const char* aPref, int32_t* aResult)
|
||||
// can only be called on the main thread. Post a runnable and wait.
|
||||
NS_ENSURE_TRUE(aPref, false);
|
||||
NS_ENSURE_TRUE(aResult, false);
|
||||
nsCOMPtr<GetIntPrefEvent> event = new GetIntPrefEvent(aPref, aResult);
|
||||
nsCOMPtr<nsIRunnable> event = new GetIntPrefEvent(aPref, aResult);
|
||||
return NS_SUCCEEDED(NS_DispatchToMainThread(event, NS_DISPATCH_SYNC));
|
||||
}
|
||||
|
||||
|
@ -929,7 +929,7 @@ nsDocShell::Init()
|
||||
|
||||
// We want to hold a strong ref to the loadgroup, so it better hold a weak
|
||||
// ref to us... use an InterfaceRequestorProxy to do this.
|
||||
nsCOMPtr<InterfaceRequestorProxy> proxy =
|
||||
nsCOMPtr<nsIInterfaceRequestor> proxy =
|
||||
new InterfaceRequestorProxy(static_cast<nsIInterfaceRequestor*>
|
||||
(this));
|
||||
NS_ENSURE_TRUE(proxy, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsRefPtr<AudioChannelAgent> mAgent;
|
||||
nsCOMPtr<nsIAudioChannelAgent> mAgent;
|
||||
AudioChannelType mType;
|
||||
bool mWaitCallback;
|
||||
bool mRegistered;
|
||||
|
@ -550,14 +550,13 @@ DeviceStorageRequestParent::CreateFdEvent::CancelableRun()
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsRefPtr<nsRunnable> r;
|
||||
nsCOMPtr<nsIRunnable> r;
|
||||
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event
|
||||
= new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(event);
|
||||
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(r);
|
||||
}
|
||||
|
||||
FileDescriptor fileDescriptor;
|
||||
@ -593,7 +592,7 @@ DeviceStorageRequestParent::WriteFileEvent::CancelableRun()
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsRefPtr<nsRunnable> r;
|
||||
nsCOMPtr<nsIRunnable> r;
|
||||
|
||||
if (!mInputStream) {
|
||||
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_UNKNOWN);
|
||||
@ -603,9 +602,8 @@ DeviceStorageRequestParent::WriteFileEvent::CancelableRun()
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event
|
||||
= new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(event);
|
||||
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(r);
|
||||
}
|
||||
|
||||
nsresult rv = mFile->Write(mInputStream);
|
||||
@ -638,7 +636,7 @@ DeviceStorageRequestParent::DeleteFileEvent::CancelableRun()
|
||||
|
||||
mFile->Remove();
|
||||
|
||||
nsRefPtr<nsRunnable> r;
|
||||
nsCOMPtr<nsIRunnable> r;
|
||||
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
|
@ -1054,7 +1054,7 @@ DeviceStorageFile::Write(nsIInputStream* aInputStream)
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "created");
|
||||
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "created");
|
||||
rv = NS_DispatchToMainThread(iocomplete);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
@ -1114,7 +1114,7 @@ DeviceStorageFile::Write(InfallibleTArray<uint8_t>& aBits)
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "created");
|
||||
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "created");
|
||||
rv = NS_DispatchToMainThread(iocomplete);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
@ -1167,7 +1167,7 @@ DeviceStorageFile::Remove()
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "deleted");
|
||||
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "deleted");
|
||||
return NS_DispatchToMainThread(iocomplete);
|
||||
}
|
||||
|
||||
@ -1914,7 +1914,7 @@ public:
|
||||
bool check;
|
||||
mFile->mFile->IsDirectory(&check);
|
||||
if (!check) {
|
||||
nsCOMPtr<PostErrorEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostErrorEvent(mRequest.forget(),
|
||||
POST_ERROR_EVENT_FILE_NOT_ENUMERABLE);
|
||||
return NS_DispatchToMainThread(event);
|
||||
@ -1925,7 +1925,7 @@ public:
|
||||
= static_cast<nsDOMDeviceStorageCursor*>(mRequest.get());
|
||||
mFile->CollectFiles(cursor->mFiles, cursor->mSince);
|
||||
|
||||
nsCOMPtr<ContinueCursorEvent> event
|
||||
nsRefPtr<ContinueCursorEvent> event
|
||||
= new ContinueCursorEvent(mRequest.forget());
|
||||
event->Continue();
|
||||
|
||||
@ -2006,7 +2006,7 @@ nsDOMDeviceStorageCursor::GetElement(nsIDOMElement * *aRequestingElement)
|
||||
NS_IMETHODIMP
|
||||
nsDOMDeviceStorageCursor::Cancel()
|
||||
{
|
||||
nsCOMPtr<PostErrorEvent> event
|
||||
nsCOMPtr<nsIRunnable> event
|
||||
= new PostErrorEvent(this, POST_ERROR_EVENT_PERMISSION_DENIED);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
@ -2038,7 +2038,7 @@ nsDOMDeviceStorageCursor::Allow(JS::HandleValue aChoices)
|
||||
= do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
|
||||
MOZ_ASSERT(target);
|
||||
|
||||
nsCOMPtr<InitCursorEvent> event = new InitCursorEvent(this, mFile);
|
||||
nsCOMPtr<nsIRunnable> event = new InitCursorEvent(this, mFile);
|
||||
target->Dispatch(event, NS_DISPATCH_NORMAL);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2058,7 +2058,7 @@ nsDOMDeviceStorageCursor::Continue(ErrorResult& aRv)
|
||||
mDone = false;
|
||||
}
|
||||
|
||||
nsCOMPtr<ContinueCursorEvent> event = new ContinueCursorEvent(this);
|
||||
nsRefPtr<ContinueCursorEvent> event = new ContinueCursorEvent(this);
|
||||
event->Continue();
|
||||
|
||||
mOkToCallContinue = false;
|
||||
@ -2346,7 +2346,7 @@ public:
|
||||
bool check = false;
|
||||
dsFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
@ -2356,12 +2356,12 @@ public:
|
||||
if (NS_FAILED(rv)) {
|
||||
dsFile->mFile->Remove(false);
|
||||
|
||||
nsCOMPtr<PostErrorEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_UNKNOWN);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
||||
nsCOMPtr<PostResultEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostResultEvent(mRequest.forget(), fullPath);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
@ -2397,7 +2397,7 @@ public:
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_FILE_EXISTS);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
@ -2407,14 +2407,14 @@ public:
|
||||
if (NS_FAILED(rv)) {
|
||||
mFile->mFile->Remove(false);
|
||||
|
||||
nsCOMPtr<PostErrorEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_UNKNOWN);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
|
||||
nsString fullPath;
|
||||
mFile->GetFullPath(fullPath);
|
||||
nsCOMPtr<PostResultEvent> event =
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new PostResultEvent(mRequest.forget(), fullPath);
|
||||
return NS_DispatchToMainThread(event);
|
||||
}
|
||||
@ -2444,7 +2444,7 @@ public:
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsRefPtr<nsRunnable> r;
|
||||
nsCOMPtr<nsIRunnable> r;
|
||||
if (!mFile->mEditable) {
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
@ -2491,7 +2491,7 @@ public:
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
mFile->Remove();
|
||||
|
||||
nsRefPtr<nsRunnable> r;
|
||||
nsCOMPtr<nsIRunnable> r;
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
@ -2749,7 +2749,7 @@ public:
|
||||
|
||||
NS_IMETHOD Cancel()
|
||||
{
|
||||
nsCOMPtr<PostErrorEvent> event
|
||||
nsCOMPtr<nsIRunnable> event
|
||||
= new PostErrorEvent(mRequest.forget(),
|
||||
POST_ERROR_EVENT_PERMISSION_DENIED);
|
||||
return NS_DispatchToMainThread(event);
|
||||
|
@ -204,7 +204,7 @@ MediaPermissionRequest::GetTypes(nsIArray** aTypes)
|
||||
if (mAudio) {
|
||||
nsTArray<nsString> audioDeviceNames;
|
||||
CreateDeviceNameList(mAudioDevices, audioDeviceNames);
|
||||
nsCOMPtr<ContentPermissionType> AudioType =
|
||||
nsCOMPtr<nsISupports> AudioType =
|
||||
new ContentPermissionType(NS_LITERAL_CSTRING(AUDIO_PERMISSION_NAME),
|
||||
NS_LITERAL_CSTRING("unused"),
|
||||
audioDeviceNames);
|
||||
@ -213,7 +213,7 @@ MediaPermissionRequest::GetTypes(nsIArray** aTypes)
|
||||
if (mVideo) {
|
||||
nsTArray<nsString> videoDeviceNames;
|
||||
CreateDeviceNameList(mVideoDevices, videoDeviceNames);
|
||||
nsCOMPtr<ContentPermissionType> VideoType =
|
||||
nsCOMPtr<nsISupports> VideoType =
|
||||
new ContentPermissionType(NS_LITERAL_CSTRING(VIDEO_PERMISSION_NAME),
|
||||
NS_LITERAL_CSTRING("unused"),
|
||||
videoDeviceNames);
|
||||
|
@ -63,7 +63,7 @@ protected:
|
||||
|
||||
private:
|
||||
nsAutoPtr<mozilla::hal::SwitchObserver> mObserver;
|
||||
nsCOMPtr<AudioChannelAgent> mPhoneAudioAgent;
|
||||
nsCOMPtr<nsIAudioChannelAgent> mPhoneAudioAgent;
|
||||
#ifdef MOZ_B2G_RIL
|
||||
bool mMuteCallToRIL;
|
||||
// mIsMicMuted is only used for toggling mute call to RIL.
|
||||
|
@ -3565,7 +3565,7 @@ RasterImage::DecodeDoneWorker::NotifyFinishedSomeDecoding(RasterImage* image, De
|
||||
{
|
||||
image->mDecodingMonitor.AssertCurrentThreadIn();
|
||||
|
||||
nsCOMPtr<DecodeDoneWorker> worker = new DecodeDoneWorker(image, request);
|
||||
nsCOMPtr<nsIRunnable> worker = new DecodeDoneWorker(image, request);
|
||||
NS_DispatchToMainThread(worker);
|
||||
}
|
||||
|
||||
@ -3588,7 +3588,7 @@ RasterImage::FrameNeededWorker::FrameNeededWorker(RasterImage* image)
|
||||
void
|
||||
RasterImage::FrameNeededWorker::GetNewFrame(RasterImage* image)
|
||||
{
|
||||
nsCOMPtr<FrameNeededWorker> worker = new FrameNeededWorker(image);
|
||||
nsCOMPtr<nsIRunnable> worker = new FrameNeededWorker(image);
|
||||
NS_DispatchToMainThread(worker);
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ Seer::Init()
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
#ifdef MOZ_NUWA_PROCESS
|
||||
nsCOMPtr<NuwaMarkSeerThreadRunner> runner = new NuwaMarkSeerThreadRunner();
|
||||
nsCOMPtr<nsIRunnable> runner = new NuwaMarkSeerThreadRunner();
|
||||
mIOThread->Dispatch(runner, NS_DISPATCH_NORMAL);
|
||||
#endif
|
||||
|
||||
|
@ -707,7 +707,7 @@ nsCookieService::GetSingleton()
|
||||
nsCookieService::AppClearDataObserverInit()
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
|
||||
nsCOMPtr<AppClearDataObserver> obs = new AppClearDataObserver();
|
||||
nsCOMPtr<nsIObserver> obs = new AppClearDataObserver();
|
||||
observerService->AddObserver(obs, TOPIC_WEB_APP_CLEAR_DATA,
|
||||
/* holdsWeak= */ false);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ private:
|
||||
const KeyType mKeyType; // in
|
||||
nsMainThreadPtrHandle<nsIIdentityKeyGenCallback> mCallback; // in
|
||||
nsresult mRv; // out
|
||||
nsCOMPtr<KeyPair> mKeyPair; // out
|
||||
nsCOMPtr<nsIIdentityKeyPair> mKeyPair; // out
|
||||
|
||||
KeyGenRunnable(const KeyGenRunnable &) MOZ_DELETE;
|
||||
void operator=(const KeyGenRunnable &) MOZ_DELETE;
|
||||
|
@ -683,7 +683,7 @@ nsresult AsyncFaviconDataReady::OnFaviconDataNotAvailable(void)
|
||||
rv = NS_NewChannel(getter_AddRefs(channel), mozIconURI);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<myDownloadObserver> downloadObserver = new myDownloadObserver;
|
||||
nsCOMPtr<nsIDownloadObserver> downloadObserver = new myDownloadObserver;
|
||||
nsCOMPtr<nsIStreamListener> listener;
|
||||
rv = NS_NewDownloader(getter_AddRefs(listener), downloadObserver, icoFile);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -256,7 +256,7 @@ protected:
|
||||
Microsoft::WRL::ComPtr<FrameworkView> mView;
|
||||
nsTransparencyMode mTransparencyMode;
|
||||
nsIntRegion mInvalidatedRegion;
|
||||
nsCOMPtr<nsIdleService> mIdleService;
|
||||
nsCOMPtr<nsIIdleServiceInternal> mIdleService;
|
||||
HWND mWnd;
|
||||
static HWND sICoreHwnd;
|
||||
WNDPROC mMetroWndProc;
|
||||
|
Loading…
Reference in New Issue
Block a user