Bug 1831065 - Part 1: Remove unused ErrorResult in dom/{abort,base} r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D177007
This commit is contained in:
Kagami Sascha Rosylight 2023-05-03 13:24:53 +00:00
Родитель 5b898edeed
Коммит 1925d5477f
19 изменённых файлов: 23 добавлений и 32 удалений

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

@ -138,9 +138,8 @@ JSObject* AbortSignal::WrapObject(JSContext* aCx,
return AbortSignal_Binding::Wrap(aCx, this, aGivenProto);
}
already_AddRefed<AbortSignal> AbortSignal::Abort(GlobalObject& aGlobal,
JS::Handle<JS::Value> aReason,
ErrorResult& aRv) {
already_AddRefed<AbortSignal> AbortSignal::Abort(
GlobalObject& aGlobal, JS::Handle<JS::Value> aReason) {
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<AbortSignal> abortSignal = new AbortSignal(global, true, aReason);

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

@ -41,8 +41,7 @@ class AbortSignal : public DOMEventTargetHelper,
IMPL_EVENT_HANDLER(abort);
static already_AddRefed<AbortSignal> Abort(GlobalObject& aGlobal,
JS::Handle<JS::Value> aReason,
ErrorResult& aRv);
JS::Handle<JS::Value> aReason);
static already_AddRefed<AbortSignal> Timeout(GlobalObject& aGlobal,
uint64_t aMilliseconds,

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

@ -164,7 +164,7 @@ void Attr::SetValue(const nsAString& aValue, ErrorResult& aRv) {
bool Attr::Specified() const { return true; }
Element* Attr::GetOwnerElement(ErrorResult& aRv) { return GetElement(); }
Element* Attr::GetOwnerElement() { return GetElement(); }
void Attr::GetNodeValueInternal(nsAString& aNodeValue) { GetValue(aNodeValue); }

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

@ -92,7 +92,7 @@ class Attr final : public nsINode {
// XPCOM GetPrefix() is OK
// XPCOM GetLocalName() is OK
Element* GetOwnerElement(ErrorResult& aRv);
Element* GetOwnerElement();
protected:
virtual Element* GetNameSpaceElement() override { return GetElement(); }

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

@ -150,8 +150,7 @@ class ChromeUtils {
const dom::CompileScriptOptionsDictionary& aOptions, ErrorResult& aRv);
static MozQueryInterface* GenerateQI(const GlobalObject& global,
const Sequence<JS::Value>& interfaces,
ErrorResult& aRv);
const Sequence<JS::Value>& interfaces);
static void WaiveXrays(GlobalObject& aGlobal, JS::Handle<JS::Value> aVal,
JS::MutableHandle<JS::Value> aRetval,

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

@ -8318,8 +8318,7 @@ static void RemoveAnonContentFromCanvas(AnonymousContent& aAnonContent,
container->RemoveChild(aAnonContent.ContentNode(), IgnoreErrors());
}
void Document::RemoveAnonymousContent(AnonymousContent& aContent,
ErrorResult& aRv) {
void Document::RemoveAnonymousContent(AnonymousContent& aContent) {
nsAutoScriptBlocker scriptBlocker;
auto index = mAnonymousContents.IndexOf(&aContent);
@ -10166,7 +10165,7 @@ nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) {
// Remove from ownerElement.
OwningNonNull<Attr> adoptedAttr = static_cast<Attr&>(*adoptedNode);
nsCOMPtr<Element> ownerElement = adoptedAttr->GetOwnerElement(rv);
nsCOMPtr<Element> ownerElement = adoptedAttr->GetOwnerElement();
if (rv.Failed()) {
return nullptr;
}

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

@ -1344,7 +1344,7 @@ class Document : public nsINode,
already_AddRefed<AnonymousContent> InsertAnonymousContent(
Element& aElement, bool aForce, ErrorResult& aError);
void RemoveAnonymousContent(AnonymousContent& aContent, ErrorResult& aError);
void RemoveAnonymousContent(AnonymousContent& aContent);
/**
* If aNode is a descendant of anonymous content inserted by
* InsertAnonymousContent, this method returns the root element of the

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

@ -29,8 +29,7 @@ static int CompareIIDs(const nsIID& aA, const nsIID& aB) {
/* static */
MozQueryInterface* ChromeUtils::GenerateQI(
const GlobalObject& aGlobal, const Sequence<JS::Value>& aInterfaces,
ErrorResult& aRv) {
const GlobalObject& aGlobal, const Sequence<JS::Value>& aInterfaces) {
JSContext* cx = aGlobal.Context();
nsTArray<nsIID> ifaces;

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

@ -79,7 +79,7 @@ static Text* LastLogicallyAdjacentTextNode(Text* aNode) {
} while (1); // Must run out of next siblings eventually!
}
void Text::GetWholeText(nsAString& aWholeText, ErrorResult& aRv) {
void Text::GetWholeText(nsAString& aWholeText) {
nsIContent* parent = GetParent();
// Handle parent-less nodes

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

@ -23,7 +23,7 @@ class Text : public CharacterData {
// WebIDL API
already_AddRefed<Text> SplitText(uint32_t aOffset, ErrorResult& rv);
void GetWholeText(nsAString& aWholeText, ErrorResult& rv);
void GetWholeText(nsAString& aWholeText);
static already_AddRefed<Text> Constructor(const GlobalObject& aGlobal,
const nsAString& aData,

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

@ -7496,7 +7496,7 @@ bool nsGlobalWindowInner::IsSecureContext() const {
return JS::GetIsSecureContext(realm);
}
External* nsGlobalWindowInner::GetExternal(ErrorResult& aRv) {
External* nsGlobalWindowInner::External() {
if (!mExternal) {
mExternal = new dom::External(ToSupports(this));
}
@ -7504,8 +7504,7 @@ External* nsGlobalWindowInner::GetExternal(ErrorResult& aRv) {
return mExternal;
}
void nsGlobalWindowInner::GetSidebar(OwningExternalOrWindowProxy& aResult,
ErrorResult& aRv) {
void nsGlobalWindowInner::GetSidebar(OwningExternalOrWindowProxy& aResult) {
// First check for a named frame named "sidebar"
RefPtr<BrowsingContext> domWindow = GetChildWindow(u"sidebar"_ns);
if (domWindow) {
@ -7513,7 +7512,7 @@ void nsGlobalWindowInner::GetSidebar(OwningExternalOrWindowProxy& aResult,
return;
}
RefPtr<External> external = GetExternal(aRv);
RefPtr<dom::External> external = External();
if (external) {
aResult.SetAsExternal() = external;
}

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

@ -662,9 +662,8 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
// https://w3c.github.io/webappsec-secure-contexts/#dom-window-issecurecontext
bool IsSecureContext() const;
void GetSidebar(mozilla::dom::OwningExternalOrWindowProxy& aResult,
mozilla::ErrorResult& aRv);
mozilla::dom::External* GetExternal(mozilla::ErrorResult& aRv);
void GetSidebar(mozilla::dom::OwningExternalOrWindowProxy& aResult);
mozilla::dom::External* External();
mozilla::dom::Worklet* GetPaintWorklet(mozilla::ErrorResult& aRv);

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

@ -405,7 +405,7 @@ partial namespace ChromeUtils {
* nsISupports is implicitly supported, and must not be included in the
* interface list.
*/
[Affects=Nothing, NewObject, Throws]
[Affects=Nothing, NewObject]
MozQueryInterface generateQI(sequence<any> interfaces);
/**

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

@ -9,7 +9,7 @@
[Exposed=*]
interface AbortSignal : EventTarget {
[NewObject, Throws] static AbortSignal abort(optional any reason);
[NewObject] static AbortSignal abort(optional any reason);
[Exposed=(Window,Worker), NewObject, Throws]
static AbortSignal timeout([EnforceRange] unsigned long long milliseconds);

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

@ -29,6 +29,5 @@ interface Attr : Node {
// Mozilla extensions
partial interface Attr {
[GetterThrows]
readonly attribute Element? ownerElement;
};

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

@ -528,7 +528,7 @@ partial interface Document {
* Removes the element inserted into the CanvasFrame given an AnonymousContent
* instance.
*/
[ChromeOnly, Throws]
[ChromeOnly]
undefined removeAnonymousContent(AnonymousContent aContent);
};

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

@ -17,7 +17,6 @@ interface Text : CharacterData {
[Throws]
Text splitText(unsigned long offset);
[Throws]
readonly attribute DOMString wholeText;
};

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

@ -247,7 +247,7 @@ typedef OfflineResourceList ApplicationCache;
[Pref="dom.window.clientinformation.enabled", BinaryName="Navigator"]
readonly attribute Navigator clientInformation;
[Replaceable, Throws] readonly attribute External external;
[Replaceable] readonly attribute External external;
[Throws, SecureContext, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
// user prompts
@ -592,7 +592,7 @@ partial interface Window {
// Mozilla extension
// Sidebar is deprecated and it will be removed in the next cycles. See bug 1640138.
partial interface Window {
[Replaceable, Throws, UseCounter, Pref="dom.window.sidebar.enabled"]
[Replaceable, UseCounter, Pref="dom.window.sidebar.enabled"]
readonly attribute (External or WindowProxy) sidebar;
};

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

@ -226,7 +226,7 @@ void AccessibleCaret::RemoveCaretElement(Document* aDocument) {
CaretElement().RemoveEventListener(u"touchstart"_ns, mDummyTouchListener,
false);
aDocument->RemoveAnonymousContent(*mCaretElementHolder, IgnoreErrors());
aDocument->RemoveAnonymousContent(*mCaretElementHolder);
}
void AccessibleCaret::ClearCachedData() {