diff --git a/dom/base/nsContentAreaDragDrop.cpp b/dom/base/nsContentAreaDragDrop.cpp index e2eb8dc82c94..898927e93ea0 100644 --- a/dom/base/nsContentAreaDragDrop.cpp +++ b/dom/base/nsContentAreaDragDrop.cpp @@ -341,11 +341,9 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable, file->Append(targetFilename); - bool isPrivate; - aTransferable->GetIsPrivateData(&isPrivate); + bool isPrivate = aTransferable->GetIsPrivateData(); - nsCOMPtr principal; - aTransferable->GetRequestingPrincipal(getter_AddRefs(principal)); + nsCOMPtr principal = aTransferable->GetRequestingPrincipal(); rv = SaveURIToFile(sourceURI, principal, file, isPrivate); // send back an nsIFile if (NS_SUCCEEDED(rv)) { diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index a3e2043eb5ef..4d4ffd055fd2 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -5833,12 +5833,11 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent) &ipcDataTransfer, false, nullptr, cp); - bool isPrivateData = false; - transferable->GetIsPrivateData(&isPrivateData); - nsCOMPtr requestingPrincipal; - transferable->GetRequestingPrincipal(getter_AddRefs(requestingPrincipal)); - nsContentPolicyType contentPolicyType = nsIContentPolicy::TYPE_OTHER; - transferable->GetContentPolicyType(&contentPolicyType); + bool isPrivateData = transferable->GetIsPrivateData(); + nsCOMPtr requestingPrincipal = + transferable->GetRequestingPrincipal(); + nsContentPolicyType contentPolicyType = + transferable->GetContentPolicyType(); remote->SendPasteTransferable(ipcDataTransfer, isPrivateData, IPC::Principal(requestingPrincipal), contentPolicyType); diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index ae3f24f1a5cb..dbbb829ec432 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -714,9 +714,9 @@ nsPrintJob::DoCommonPrint(bool aIsPrintPreview, NS_ENSURE_SUCCESS(rv, rv); printData->mPrintSettings->SetPrintSession(printSession); } else { - RefPtr remotePrintJob; - printSession->GetRemotePrintJob(getter_AddRefs(remotePrintJob)); - if (NS_SUCCEEDED(rv) && remotePrintJob) { + RefPtr remotePrintJob = + printSession->GetRemotePrintJob(); + if (remotePrintJob) { // If we have a RemotePrintJob add it to the print progress listeners, // so it can forward to the parent. printData->mPrintProgressListeners.AppendElement(remotePrintJob); @@ -877,9 +877,9 @@ nsPrintJob::DoCommonPrint(bool aIsPrintPreview, // If we haven't already added the RemotePrintJob as a listener, // add it now if there is one. if (!remotePrintJobListening) { - RefPtr remotePrintJob; - printSession->GetRemotePrintJob(getter_AddRefs(remotePrintJob)); - if (NS_SUCCEEDED(rv) && remotePrintJob) { + RefPtr remotePrintJob = + printSession->GetRemotePrintJob(); + if (remotePrintJob) { printData->mPrintProgressListeners.AppendElement( remotePrintJob); remotePrintJobListening = true; @@ -3502,9 +3502,9 @@ nsPrintJob::StartPagePrintTimer(const UniquePtr& aPO) nsCOMPtr printSession; nsresult rv = mPrt->mPrintSettings->GetPrintSession(getter_AddRefs(printSession)); if (NS_SUCCEEDED(rv) && printSession) { - RefPtr remotePrintJob; - printSession->GetRemotePrintJob(getter_AddRefs(remotePrintJob)); - if (NS_SUCCEEDED(rv) && remotePrintJob) { + RefPtr remotePrintJob = + printSession->GetRemotePrintJob(); + if (remotePrintJob) { remotePrintJob->SetPagePrintTimer(mPagePrintTimer); remotePrintJob->SetPrintJob(this); } diff --git a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp index 006c34dd2ff2..ac95c36c4083 100644 --- a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp +++ b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp @@ -158,12 +158,12 @@ nsPrintingProxy::ShowProgress(mozIDOMWindowProxy* parent, SendPPrintProgressDialogConstructor(dialogChild); // Get the RemotePrintJob if we have one available. - RefPtr remotePrintJob; + RefPtr remotePrintJob; if (printSettings) { nsCOMPtr printSession; nsresult rv = printSettings->GetPrintSession(getter_AddRefs(printSession)); if (NS_SUCCEEDED(rv) && printSession) { - printSession->GetRemotePrintJob(getter_AddRefs(remotePrintJob)); + remotePrintJob = printSession->GetRemotePrintJob(); } } diff --git a/widget/nsBaseDragService.cpp b/widget/nsBaseDragService.cpp index ffbae6ea509f..61e33b0d371f 100644 --- a/widget/nsBaseDragService.cpp +++ b/widget/nsBaseDragService.cpp @@ -62,7 +62,7 @@ nsBaseDragService::nsBaseDragService() mHasImage(false), mUserCancelled(false), mDragEventDispatchedToChildProcess(false), mDragAction(DRAGDROP_ACTION_NONE), - mDragActionFromChildProcess(DRAGDROP_ACTION_UNINITIALIZED), mTargetSize(0,0), + mDragActionFromChildProcess(DRAGDROP_ACTION_UNINITIALIZED), mContentPolicyType(nsIContentPolicy::TYPE_OTHER), mSuppressLevel(0), mInputSource(MouseEvent_Binding::MOZ_SOURCE_MOUSE) { @@ -119,22 +119,6 @@ nsBaseDragService::GetDragAction(uint32_t * anAction) return NS_OK; } -//--------------------------------------------------------- -NS_IMETHODIMP -nsBaseDragService::SetTargetSize(nsSize aDragTargetSize) -{ - mTargetSize = aDragTargetSize; - return NS_OK; -} - -//--------------------------------------------------------- -NS_IMETHODIMP -nsBaseDragService::GetTargetSize(nsSize * aDragTargetSize) -{ - *aDragTargetSize = mTargetSize; - return NS_OK; -} - //------------------------------------------------------------------------- NS_IMETHODIMP diff --git a/widget/nsBaseDragService.h b/widget/nsBaseDragService.h index 979a8511b73b..b3e1574c0c6b 100644 --- a/widget/nsBaseDragService.h +++ b/widget/nsBaseDragService.h @@ -163,7 +163,6 @@ protected: uint32_t mDragAction; uint32_t mDragActionFromChildProcess; - nsSize mTargetSize; nsCOMPtr mSourceNode; nsCString mTriggeringPrincipalURISpec; nsCOMPtr mSourceDocument; // the document at the drag source. will be null diff --git a/widget/nsClipboardProxy.cpp b/widget/nsClipboardProxy.cpp index 5ec68fc13b02..f900eaf83b73 100644 --- a/widget/nsClipboardProxy.cpp +++ b/widget/nsClipboardProxy.cpp @@ -33,12 +33,10 @@ nsClipboardProxy::SetData(nsITransferable *aTransferable, nsContentUtils::TransferableToIPCTransferable(aTransferable, &ipcDataTransfer, false, child, nullptr); - bool isPrivateData = false; - aTransferable->GetIsPrivateData(&isPrivateData); - nsCOMPtr requestingPrincipal; - aTransferable->GetRequestingPrincipal(getter_AddRefs(requestingPrincipal)); - nsContentPolicyType contentPolicyType = nsIContentPolicy::TYPE_OTHER; - aTransferable->GetContentPolicyType(&contentPolicyType); + bool isPrivateData = aTransferable->GetIsPrivateData(); + nsCOMPtr requestingPrincipal = + aTransferable->GetRequestingPrincipal(); + nsContentPolicyType contentPolicyType = aTransferable->GetContentPolicyType(); child->SendSetClipboard(ipcDataTransfer, isPrivateData, IPC::Principal(requestingPrincipal), contentPolicyType, aWhichClipboard); diff --git a/widget/nsDeviceContextSpecProxy.cpp b/widget/nsDeviceContextSpecProxy.cpp index 599178c7cfbe..a68f49bb1e90 100644 --- a/widget/nsDeviceContextSpecProxy.cpp +++ b/widget/nsDeviceContextSpecProxy.cpp @@ -60,8 +60,8 @@ nsDeviceContextSpecProxy::Init(nsIWidget* aWidget, return NS_ERROR_FAILURE; } - rv = mPrintSession->GetRemotePrintJob(getter_AddRefs(mRemotePrintJob)); - if (NS_FAILED(rv) || !mRemotePrintJob) { + mRemotePrintJob = mPrintSession->GetRemotePrintJob(); + if (!mRemotePrintJob) { NS_WARNING("We can't print via the parent without a RemotePrintJobChild."); return NS_ERROR_FAILURE; } diff --git a/widget/nsIDragSession.idl b/widget/nsIDragSession.idl index a6ee770443a0..eecae1a30574 100644 --- a/widget/nsIDragSession.idl +++ b/widget/nsIDragSession.idl @@ -37,12 +37,6 @@ interface nsIDragSession : nsISupports */ attribute unsigned long dragAction; - /** - * Sets the current width and height of the drag target area. - * It will contain the current size of the Frame that the drag is currently in - */ - [noscript] attribute nsSize targetSize; - /** * Get the number of items that were dropped */ diff --git a/widget/nsIPrintSession.idl b/widget/nsIPrintSession.idl index ca7541371c73..5f821b563c57 100644 --- a/widget/nsIPrintSession.idl +++ b/widget/nsIPrintSession.idl @@ -36,5 +36,5 @@ interface nsIPrintSession : nsISupports /** * The remote print job is used for printing via the parent process. */ - [noscript] attribute RemotePrintJobChildPtr remotePrintJob; + [notxpcom, nostdcall] attribute RemotePrintJobChildPtr remotePrintJob; }; diff --git a/widget/nsITransferable.idl b/widget/nsITransferable.idl index 098ab2192e29..43294c77ae92 100644 --- a/widget/nsITransferable.idl +++ b/widget/nsITransferable.idl @@ -188,7 +188,7 @@ interface nsITransferable : nsISupports * be avoided as much as possible because the value set may not reflect the status * of the context in which the transferable was created. */ - [noscript] attribute boolean isPrivateData; + [notxpcom, nostdcall] attribute boolean isPrivateData; /** * The principal of the source dom node this transferable was @@ -196,7 +196,7 @@ interface nsITransferable : nsISupports * Note, currently only used on Windows for network principal and * contentPolicyType information in clipboard and drag operations. */ - [noscript] attribute nsIPrincipal requestingPrincipal; - [noscript] attribute nsContentPolicyType contentPolicyType; + [notxpcom, nostdcall] attribute nsIPrincipal requestingPrincipal; + [notxpcom, nostdcall] attribute nsContentPolicyType contentPolicyType; }; diff --git a/widget/nsPrintSession.cpp b/widget/nsPrintSession.cpp index 9b334b424793..4a561820e02f 100644 --- a/widget/nsPrintSession.cpp +++ b/widget/nsPrintSession.cpp @@ -31,18 +31,14 @@ nsresult nsPrintSession::Init() return NS_OK; } -NS_IMETHODIMP -nsPrintSession::GetRemotePrintJob(RemotePrintJobChild** aRemotePrintJob) +RemotePrintJobChild* +nsPrintSession::GetRemotePrintJob() { - MOZ_ASSERT(aRemotePrintJob); - RefPtr result = mRemotePrintJob; - result.forget(aRemotePrintJob); - return NS_OK; + return mRemotePrintJob; } -NS_IMETHODIMP +void nsPrintSession::SetRemotePrintJob(RemotePrintJobChild* aRemotePrintJob) { mRemotePrintJob = aRemotePrintJob; - return NS_OK; } diff --git a/widget/nsPrintSettingsService.cpp b/widget/nsPrintSettingsService.cpp index ad50088a4808..760cfed5cf21 100644 --- a/widget/nsPrintSettingsService.cpp +++ b/widget/nsPrintSettingsService.cpp @@ -100,11 +100,7 @@ nsPrintSettingsService::SerializeToPrintData(nsIPrintSettings* aSettings, nsCOMPtr session; nsresult rv = aSettings->GetPrintSession(getter_AddRefs(session)); if (NS_SUCCEEDED(rv) && session) { - RefPtr remotePrintJob; - rv = session->GetRemotePrintJob(getter_AddRefs(remotePrintJob)); - if (NS_SUCCEEDED(rv)) { - data->remotePrintJobChild() = remotePrintJob; - } + data->remotePrintJobChild() = session->GetRemotePrintJob(); } aSettings->GetStartPageRange(&data->startPageRange()); diff --git a/widget/nsTransferable.cpp b/widget/nsTransferable.cpp index 80bbfb0de197..92d85cfa9473 100644 --- a/widget/nsTransferable.cpp +++ b/widget/nsTransferable.cpp @@ -516,57 +516,50 @@ nsTransferable::FlavorsTransferableCanExport(nsTArray& aFlavors) return NS_OK; } -NS_IMETHODIMP -nsTransferable::GetIsPrivateData(bool* aIsPrivateData) +bool +nsTransferable::GetIsPrivateData() { MOZ_ASSERT(mInitialized); - *aIsPrivateData = mPrivateData; - return NS_OK; + return mPrivateData; } -NS_IMETHODIMP +void nsTransferable::SetIsPrivateData(bool aIsPrivateData) { MOZ_ASSERT(mInitialized); mPrivateData = aIsPrivateData; - return NS_OK; } -NS_IMETHODIMP -nsTransferable::GetRequestingPrincipal(nsIPrincipal** aRequestingPrincipal) +nsIPrincipal* +nsTransferable::GetRequestingPrincipal() { MOZ_ASSERT(mInitialized); - nsCOMPtr principal = mRequestingPrincipal; - principal.forget(aRequestingPrincipal); - return NS_OK; + return mRequestingPrincipal; } -NS_IMETHODIMP +void nsTransferable::SetRequestingPrincipal(nsIPrincipal* aRequestingPrincipal) { MOZ_ASSERT(mInitialized); mRequestingPrincipal = aRequestingPrincipal; - return NS_OK; } -NS_IMETHODIMP -nsTransferable::GetContentPolicyType(nsContentPolicyType* aContentPolicyType) +nsContentPolicyType +nsTransferable::GetContentPolicyType() { MOZ_ASSERT(mInitialized); - *aContentPolicyType = mContentPolicyType; - return NS_OK; + return mContentPolicyType; } -NS_IMETHODIMP +void nsTransferable::SetContentPolicyType(nsContentPolicyType aContentPolicyType) { MOZ_ASSERT(mInitialized); mContentPolicyType = aContentPolicyType; - return NS_OK; } diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp index 52bcb0bb31b4..46161deeb146 100644 --- a/widget/windows/nsDataObj.cpp +++ b/widget/windows/nsDataObj.cpp @@ -343,12 +343,11 @@ HRESULT nsDataObj::CreateStream(IStream **outStream) pStream->AddRef(); // query the requestingPrincipal from the transferable and add it to the new channel - nsCOMPtr requestingPrincipal; - mTransferable->GetRequestingPrincipal(getter_AddRefs(requestingPrincipal)); + nsCOMPtr requestingPrincipal = + mTransferable->GetRequestingPrincipal(); MOZ_ASSERT(requestingPrincipal, "can not create channel without a principal"); - // default transferable content policy is nsIContentPolicy::TYPE_OTHER - uint32_t contentPolicyType = nsIContentPolicy::TYPE_OTHER; - mTransferable->GetContentPolicyType(&contentPolicyType); + + uint32_t contentPolicyType = mTransferable->GetContentPolicyType(); rv = pStream->Init(sourceURI, contentPolicyType, requestingPrincipal); if (NS_FAILED(rv)) {