Backed out changeset 00f6bd7aa727 (bug 1755481) for causing multiple clipboard related failures CLOSED TREE

This commit is contained in:
Norisz Fay 2022-02-16 12:14:58 +02:00
Родитель 8e20699967
Коммит eef7d5c5ac
12 изменённых файлов: 28 добавлений и 33 удалений

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

@ -162,8 +162,7 @@ void DataTransferItem::FillInExternalData() {
return;
}
nsresult rv =
clipboard->GetSomeData(trans, mDataTransfer->ClipboardType());
nsresult rv = clipboard->GetData(trans, mDataTransfer->ClipboardType());
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}

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

@ -3319,7 +3319,7 @@ mozilla::ipc::IPCResult ContentParent::RecvGetClipboard(
trans->AddDataFlavor(aTypes[t].get());
}
clipboard->GetSomeData(trans, aWhichClipboard);
clipboard->GetData(trans, aWhichClipboard);
nsContentUtils::TransferableToIPCTransferable(trans, aDataTransfer, true,
nullptr, this);
return IPC_OK();

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

@ -2093,9 +2093,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
return NS_ERROR_FAILURE;
}
// Get the Data from the clipboard
rv = clipboard->GetSomeData(transferable, aClipboardType);
rv = clipboard->GetData(transferable, aClipboardType);
if (NS_FAILED(rv)) {
NS_WARNING("nsIClipboard::GetSomeData() failed");
NS_WARNING("nsIClipboard::GetData() failed");
return rv;
}
@ -2126,9 +2126,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rvIgnored),
"nsITransferable::AddDataFlavor(kHTMLContext) failed, but ignored");
rvIgnored = clipboard->GetSomeData(contextTransferable, aClipboardType);
rvIgnored = clipboard->GetData(contextTransferable, aClipboardType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetSomeData() failed, but ignored");
"nsIClipboard::GetData() failed, but ignored");
nsCOMPtr<nsISupports> contextDataObj;
rv = contextTransferable->GetTransferData(kHTMLContext,
getter_AddRefs(contextDataObj));
@ -2156,9 +2156,9 @@ nsresult HTMLEditor::PasteInternal(int32_t aClipboardType) {
NS_WARNING_ASSERTION(
NS_SUCCEEDED(rvIgnored),
"nsITransferable::AddDataFlavor(kHTMLInfo) failed, but ignored");
clipboard->GetSomeData(infoTransferable, aClipboardType);
clipboard->GetData(infoTransferable, aClipboardType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetSomeData() failed, but ignored");
"nsIClipboard::GetData() failed, but ignored");
nsCOMPtr<nsISupports> infoDataObj;
rv = infoTransferable->GetTransferData(kHTMLInfo,
getter_AddRefs(infoDataObj));
@ -2288,9 +2288,9 @@ nsresult HTMLEditor::PasteNoFormattingAsAction(int32_t aSelectionType,
}
// Get the Data from the clipboard
rv = clipboard->GetSomeData(transferable, aSelectionType);
rv = clipboard->GetData(transferable, aSelectionType);
if (NS_FAILED(rv)) {
NS_WARNING("nsIClipboard::GetSomeData() failed");
NS_WARNING("nsIClipboard::GetData() failed");
return rv;
}
@ -2543,9 +2543,9 @@ nsresult HTMLEditor::PasteAsPlaintextQuotation(int32_t aSelectionType) {
"nsITransferable::AddDataFlavor(kUnicodeMime) failed, but ignored");
// Get the Data from the clipboard
rvIgnored = clipboard->GetSomeData(transferable, aSelectionType);
rvIgnored = clipboard->GetData(transferable, aSelectionType);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
"nsIClipboard::GetSomeData() failed, but ignored");
"nsIClipboard::GetData() failed, but ignored");
// Now we ask the transferable for the data
// it still owns the data, we just have a pointer to it.

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

@ -517,7 +517,7 @@ nsresult TextEditor::PasteAsQuotationAsAction(int32_t aClipboardType,
}
// Get the Data from the clipboard
clipboard->GetSomeData(trans, aClipboardType);
clipboard->GetData(trans, aClipboardType);
// Now we ask the transferable for the data
// it still owns the data, we just have a pointer to it.

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

@ -206,9 +206,9 @@ nsresult TextEditor::PasteAsAction(int32_t aClipboardType,
return NS_OK; // XXX Why?
}
// Get the Data from the clipboard.
rv = clipboard->GetSomeData(transferable, aClipboardType);
rv = clipboard->GetData(transferable, aClipboardType);
if (NS_FAILED(rv)) {
NS_WARNING("nsIClipboard::GetSomeData() failed, but ignored");
NS_WARNING("nsIClipboard::GetData() failed, but ignored");
return NS_OK; // XXX Why?
}
// XXX Why don't we check this first?

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

@ -78,8 +78,7 @@ nsClipboard::SetData(nsITransferable* aTransferable, nsIClipboardOwner* anOwner,
}
NS_IMETHODIMP
nsClipboard::GetSomeData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
nsClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
if (aWhichClipboard != kGlobalClipboard) return NS_ERROR_NOT_IMPLEMENTED;
if (!jni::IsAvailable()) {

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

@ -743,7 +743,7 @@ nsClipboard::SetData(nsITransferable* aTransferable, nsIClipboardOwner* anOwner,
*
*/
NS_IMETHODIMP
nsClipboard::GetSomeData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
nsClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
NS_ASSERTION(aTransferable, "clipboard given a null transferable");
bool selectClipPresent;

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

@ -420,9 +420,8 @@ bool nsClipboard::FilterImportedFlavors(int32_t aWhichClipboard,
}
NS_IMETHODIMP
nsClipboard::GetSomeData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
LOGCLIP("nsClipboard::GetSomeData (%s)\n",
nsClipboard::GetData(nsITransferable* aTransferable, int32_t aWhichClipboard) {
LOGCLIP("nsClipboard::GetData (%s)\n",
aWhichClipboard == kSelectionClipboard ? "primary" : "clipboard");
// TODO: Ensure we don't re-enter here.

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

@ -46,8 +46,8 @@ HeadlessClipboard::SetData(nsITransferable* aTransferable,
}
NS_IMETHODIMP
HeadlessClipboard::GetSomeData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
HeadlessClipboard::GetData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
if (aWhichClipboard != kGlobalClipboard) {
return NS_ERROR_NOT_IMPLEMENTED;
}

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

@ -77,8 +77,8 @@ NS_IMETHODIMP nsBaseClipboard::SetData(nsITransferable* aTransferable,
* Gets the transferable object
*
*/
NS_IMETHODIMP nsBaseClipboard::GetSomeData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
NS_IMETHODIMP nsBaseClipboard::GetData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
NS_ASSERTION(aTransferable, "clipboard given a null transferable");
MOZ_LOG(sBaseClipboardLog, LogLevel::Debug, ("%s", __FUNCTION__));

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

@ -42,8 +42,8 @@ nsClipboardProxy::SetData(nsITransferable* aTransferable,
}
NS_IMETHODIMP
nsClipboardProxy::GetSomeData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
nsClipboardProxy::GetData(nsITransferable* aTransferable,
int32_t aWhichClipboard) {
nsTArray<nsCString> types;
aTransferable->FlavorsTransferableCanImport(types);

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

@ -33,16 +33,14 @@ interface nsIClipboard : nsISupports
in long aWhichClipboard ) ;
/**
* Filters the flavors aTransferable can import (see
* `nsITransferable::flavorsTransferableCanImport`) and gets the data for the
* first flavor. That data is set for aTransferable.
* Given a transferable, get the clipboard data.
*
* @param aTransferable The transferable
* @param aWhichClipboard Specifies the clipboard to which this operation applies.
* @result NS_OK if no errors
* @result NS_Ok if no errors
*/
void getSomeData ( in nsITransferable aTransferable, in long aWhichClipboard ) ;
void getData ( in nsITransferable aTransferable, in long aWhichClipboard ) ;
/**
* This empties the clipboard and notifies the clipboard owner.