Bug 1213815 - dom/webidl/HTMLHyperlinkElementUtils and URL don't need to throw exceptions as we did before, r=bz
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 23 Nov 2015 20:05:26 +0000
changeset 273807 50813b4c64c1355c895a78b372681c38a9391303
parent 273806 adc09292d0240b3e5a39e633106545cd00364f4e
child 273808 e3a5a2cdb40c196fefabfd8caf1b6099987f2033
push id68391
push useramarchesini@mozilla.com
push dateMon, 23 Nov 2015 20:05:45 +0000
treeherdermozilla-inbound@50813b4c64c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1213815
milestone45.0a1
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
Bug 1213815 - dom/webidl/HTMLHyperlinkElementUtils and URL don't need to throw exceptions as we did before, r=bz
dom/base/Link.cpp
dom/base/Link.h
dom/base/URL.cpp
dom/base/URL.h
dom/fetch/Request.cpp
dom/fetch/Response.cpp
dom/html/HTMLAnchorElement.cpp
dom/html/HTMLAnchorElement.h
dom/html/HTMLAreaElement.cpp
dom/html/HTMLAreaElement.h
dom/html/nsHTMLDNSPrefetch.cpp
dom/webidl/HTMLHyperlinkElementUtils.webidl
dom/webidl/URL.webidl
dom/workers/URL.cpp
dom/workers/URL.h
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -125,17 +125,17 @@ Link::GetURI() const
   Link *self = const_cast<Link *>(this);
   Element *element = self->mElement;
   mCachedURI = element->GetHrefURI();
 
   return mCachedURI;
 }
 
 void
-Link::SetProtocol(const nsAString &aProtocol, ErrorResult& aError)
+Link::SetProtocol(const nsAString &aProtocol)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   nsAString::const_iterator start, end;
@@ -144,97 +144,97 @@ Link::SetProtocol(const nsAString &aProt
   nsAString::const_iterator iter(start);
   (void)FindCharInReadable(':', iter, end);
   (void)uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
 
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetPassword(const nsAString &aPassword, ErrorResult& aError)
+Link::SetPassword(const nsAString &aPassword)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   uri->SetPassword(NS_ConvertUTF16toUTF8(aPassword));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetUsername(const nsAString &aUsername, ErrorResult& aError)
+Link::SetUsername(const nsAString &aUsername)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   uri->SetUsername(NS_ConvertUTF16toUTF8(aUsername));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetHost(const nsAString &aHost, ErrorResult& aError)
+Link::SetHost(const nsAString &aHost)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   (void)uri->SetHostPort(NS_ConvertUTF16toUTF8(aHost));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetHostname(const nsAString &aHostname, ErrorResult& aError)
+Link::SetHostname(const nsAString &aHostname)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   (void)uri->SetHost(NS_ConvertUTF16toUTF8(aHostname));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetPathname(const nsAString &aPathname, ErrorResult& aError)
+Link::SetPathname(const nsAString &aPathname)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   (void)url->SetFilePath(NS_ConvertUTF16toUTF8(aPathname));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetSearch(const nsAString& aSearch, ErrorResult& aError)
+Link::SetSearch(const nsAString& aSearch)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   (void)url->SetQuery(NS_ConvertUTF16toUTF8(aSearch));
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetPort(const nsAString &aPort, ErrorResult& aError)
+Link::SetPort(const nsAString &aPort)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   nsresult rv;
@@ -249,91 +249,90 @@ Link::SetPort(const nsAString &aPort, Er
     }
   }
 
   (void)uri->SetPort(port);
   SetHrefAttribute(uri);
 }
 
 void
-Link::SetHash(const nsAString &aHash, ErrorResult& aError)
+Link::SetHash(const nsAString &aHash)
 {
   nsCOMPtr<nsIURI> uri(GetURIToMutate());
   if (!uri) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   (void)uri->SetRef(NS_ConvertUTF16toUTF8(aHash));
   SetHrefAttribute(uri);
 }
 
 void
-Link::GetOrigin(nsAString &aOrigin, ErrorResult& aError)
+Link::GetOrigin(nsAString &aOrigin)
 {
   aOrigin.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     return;
   }
 
   nsString origin;
   nsContentUtils::GetUTFOrigin(uri, origin);
   aOrigin.Assign(origin);
 }
 
 void
-Link::GetProtocol(nsAString &_protocol, ErrorResult& aError)
+Link::GetProtocol(nsAString &_protocol)
 {
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     _protocol.AssignLiteral("http");
   }
   else {
     nsAutoCString scheme;
     (void)uri->GetScheme(scheme);
     CopyASCIItoUTF16(scheme, _protocol);
   }
   _protocol.Append(char16_t(':'));
-  return;
 }
 
 void
-Link::GetUsername(nsAString& aUsername, ErrorResult& aError)
+Link::GetUsername(nsAString& aUsername)
 {
   aUsername.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     return;
   }
 
   nsAutoCString username;
   uri->GetUsername(username);
   CopyASCIItoUTF16(username, aUsername);
 }
 
 void
-Link::GetPassword(nsAString &aPassword, ErrorResult& aError)
+Link::GetPassword(nsAString &aPassword)
 {
   aPassword.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     return;
   }
 
   nsAutoCString password;
   uri->GetPassword(password);
   CopyASCIItoUTF16(password, aPassword);
 }
 
 void
-Link::GetHost(nsAString &_host, ErrorResult& aError)
+Link::GetHost(nsAString &_host)
 {
   _host.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
     return;
   }
@@ -341,31 +340,31 @@ Link::GetHost(nsAString &_host, ErrorRes
   nsAutoCString hostport;
   nsresult rv = uri->GetHostPort(hostport);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(hostport, _host);
   }
 }
 
 void
-Link::GetHostname(nsAString &_hostname, ErrorResult& aError)
+Link::GetHostname(nsAString &_hostname)
 {
   _hostname.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
     return;
   }
 
   nsContentUtils::GetHostOrIPv6WithBrackets(uri, _hostname);
 }
 
 void
-Link::GetPathname(nsAString &_pathname, ErrorResult& aError)
+Link::GetPathname(nsAString &_pathname)
 {
   _pathname.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Do not throw!  Not having a valid URI or URL should result in an empty
     // string.
@@ -375,17 +374,17 @@ Link::GetPathname(nsAString &_pathname, 
   nsAutoCString file;
   nsresult rv = url->GetFilePath(file);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(file, _pathname);
   }
 }
 
 void
-Link::GetSearch(nsAString &_search, ErrorResult& aError)
+Link::GetSearch(nsAString &_search)
 {
   _search.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (!url) {
     // Do not throw!  Not having a valid URI or URL should result in an empty
     // string.
@@ -395,17 +394,17 @@ Link::GetSearch(nsAString &_search, Erro
   nsAutoCString search;
   nsresult rv = url->GetQuery(search);
   if (NS_SUCCEEDED(rv) && !search.IsEmpty()) {
     CopyUTF8toUTF16(NS_LITERAL_CSTRING("?") + search, _search);
   }
 }
 
 void
-Link::GetPort(nsAString &_port, ErrorResult& aError)
+Link::GetPort(nsAString &_port)
 {
   _port.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty string.
     return;
   }
@@ -417,17 +416,17 @@ Link::GetPort(nsAString &_port, ErrorRes
   if (NS_SUCCEEDED(rv) && port != -1) {
     nsAutoString portStr;
     portStr.AppendInt(port, 10);
     _port.Assign(portStr);
   }
 }
 
 void
-Link::GetHash(nsAString &_hash, ErrorResult& aError)
+Link::GetHash(nsAString &_hash)
 {
   _hash.Truncate();
 
   nsCOMPtr<nsIURI> uri(GetURI());
   if (!uri) {
     // Do not throw!  Not having a valid URI should result in an empty
     // string.
     return;
--- a/dom/base/Link.h
+++ b/dom/base/Link.h
@@ -51,35 +51,35 @@ public:
   nsIURI* GetURI() const;
   virtual nsIURI* GetURIExternal() const {
     return GetURI();
   }
 
   /**
    * Helper methods for modifying and obtaining parts of the URI of the Link.
    */
-  void SetProtocol(const nsAString &aProtocol, ErrorResult& aError);
-  void SetUsername(const nsAString &aUsername, ErrorResult& aError);
-  void SetPassword(const nsAString &aPassword, ErrorResult& aError);
-  void SetHost(const nsAString &aHost, ErrorResult& aError);
-  void SetHostname(const nsAString &aHostname, ErrorResult& aError);
-  void SetPathname(const nsAString &aPathname, ErrorResult& aError);
-  void SetSearch(const nsAString &aSearch, ErrorResult& aError);
-  void SetPort(const nsAString &aPort, ErrorResult& aError);
-  void SetHash(const nsAString &aHash, ErrorResult& aError);
-  void GetOrigin(nsAString &aOrigin, ErrorResult& aError);
-  void GetProtocol(nsAString &_protocol, ErrorResult& aError);
-  void GetUsername(nsAString &aUsername, ErrorResult& aError);
-  void GetPassword(nsAString &aPassword, ErrorResult& aError);
-  void GetHost(nsAString &_host, ErrorResult& aError);
-  void GetHostname(nsAString &_hostname, ErrorResult& aError);
-  void GetPathname(nsAString &_pathname, ErrorResult& aError);
-  void GetSearch(nsAString &_search, ErrorResult& aError);
-  void GetPort(nsAString &_port, ErrorResult& aError);
-  void GetHash(nsAString &_hash, ErrorResult& aError);
+  void SetProtocol(const nsAString &aProtocol);
+  void SetUsername(const nsAString &aUsername);
+  void SetPassword(const nsAString &aPassword);
+  void SetHost(const nsAString &aHost);
+  void SetHostname(const nsAString &aHostname);
+  void SetPathname(const nsAString &aPathname);
+  void SetSearch(const nsAString &aSearch);
+  void SetPort(const nsAString &aPort);
+  void SetHash(const nsAString &aHash);
+  void GetOrigin(nsAString &aOrigin);
+  void GetProtocol(nsAString &_protocol);
+  void GetUsername(nsAString &aUsername);
+  void GetPassword(nsAString &aPassword);
+  void GetHost(nsAString &_host);
+  void GetHostname(nsAString &_hostname);
+  void GetPathname(nsAString &_pathname);
+  void GetSearch(nsAString &_search);
+  void GetPort(nsAString &_port);
+  void GetHash(nsAString &_hash);
 
   /**
    * Invalidates any link caching, and resets the state to the default.
    *
    * @param aNotify
    *        true if ResetLinkState should notify the owning document about style
    *        changes or false if it should not.
    */
--- a/dom/base/URL.cpp
+++ b/dom/base/URL.cpp
@@ -198,17 +198,17 @@ URL::RevokeObjectURL(const GlobalObject&
   if (urlPrincipal && principal->Subsumes(urlPrincipal)) {
     nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
     global->UnregisterHostObjectURI(asciiurl);
     nsHostObjectProtocolHandler::RemoveDataEntry(asciiurl);
   }
 }
 
 void
-URL::GetHref(nsAString& aHref, ErrorResult& aRv) const
+URL::GetHref(nsAString& aHref) const
 {
   aHref.Truncate();
 
   nsAutoCString href;
   nsresult rv = mURI->GetSpec(href);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(href, aHref);
   }
@@ -233,35 +233,35 @@ URL::SetHref(const nsAString& aHref, Err
     return;
   }
 
   mURI = uri;
   UpdateURLSearchParams();
 }
 
 void
-URL::GetOrigin(nsAString& aOrigin, ErrorResult& aRv) const
+URL::GetOrigin(nsAString& aOrigin) const
 {
   nsContentUtils::GetUTFOrigin(mURI, aOrigin);
 }
 
 void
-URL::GetProtocol(nsAString& aProtocol, ErrorResult& aRv) const
+URL::GetProtocol(nsAString& aProtocol) const
 {
   nsAutoCString protocol;
   if (NS_SUCCEEDED(mURI->GetScheme(protocol))) {
     aProtocol.Truncate();
   }
 
   CopyASCIItoUTF16(protocol, aProtocol);
   aProtocol.Append(char16_t(':'));
 }
 
 void
-URL::SetProtocol(const nsAString& aProtocol, ErrorResult& aRv)
+URL::SetProtocol(const nsAString& aProtocol)
 {
   nsAString::const_iterator start, end;
   aProtocol.BeginReading(start);
   aProtocol.EndReading(end);
   nsAString::const_iterator iter(start);
 
   FindCharInReadable(':', iter, end);
 
@@ -298,47 +298,47 @@ URL::SetProtocol(const nsAString& aProto
   value.Truncate();               \
   nsAutoCString tmp;              \
   nsresult rv = mURI->func(tmp);  \
   if (NS_SUCCEEDED(rv)) {         \
     CopyUTF8toUTF16(tmp, value);  \
   }
 
 void
-URL::GetUsername(nsAString& aUsername, ErrorResult& aRv) const
+URL::GetUsername(nsAString& aUsername) const
 {
   URL_GETTER(aUsername, GetUsername);
 }
 
 void
-URL::SetUsername(const nsAString& aUsername, ErrorResult& aRv)
+URL::SetUsername(const nsAString& aUsername)
 {
   mURI->SetUsername(NS_ConvertUTF16toUTF8(aUsername));
 }
 
 void
-URL::GetPassword(nsAString& aPassword, ErrorResult& aRv) const
+URL::GetPassword(nsAString& aPassword) const
 {
   URL_GETTER(aPassword, GetPassword);
 }
 
 void
-URL::SetPassword(const nsAString& aPassword, ErrorResult& aRv)
+URL::SetPassword(const nsAString& aPassword)
 {
   mURI->SetPassword(NS_ConvertUTF16toUTF8(aPassword));
 }
 
 void
-URL::GetHost(nsAString& aHost, ErrorResult& aRv) const
+URL::GetHost(nsAString& aHost) const
 {
   URL_GETTER(aHost, GetHostPort);
 }
 
 void
-URL::SetHost(const nsAString& aHost, ErrorResult& aRv)
+URL::SetHost(const nsAString& aHost)
 {
   mURI->SetHostPort(NS_ConvertUTF16toUTF8(aHost));
 }
 
 void
 URL::URLSearchParamsUpdated(URLSearchParams* aSearchParams)
 {
   MOZ_ASSERT(mSearchParams);
@@ -364,46 +364,46 @@ URL::UpdateURLSearchParams()
       NS_WARNING("Failed to get the query from a nsIURL.");
     }
   }
 
   mSearchParams->ParseInput(search);
 }
 
 void
-URL::GetHostname(nsAString& aHostname, ErrorResult& aRv) const
+URL::GetHostname(nsAString& aHostname) const
 {
   aHostname.Truncate();
   nsContentUtils::GetHostOrIPv6WithBrackets(mURI, aHostname);
 }
 
 void
-URL::SetHostname(const nsAString& aHostname, ErrorResult& aRv)
+URL::SetHostname(const nsAString& aHostname)
 {
   // nsStandardURL returns NS_ERROR_UNEXPECTED for an empty hostname
   // The return code is silently ignored
   mURI->SetHost(NS_ConvertUTF16toUTF8(aHostname));
 }
 
 void
-URL::GetPort(nsAString& aPort, ErrorResult& aRv) const
+URL::GetPort(nsAString& aPort) const
 {
   aPort.Truncate();
 
   int32_t port;
   nsresult rv = mURI->GetPort(&port);
   if (NS_SUCCEEDED(rv) && port != -1) {
     nsAutoString portStr;
     portStr.AppendInt(port, 10);
     aPort.Assign(portStr);
   }
 }
 
 void
-URL::SetPort(const nsAString& aPort, ErrorResult& aRv)
+URL::SetPort(const nsAString& aPort)
 {
   nsresult rv;
   nsAutoString portStr(aPort);
   int32_t port = -1;
 
   // nsIURI uses -1 as default value.
   if (!portStr.IsEmpty()) {
     port = portStr.ToInteger(&rv);
@@ -411,17 +411,17 @@ URL::SetPort(const nsAString& aPort, Err
       return;
     }
   }
 
   mURI->SetPort(port);
 }
 
 void
-URL::GetPathname(nsAString& aPathname, ErrorResult& aRv) const
+URL::GetPathname(nsAString& aPathname) const
 {
   aPathname.Truncate();
 
   nsCOMPtr<nsIURL> url(do_QueryInterface(mURI));
   if (!url) {
     nsAutoCString path;
     nsresult rv = mURI->GetPath(path);
     if (NS_FAILED(rv)){
@@ -437,29 +437,29 @@ URL::GetPathname(nsAString& aPathname, E
   nsAutoCString file;
   nsresult rv = url->GetFilePath(file);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(file, aPathname);
   }
 }
 
 void
-URL::SetPathname(const nsAString& aPathname, ErrorResult& aRv)
+URL::SetPathname(const nsAString& aPathname)
 {
   nsCOMPtr<nsIURL> url(do_QueryInterface(mURI));
   if (!url) {
     // Ignore failures to be compatible with NS4.
     return;
   }
 
   url->SetFilePath(NS_ConvertUTF16toUTF8(aPathname));
 }
 
 void
-URL::GetSearch(nsAString& aSearch, ErrorResult& aRv) const
+URL::GetSearch(nsAString& aSearch) const
 {
   aSearch.Truncate();
 
   nsCOMPtr<nsIURL> url(do_QueryInterface(mURI));
   if (!url) {
     // Do not throw!  Not having a valid URI or URL should result in an empty
     // string.
     return;
@@ -468,17 +468,17 @@ URL::GetSearch(nsAString& aSearch, Error
   nsAutoCString search;
   nsresult rv = url->GetQuery(search);
   if (NS_SUCCEEDED(rv) && !search.IsEmpty()) {
     CopyUTF8toUTF16(NS_LITERAL_CSTRING("?") + search, aSearch);
   }
 }
 
 void
-URL::SetSearch(const nsAString& aSearch, ErrorResult& aRv)
+URL::SetSearch(const nsAString& aSearch)
 {
   SetSearchInternal(aSearch);
   UpdateURLSearchParams();
 }
 
 void
 URL::SetSearchInternal(const nsAString& aSearch)
 {
@@ -494,33 +494,33 @@ URL::SetSearchInternal(const nsAString& 
 URLSearchParams*
 URL::SearchParams()
 {
   CreateSearchParamsIfNeeded();
   return mSearchParams;
 }
 
 void
-URL::GetHash(nsAString& aHash, ErrorResult& aRv) const
+URL::GetHash(nsAString& aHash) const
 {
   aHash.Truncate();
 
   nsAutoCString ref;
   nsresult rv = mURI->GetRef(ref);
   if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
     aHash.Assign(char16_t('#'));
     if (nsContentUtils::GettersDecodeURLHash()) {
       NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
     }
     AppendUTF8toUTF16(ref, aHash);
   }
 }
 
 void
-URL::SetHash(const nsAString& aHash, ErrorResult& aRv)
+URL::SetHash(const nsAString& aHash)
 {
   mURI->SetRef(NS_ConvertUTF16toUTF8(aHash));
 }
 
 bool IsChromeURI(nsIURI* aURI)
 {
   bool isChrome = false;
   if (NS_SUCCEEDED(aURI->SchemeIs("chrome", &isChrome)))
--- a/dom/base/URL.h
+++ b/dom/base/URL.h
@@ -83,63 +83,63 @@ public:
                               MediaSource& aSource,
                               const objectURLOptions& aOptions,
                               nsAString& aResult,
                               ErrorResult& aError);
   static void RevokeObjectURL(const GlobalObject& aGlobal,
                               const nsAString& aURL,
                               ErrorResult& aRv);
 
-  void GetHref(nsAString& aHref, ErrorResult& aRv) const;
+  void GetHref(nsAString& aHref) const;
 
   void SetHref(const nsAString& aHref, ErrorResult& aRv);
 
-  void GetOrigin(nsAString& aOrigin, ErrorResult& aRv) const;
+  void GetOrigin(nsAString& aOrigin) const;
 
-  void GetProtocol(nsAString& aProtocol, ErrorResult& aRv) const;
+  void GetProtocol(nsAString& aProtocol) const;
 
-  void SetProtocol(const nsAString& aProtocol, ErrorResult& aRv);
+  void SetProtocol(const nsAString& aProtocol);
 
-  void GetUsername(nsAString& aUsername, ErrorResult& aRv) const;
+  void GetUsername(nsAString& aUsername) const;
 
-  void SetUsername(const nsAString& aUsername, ErrorResult& aRv);
+  void SetUsername(const nsAString& aUsername);
 
-  void GetPassword(nsAString& aPassword, ErrorResult& aRv) const;
+  void GetPassword(nsAString& aPassword) const;
 
-  void SetPassword(const nsAString& aPassword, ErrorResult& aRv);
+  void SetPassword(const nsAString& aPassword);
 
-  void GetHost(nsAString& aHost, ErrorResult& aRv) const;
+  void GetHost(nsAString& aHost) const;
 
-  void SetHost(const nsAString& aHost, ErrorResult& aRv);
+  void SetHost(const nsAString& aHost);
 
-  void GetHostname(nsAString& aHostname, ErrorResult& aRv) const;
+  void GetHostname(nsAString& aHostname) const;
 
-  void SetHostname(const nsAString& aHostname, ErrorResult& aRv);
+  void SetHostname(const nsAString& aHostname);
 
-  void GetPort(nsAString& aPort, ErrorResult& aRv) const;
+  void GetPort(nsAString& aPort) const;
 
-  void SetPort(const nsAString& aPort, ErrorResult& aRv);
+  void SetPort(const nsAString& aPort);
 
-  void GetPathname(nsAString& aPathname, ErrorResult& aRv) const;
+  void GetPathname(nsAString& aPathname) const;
 
-  void SetPathname(const nsAString& aPathname, ErrorResult& aRv);
+  void SetPathname(const nsAString& aPathname);
 
-  void GetSearch(nsAString& aRetval, ErrorResult& aRv) const;
+  void GetSearch(nsAString& aRetval) const;
 
-  void SetSearch(const nsAString& aArg, ErrorResult& aRv);
+  void SetSearch(const nsAString& aArg);
 
   URLSearchParams* SearchParams();
 
-  void GetHash(nsAString& aRetval, ErrorResult& aRv) const;
+  void GetHash(nsAString& aRetval) const;
 
-  void SetHash(const nsAString& aArg, ErrorResult& aRv);
+  void SetHash(const nsAString& aArg);
 
-  void Stringify(nsAString& aRetval, ErrorResult& aRv) const
+  void Stringify(nsAString& aRetval) const
   {
-    GetHref(aRetval, aRv);
+    GetHref(aRetval);
   }
 
   // URLSearchParamsObserver
   void URLSearchParamsUpdated(URLSearchParams* aSearchParams) override;
 
 private:
   nsIURI* GetURI() const
   {
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -183,41 +183,28 @@ GetRequestURLFromWorker(const GlobalObje
   RefPtr<workers::URL> url =
     workers::URL::Constructor(aGlobal, aInput, baseURL, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     aRv.ThrowTypeError<MSG_INVALID_URL>(aInput);
     return;
   }
 
   nsString username;
-  url->GetUsername(username, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
+  url->GetUsername(username);
 
   nsString password;
-  url->GetPassword(password, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
+  url->GetPassword(password);
 
   if (!username.IsEmpty() || !password.IsEmpty()) {
     aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(aInput);
     return;
   }
 
-  url->SetHash(EmptyString(), aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
-
-  url->Stringify(aRequestURL, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
+  url->SetHash(EmptyString());
+  url->Stringify(aRequestURL);
 }
 
 } // namespace
 
 /*static*/ already_AddRefed<Request>
 Request::Constructor(const GlobalObject& aGlobal,
                      const RequestOrUSVString& aInput,
                      const RequestInit& aInit, ErrorResult& aRv)
--- a/dom/fetch/Response.cpp
+++ b/dom/fetch/Response.cpp
@@ -87,21 +87,17 @@ Response::Redirect(const GlobalObject& a
 
     NS_ConvertUTF8toUTF16 baseURL(worker->GetLocationInfo().mHref);
     RefPtr<workers::URL> url =
       workers::URL::Constructor(aGlobal, aUrl, baseURL, aRv);
     if (aRv.Failed()) {
       return nullptr;
     }
 
-    url->Stringify(parsedURL, aRv);
-  }
-
-  if (aRv.Failed()) {
-    return nullptr;
+    url->Stringify(parsedURL);
   }
 
   if (aStatus != 301 && aStatus != 302 && aStatus != 303 && aStatus != 307 && aStatus != 308) {
     aRv.ThrowRangeError<MSG_INVALID_REDIRECT_STATUSCODE_ERROR>();
     return nullptr;
   }
 
   Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams> body;
--- a/dom/html/HTMLAnchorElement.cpp
+++ b/dom/html/HTMLAnchorElement.cpp
@@ -317,27 +317,23 @@ HTMLAnchorElement::RelList()
   }
   return mRelList;
 }
 
 #define IMPL_URI_PART(_part)                                 \
   NS_IMETHODIMP                                              \
   HTMLAnchorElement::Get##_part(nsAString& a##_part)         \
   {                                                          \
-    ErrorResult rv;                                          \
-    Link::Get##_part(a##_part, rv);                          \
-    MOZ_ASSERT(!rv.Failed());                                \
+    Link::Get##_part(a##_part);                              \
     return NS_OK;                                            \
   }                                                          \
   NS_IMETHODIMP                                              \
   HTMLAnchorElement::Set##_part(const nsAString& a##_part)   \
   {                                                          \
-    ErrorResult rv;                                          \
-    Link::Set##_part(a##_part, rv);                          \
-    MOZ_ASSERT(!rv.Failed());                                \
+    Link::Set##_part(a##_part);                              \
     return NS_OK;                                            \
   }
 
 IMPL_URI_PART(Protocol)
 IMPL_URI_PART(Host)
 IMPL_URI_PART(Hostname)
 IMPL_URI_PART(Pathname)
 IMPL_URI_PART(Search)
--- a/dom/html/HTMLAnchorElement.h
+++ b/dom/html/HTMLAnchorElement.h
@@ -84,20 +84,18 @@ public:
 
   virtual EventStates IntrinsicState() const override;
 
   virtual void OnDNSPrefetchDeferred() override;
   virtual void OnDNSPrefetchRequested() override;
   virtual bool HasDeferredDNSPrefetchRequest() override;
 
   // WebIDL API
-  void GetHref(nsAString& aValue, ErrorResult& rv)
-  {
-    GetHTMLURIAttr(nsGkAtoms::href, aValue);
-  }
+
+  // The XPCOM GetHref is OK for us
   void SetHref(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
     SetHTMLAttr(nsGkAtoms::href, aValue, rv);
   }
   // The XPCOM GetTarget is OK for us
   void SetTarget(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
     SetHTMLAttr(nsGkAtoms::target, aValue, rv);
@@ -151,42 +149,42 @@ public:
   // The XPCOM GetText is OK for us
   void SetText(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
     rv = SetText(aValue);
   }
 
   // Link::GetOrigin is OK for us
 
-  using Link::GetProtocol;
-  using Link::SetProtocol;
+  // Link::GetProtocol is OK for us
+  // Link::SetProtocol is OK for us
 
   // Link::GetUsername is OK for us
   // Link::SetUsername is OK for us
 
   // Link::GetPassword is OK for us
   // Link::SetPassword is OK for us
 
-  using Link::GetHost;
-  using Link::SetHost;
+  // Link::Link::GetHost is OK for us
+  // Link::Link::SetHost is OK for us
 
-  using Link::GetHostname;
-  using Link::SetHostname;
+  // Link::Link::GetHostname is OK for us
+  // Link::Link::SetHostname is OK for us
 
-  using Link::GetPort;
-  using Link::SetPort;
+  // Link::Link::GetPort is OK for us
+  // Link::Link::SetPort is OK for us
 
-  using Link::GetPathname;
-  using Link::SetPathname;
+  // Link::Link::GetPathname is OK for us
+  // Link::Link::SetPathname is OK for us
 
-  using Link::GetSearch;
-  using Link::SetSearch;
+  // Link::Link::GetSearch is OK for us
+  // Link::Link::SetSearch is OK for us
 
-  using Link::GetHash;
-  using Link::SetHash;
+  // Link::Link::GetHash is OK for us
+  // Link::Link::SetHash is OK for us
 
   // The XPCOM URI decomposition attributes are fine for us
   void GetCoords(DOMString& aValue)
   {
     GetHTMLAttr(nsGkAtoms::coords, aValue);
   }
   void SetCoords(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
@@ -219,19 +217,19 @@ public:
   void GetShape(DOMString& aValue)
   {
     GetHTMLAttr(nsGkAtoms::shape, aValue);
   }
   void SetShape(const nsAString& aValue, mozilla::ErrorResult& rv)
   {
     SetHTMLAttr(nsGkAtoms::shape, aValue, rv);
   }
-  void Stringify(nsAString& aResult, ErrorResult& aError)
+  void Stringify(nsAString& aResult)
   {
-    GetHref(aResult, aError);
+    GetHref(aResult);
   }
 
 protected:
   virtual ~HTMLAnchorElement();
 
   virtual void GetItemValueText(DOMString& text) override;
   virtual void SetItemValueText(const nsAString& text) override;
   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
--- a/dom/html/HTMLAreaElement.cpp
+++ b/dom/html/HTMLAreaElement.cpp
@@ -200,27 +200,23 @@ HTMLAreaElement::UnsetAttr(int32_t aName
 
   return rv;
 }
 
 #define IMPL_URI_PART(_part)                                 \
   NS_IMETHODIMP                                              \
   HTMLAreaElement::Get##_part(nsAString& a##_part)           \
   {                                                          \
-    ErrorResult rv;                                          \
-    Link::Get##_part(a##_part, rv);                          \
-    MOZ_ASSERT(!rv.Failed());                                \
+    Link::Get##_part(a##_part);                              \
     return NS_OK;                                            \
   }                                                          \
   NS_IMETHODIMP                                              \
   HTMLAreaElement::Set##_part(const nsAString& a##_part)     \
   {                                                          \
-    ErrorResult rv;                                          \
-    Link::Set##_part(a##_part, rv);                          \
-    MOZ_ASSERT(!rv.Failed());                                \
+    Link::Set##_part(a##_part);                              \
     return NS_OK;                                            \
   }
 
 IMPL_URI_PART(Protocol)
 IMPL_URI_PART(Host)
 IMPL_URI_PART(Hostname)
 IMPL_URI_PART(Pathname)
 IMPL_URI_PART(Search)
--- a/dom/html/HTMLAreaElement.h
+++ b/dom/html/HTMLAreaElement.h
@@ -85,20 +85,17 @@ public:
   }
 
   // The XPCOM GetShape is OK for us
   void SetShape(const nsAString& aShape, ErrorResult& aError)
   {
     SetHTMLAttr(nsGkAtoms::shape, aShape, aError);
   }
 
-  void GetHref(nsAString& aHref, ErrorResult& aError)
-  {
-    aError = GetHref(aHref);
-  }
+  // The XPCOM GetHref is OK for us
   void SetHref(const nsAString& aHref, ErrorResult& aError)
   {
     aError = SetHref(aHref);
   }
 
   // The XPCOM GetTarget is OK for us
   void SetTarget(const nsAString& aTarget, ErrorResult& aError)
   {
@@ -134,58 +131,58 @@ public:
   }
   void GetReferrer(nsAString& aReferrer)
   {
     GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
   }
 
   // The Link::GetOrigin is OK for us
 
-  using Link::GetProtocol;
-  using Link::SetProtocol;
+  // Link::Link::GetProtocol is OK for us
+  // Link::Link::SetProtocol is OK for us
 
   // The Link::GetUsername is OK for us
   // The Link::SetUsername is OK for us
 
   // The Link::GetPassword is OK for us
   // The Link::SetPassword is OK for us
 
-  using Link::GetHost;
-  using Link::SetHost;
+  // Link::Link::GetHost is OK for us
+  // Link::Link::SetHost is OK for us
 
-  using Link::GetHostname;
-  using Link::SetHostname;
+  // Link::Link::GetHostname is OK for us
+  // Link::Link::SetHostname is OK for us
 
-  using Link::GetPort;
-  using Link::SetPort;
+  // Link::Link::GetPort is OK for us
+  // Link::Link::SetPort is OK for us
 
-  using Link::GetPathname;
-  using Link::SetPathname;
+  // Link::Link::GetPathname is OK for us
+  // Link::Link::SetPathname is OK for us
 
-  using Link::GetSearch;
-  using Link::SetSearch;
+  // Link::Link::GetSearch is OK for us
+  // Link::Link::SetSearch is OK for us
 
-  using Link::GetHash;
-  using Link::SetHash;
+  // Link::Link::GetHash is OK for us
+  // Link::Link::SetHash is OK for us
 
   // The Link::GetSearchParams is OK for us
 
   bool NoHref() const
   {
     return GetBoolAttr(nsGkAtoms::nohref);
   }
 
   void SetNoHref(bool aValue, ErrorResult& aError)
   {
     SetHTMLBoolAttr(nsGkAtoms::nohref, aValue, aError);
   }
 
-  void Stringify(nsAString& aResult, ErrorResult& aError)
+  void Stringify(nsAString& aResult)
   {
-    GetHref(aResult, aError);
+    GetHref(aResult);
   }
 
 protected:
   virtual ~HTMLAreaElement();
 
   virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   virtual void GetItemValueText(DOMString& text) override;
--- a/dom/html/nsHTMLDNSPrefetch.cpp
+++ b/dom/html/nsHTMLDNSPrefetch.cpp
@@ -177,18 +177,17 @@ nsresult
 nsHTMLDNSPrefetch::CancelPrefetch(Link *aElement,
                                   uint16_t flags,
                                   nsresult aReason)
 {
   if (!(sInitialized && sPrefetches && sDNSService && sDNSListener))
     return NS_ERROR_NOT_AVAILABLE;
 
   nsAutoString hostname;
-  ErrorResult rv;
-  aElement->GetHostname(hostname, rv);
+  aElement->GetHostname(hostname);
   return CancelPrefetch(hostname, flags, aReason);
 }
 
 nsresult
 nsHTMLDNSPrefetch::CancelPrefetch(const nsAString &hostname,
                                   uint16_t flags,
                                   nsresult aReason)
 {
--- a/dom/webidl/HTMLHyperlinkElementUtils.webidl
+++ b/dom/webidl/HTMLHyperlinkElementUtils.webidl
@@ -11,35 +11,24 @@
  */
 
 [NoInterfaceObject]
 interface HTMLHyperlinkElementUtils {
   // Bug 824857: no support for stringifier attributes yet.
   //  stringifier attribute USVString href;
 
   // Bug 824857 should remove this.
-  [Throws]
   stringifier;
 
-  [Throws]
+  [SetterThrows]
            attribute USVString href;
 
-  [Throws]
   readonly attribute USVString origin;
-  [Throws]
            attribute USVString protocol;
-  [Throws]
            attribute USVString username;
-  [Throws]
            attribute USVString password;
-  [Throws]
            attribute USVString host;
-  [Throws]
            attribute USVString hostname;
-  [Throws]
            attribute USVString port;
-  [Throws]
            attribute USVString pathname;
-  [Throws]
            attribute USVString search;
-  [Throws]
            attribute USVString hash;
 };
--- a/dom/webidl/URL.webidl
+++ b/dom/webidl/URL.webidl
@@ -12,52 +12,35 @@
  * liability, trademark and document use rules apply.
  */
 
 // [Constructor(DOMString url, optional (URL or DOMString) base = "about:blank")]
 [Constructor(DOMString url, URL base),
  Constructor(DOMString url, optional DOMString base),
  Exposed=(Window,Worker)]
 interface URL {
-  [Throws]
+  // Bug 824857: no support for stringifier attributes yet.
+  //  stringifier attribute USVString href;
+
+  // Bug 824857 should remove this.
   stringifier;
 
-  [Throws]
+  [SetterThrows]
   attribute USVString href;
-
-  [Throws]
   readonly attribute USVString origin;
 
-  [Throws]
            attribute USVString protocol;
-
-  [Throws]
            attribute USVString username;
-
-  [Throws]
            attribute USVString password;
-
-  [Throws]
            attribute USVString host;
-
-  [Throws]
            attribute USVString hostname;
-
-  [Throws]
            attribute USVString port;
-
-  [Throws]
            attribute USVString pathname;
-
-  [Throws]
            attribute USVString search;
-
   readonly attribute URLSearchParams searchParams;
-
-  [Throws]
            attribute USVString hash;
 };
 
 partial interface URL {
   [Throws]
   static DOMString? createObjectURL(Blob blob, optional objectURLOptions options);
   [Throws]
   static DOMString? createObjectURL(MediaStream stream, optional objectURLOptions options);
--- a/dom/workers/URL.cpp
+++ b/dom/workers/URL.cpp
@@ -334,64 +334,62 @@ public:
     mWorkerPrivate->AssertIsOnWorkerThread();
   }
 
   bool
   MainThreadRun()
   {
     AssertIsOnMainThread();
 
-    ErrorResult rv;
     switch (mType) {
       case GetterHref:
-        mURLProxy->URL()->GetHref(mValue, rv);
+        mURLProxy->URL()->GetHref(mValue);
         break;
 
       case GetterOrigin:
-        mURLProxy->URL()->GetOrigin(mValue, rv);
+        mURLProxy->URL()->GetOrigin(mValue);
         break;
 
       case GetterProtocol:
-        mURLProxy->URL()->GetProtocol(mValue, rv);
+        mURLProxy->URL()->GetProtocol(mValue);
         break;
 
       case GetterUsername:
-        mURLProxy->URL()->GetUsername(mValue, rv);
+        mURLProxy->URL()->GetUsername(mValue);
         break;
 
       case GetterPassword:
-        mURLProxy->URL()->GetPassword(mValue, rv);
+        mURLProxy->URL()->GetPassword(mValue);
         break;
 
       case GetterHost:
-        mURLProxy->URL()->GetHost(mValue, rv);
+        mURLProxy->URL()->GetHost(mValue);
         break;
 
       case GetterHostname:
-        mURLProxy->URL()->GetHostname(mValue, rv);
+        mURLProxy->URL()->GetHostname(mValue);
         break;
 
       case GetterPort:
-        mURLProxy->URL()->GetPort(mValue, rv);
+        mURLProxy->URL()->GetPort(mValue);
         break;
 
       case GetterPathname:
-        mURLProxy->URL()->GetPathname(mValue, rv);
+        mURLProxy->URL()->GetPathname(mValue);
         break;
 
       case GetterSearch:
-        mURLProxy->URL()->GetSearch(mValue, rv);
+        mURLProxy->URL()->GetSearch(mValue);
         break;
 
       case GetterHash:
-        mURLProxy->URL()->GetHash(mValue, rv);
+        mURLProxy->URL()->GetHash(mValue);
         break;
     }
 
-    MOZ_ASSERT(!rv.Failed());
     return true;
   }
 
 private:
   nsAString& mValue;
   GetterType mType;
   RefPtr<URLProxy> mURLProxy;
 };
@@ -410,81 +408,93 @@ public:
     SetterPort,
     SetterPathname,
     SetterSearch,
     SetterHash,
   };
 
   SetterRunnable(WorkerPrivate* aWorkerPrivate,
                  SetterType aType, const nsAString& aValue,
-                 URLProxy* aURLProxy, mozilla::ErrorResult& aRv)
+                 URLProxy* aURLProxy)
   : WorkerMainThreadRunnable(aWorkerPrivate)
   , mValue(aValue)
   , mType(aType)
   , mURLProxy(aURLProxy)
-  , mRv(aRv)
+  , mFailed(false)
   {
     mWorkerPrivate->AssertIsOnWorkerThread();
   }
 
   bool
   MainThreadRun()
   {
     AssertIsOnMainThread();
 
     switch (mType) {
-      case SetterHref:
-        mURLProxy->URL()->SetHref(mValue, mRv);
+      case SetterHref: {
+        ErrorResult rv;
+        mURLProxy->URL()->SetHref(mValue, rv);
+        if (NS_WARN_IF(rv.Failed())) {
+          rv.SuppressException();
+          mFailed = true;
+        }
+
         break;
+      }
 
       case SetterProtocol:
-        mURLProxy->URL()->SetProtocol(mValue, mRv);
+        mURLProxy->URL()->SetProtocol(mValue);
         break;
 
       case SetterUsername:
-        mURLProxy->URL()->SetUsername(mValue, mRv);
+        mURLProxy->URL()->SetUsername(mValue);
         break;
 
       case SetterPassword:
-        mURLProxy->URL()->SetPassword(mValue, mRv);
+        mURLProxy->URL()->SetPassword(mValue);
         break;
 
       case SetterHost:
-        mURLProxy->URL()->SetHost(mValue, mRv);
+        mURLProxy->URL()->SetHost(mValue);
         break;
 
       case SetterHostname:
-        mURLProxy->URL()->SetHostname(mValue, mRv);
+        mURLProxy->URL()->SetHostname(mValue);
         break;
 
       case SetterPort:
-        mURLProxy->URL()->SetPort(mValue, mRv);
+        mURLProxy->URL()->SetPort(mValue);
         break;
 
       case SetterPathname:
-        mURLProxy->URL()->SetPathname(mValue, mRv);
+        mURLProxy->URL()->SetPathname(mValue);
         break;
 
       case SetterSearch:
-        mURLProxy->URL()->SetSearch(mValue, mRv);
+        mURLProxy->URL()->SetSearch(mValue);
         break;
 
       case SetterHash:
-        mURLProxy->URL()->SetHash(mValue, mRv);
+        mURLProxy->URL()->SetHash(mValue);
         break;
     }
 
     return true;
   }
 
+  bool Failed() const
+  {
+    return mFailed;
+  }
+
 private:
   const nsString mValue;
   SetterType mType;
   RefPtr<URLProxy> mURLProxy;
-  mozilla::ErrorResult& mRv;
+  bool mFailed;
 };
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(URL, mSearchParams)
 
 // The reason for using worker::URL is to have different refcnt logging than
 // for main thread URL.
 NS_IMPL_CYCLE_COLLECTING_ADDREF(workers::URL)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(workers::URL)
@@ -585,290 +595,304 @@ URL::~URL()
 
 JSObject*
 URL::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return URLBinding_workers::Wrap(aCx, this, aGivenProto);
 }
 
 void
-URL::GetHref(nsAString& aHref, ErrorResult& aRv) const
+URL::GetHref(nsAString& aHref) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterHref, aHref,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
 URL::SetHref(const nsAString& aHref, ErrorResult& aRv)
 {
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterHref, aHref,
-                       mURLProxy, aRv);
+                       mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 
+  if (runnable->Failed()) {
+    aRv.ThrowTypeError<MSG_INVALID_URL>(aHref);
+    return;
+  }
+
   UpdateURLSearchParams();
 }
 
 void
-URL::GetOrigin(nsAString& aOrigin, ErrorResult& aRv) const
+URL::GetOrigin(nsAString& aOrigin) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterOrigin, aOrigin,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::GetProtocol(nsAString& aProtocol, ErrorResult& aRv) const
+URL::GetProtocol(nsAString& aProtocol) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterProtocol, aProtocol,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetProtocol(const nsAString& aProtocol, ErrorResult& aRv)
+URL::SetProtocol(const nsAString& aProtocol)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterProtocol,
-                       aProtocol, mURLProxy, rv);
+                       aProtocol, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetUsername(nsAString& aUsername, ErrorResult& aRv) const
+URL::GetUsername(nsAString& aUsername) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterUsername, aUsername,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetUsername(const nsAString& aUsername, ErrorResult& aRv)
+URL::SetUsername(const nsAString& aUsername)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterUsername,
-                       aUsername, mURLProxy, rv);
+                       aUsername, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetPassword(nsAString& aPassword, ErrorResult& aRv) const
+URL::GetPassword(nsAString& aPassword) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterPassword, aPassword,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetPassword(const nsAString& aPassword, ErrorResult& aRv)
+URL::SetPassword(const nsAString& aPassword)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterPassword,
-                       aPassword, mURLProxy, rv);
+                       aPassword, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetHost(nsAString& aHost, ErrorResult& aRv) const
+URL::GetHost(nsAString& aHost) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterHost, aHost,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetHost(const nsAString& aHost, ErrorResult& aRv)
+URL::SetHost(const nsAString& aHost)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterHost,
-                       aHost, mURLProxy, rv);
+                       aHost, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetHostname(nsAString& aHostname, ErrorResult& aRv) const
+URL::GetHostname(nsAString& aHostname) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterHostname, aHostname,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetHostname(const nsAString& aHostname, ErrorResult& aRv)
+URL::SetHostname(const nsAString& aHostname)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterHostname,
-                       aHostname, mURLProxy, rv);
+                       aHostname, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetPort(nsAString& aPort, ErrorResult& aRv) const
+URL::GetPort(nsAString& aPort) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterPort, aPort,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetPort(const nsAString& aPort, ErrorResult& aRv)
+URL::SetPort(const nsAString& aPort)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterPort,
-                       aPort, mURLProxy, rv);
+                       aPort, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetPathname(nsAString& aPathname, ErrorResult& aRv) const
+URL::GetPathname(nsAString& aPathname) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterPathname, aPathname,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetPathname(const nsAString& aPathname, ErrorResult& aRv)
+URL::SetPathname(const nsAString& aPathname)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterPathname,
-                       aPathname, mURLProxy, rv);
+                       aPathname, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 void
-URL::GetSearch(nsAString& aSearch, ErrorResult& aRv) const
+URL::GetSearch(nsAString& aSearch) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterSearch, aSearch,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetSearch(const nsAString& aSearch, ErrorResult& aRv)
+URL::SetSearch(const nsAString& aSearch)
 {
   SetSearchInternal(aSearch);
   UpdateURLSearchParams();
 }
 
 void
 URL::SetSearchInternal(const nsAString& aSearch)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterSearch,
-                       aSearch, mURLProxy, rv);
+                       aSearch, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 mozilla::dom::URLSearchParams*
 URL::SearchParams()
 {
   CreateSearchParamsIfNeeded();
   return mSearchParams;
 }
 
 void
-URL::GetHash(nsAString& aHash, ErrorResult& aRv) const
+URL::GetHash(nsAString& aHash) const
 {
   RefPtr<GetterRunnable> runnable =
     new GetterRunnable(mWorkerPrivate, GetterRunnable::GetterHash, aHash,
                        mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
 }
 
 void
-URL::SetHash(const nsAString& aHash, ErrorResult& aRv)
+URL::SetHash(const nsAString& aHash)
 {
-  ErrorResult rv;
   RefPtr<SetterRunnable> runnable =
     new SetterRunnable(mWorkerPrivate, SetterRunnable::SetterHash,
-                       aHash, mURLProxy, rv);
+                       aHash, mURLProxy);
 
   if (!runnable->Dispatch(mWorkerPrivate->GetJSContext())) {
     JS_ReportPendingException(mWorkerPrivate->GetJSContext());
   }
+
+  MOZ_ASSERT(!runnable->Failed());
 }
 
 // static
 void
 URL::CreateObjectURL(const GlobalObject& aGlobal, Blob& aBlob,
                      const mozilla::dom::objectURLOptions& aOptions,
                      nsAString& aResult, mozilla::ErrorResult& aRv)
 {
@@ -940,18 +964,17 @@ URL::URLSearchParamsUpdated(URLSearchPar
   SetSearchInternal(search);
 }
 
 void
 URL::UpdateURLSearchParams()
 {
   if (mSearchParams) {
     nsAutoString search;
-    ErrorResult rv;
-    GetSearch(search, rv);
+    GetSearch(search);
     mSearchParams->ParseInput(NS_ConvertUTF16toUTF8(Substring(search, 1)));
   }
 }
 
 void
 URL::CreateSearchParamsIfNeeded()
 {
   if (!mSearchParams) {
--- a/dom/workers/URL.h
+++ b/dom/workers/URL.h
@@ -65,63 +65,63 @@ public:
   CreateObjectURL(const GlobalObject& aGlobal,
                   Blob& aArg, const objectURLOptions& aOptions,
                   nsAString& aResult, ErrorResult& aRv);
 
   static void
   RevokeObjectURL(const GlobalObject& aGlobal, const nsAString& aUrl,
                   ErrorResult& aRv);
 
-  void GetHref(nsAString& aHref, ErrorResult& aRv) const;
+  void GetHref(nsAString& aHref) const;
 
   void SetHref(const nsAString& aHref, ErrorResult& aRv);
 
-  void GetOrigin(nsAString& aOrigin, ErrorResult& aRv) const;
+  void GetOrigin(nsAString& aOrigin) const;
 
-  void GetProtocol(nsAString& aProtocol, ErrorResult& aRv) const;
+  void GetProtocol(nsAString& aProtocol) const;
 
-  void SetProtocol(const nsAString& aProtocol, ErrorResult& aRv);
+  void SetProtocol(const nsAString& aProtocol);
 
-  void GetUsername(nsAString& aUsername, ErrorResult& aRv) const;
+  void GetUsername(nsAString& aUsername) const;
 
-  void SetUsername(const nsAString& aUsername, ErrorResult& aRv);
+  void SetUsername(const nsAString& aUsername);
 
-  void GetPassword(nsAString& aPassword, ErrorResult& aRv) const;
+  void GetPassword(nsAString& aPassword) const;
 
-  void SetPassword(const nsAString& aPassword, ErrorResult& aRv);
+  void SetPassword(const nsAString& aPassword);
 
-  void GetHost(nsAString& aHost, ErrorResult& aRv) const;
+  void GetHost(nsAString& aHost) const;
 
-  void SetHost(const nsAString& aHost, ErrorResult& aRv);
+  void SetHost(const nsAString& aHost);
 
-  void GetHostname(nsAString& aHostname, ErrorResult& aRv) const;
+  void GetHostname(nsAString& aHostname) const;
 
-  void SetHostname(const nsAString& aHostname, ErrorResult& aRv);
+  void SetHostname(const nsAString& aHostname);
 
-  void GetPort(nsAString& aPort, ErrorResult& aRv) const;
+  void GetPort(nsAString& aPort) const;
 
-  void SetPort(const nsAString& aPort, ErrorResult& aRv);
+  void SetPort(const nsAString& aPort);
 
-  void GetPathname(nsAString& aPathname, ErrorResult& aRv) const;
+  void GetPathname(nsAString& aPathname) const;
 
-  void SetPathname(const nsAString& aPathname, ErrorResult& aRv);
+  void SetPathname(const nsAString& aPathname);
 
-  void GetSearch(nsAString& aSearch, ErrorResult& aRv) const;
+  void GetSearch(nsAString& aSearch) const;
 
-  void SetSearch(const nsAString& aSearch, ErrorResult& aRv);
+  void SetSearch(const nsAString& aSearch);
 
   URLSearchParams* SearchParams();
 
-  void GetHash(nsAString& aHost, ErrorResult& aRv) const;
+  void GetHash(nsAString& aHost) const;
 
-  void SetHash(const nsAString& aHash, ErrorResult& aRv);
+  void SetHash(const nsAString& aHash);
 
-  void Stringify(nsAString& aRetval, ErrorResult& aRv) const
+  void Stringify(nsAString& aRetval) const
   {
-    GetHref(aRetval, aRv);
+    GetHref(aRetval);
   }
 
   // IURLSearchParamsObserver
   void URLSearchParamsUpdated(URLSearchParams* aSearchParams) override;
 
 private:
   URLProxy* GetURLProxy() const
   {