Bug 1712930 - Part 7: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED; r=smaug
☠☠ backed out by a8c952dcf428 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Mon, 31 May 2021 12:57:18 +0000
changeset 653974 4a03c8b2aa1ad58d23e8279f1955a0c6af8b5667
parent 653973 311ccf17a01d149dd601c41d054b2e98b868d952
child 653975 de40c72ddc80133fd7a98fb92293dc8aec7cc9c2
push id2623
push userffxbld-merge
push dateMon, 02 Aug 2021 14:47:51 +0000
treeherdermozilla-release@8500ce65f7c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1712930
milestone90.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 1712930 - Part 7: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED; r=smaug Differential Revision: https://phabricator.services.mozilla.com/D116081
devtools/server/actors/network-monitor/utils/network-utils.js
dom/base/domerr.msg
dom/xhr/XMLHttpRequestMainThread.cpp
xpcom/base/ErrorList.py
--- a/devtools/server/actors/network-monitor/utils/network-utils.js
+++ b/devtools/server/actors/network-monitor/utils/network-utils.js
@@ -293,17 +293,16 @@ const ErrorCodes = {
   NS_ERROR_DOM_PROP_ACCESS_DENIED: 0x805303f2,
   NS_ERROR_DOM_XPCONNECT_ACCESS_DENIED: 0x805303f3,
   NS_ERROR_DOM_BAD_URI: 0x805303f4,
   NS_ERROR_DOM_RETVAL_UNDEFINED: 0x805303f5,
   NS_ERROR_UNCATCHABLE_EXCEPTION: 0x805303f7,
   NS_ERROR_DOM_MALFORMED_URI: 0x805303f8,
   NS_ERROR_DOM_INVALID_HEADER_NAME: 0x805303f9,
   NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT: 0x805303fa,
-  NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED: 0x805303fb,
   NS_ERROR_DOM_JS_DECODING_ERROR: 0x80530402,
   NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT: 0x80530403,
   NS_ERROR_DOM_IMAGE_INVALID_REQUEST: 0x80530404,
   NS_ERROR_DOM_IMAGE_BROKEN: 0x80530405,
   NS_ERROR_DOM_CORP_FAILED: 0x8053040c,
   NS_SUCCESS_DOM_NO_OPERATION: 0x530001,
   NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW: 0x530002,
   NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE: 0x530003,
--- a/dom/base/domerr.msg
+++ b/dom/base/domerr.msg
@@ -133,14 +133,13 @@ DOM4_MSG_DEF(AbortError,        "The fet
 DOM4_MSG_DEF(NotAllowedError,   "The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.", NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR)
 DOM4_MSG_DEF(NotSupportedError, "The media resource indicated by the src attribute or assigned media provider object was not suitable.", NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR)
 
 DOM4_MSG_DEF(SyntaxError, "The URI is malformed.", NS_ERROR_DOM_MALFORMED_URI)
 DOM4_MSG_DEF(SyntaxError, "Invalid header name.", NS_ERROR_DOM_INVALID_HEADER_NAME)
 
 /* XMLHttpRequest errors. */
 DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest has an invalid context.", NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT)
-DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest state must be OPENED.", NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED)
 
 /* Image decode errors. */
 DOM4_MSG_DEF(EncodingError, "Node bound to inactive document.", NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT)
 DOM4_MSG_DEF(EncodingError, "Invalid image request.", NS_ERROR_DOM_IMAGE_INVALID_REQUEST)
 DOM4_MSG_DEF(EncodingError, "Invalid encoded image data.", NS_ERROR_DOM_IMAGE_BROKEN)
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -2892,17 +2892,17 @@ void XMLHttpRequestMainThread::SendInter
 
   if (!mPrincipal) {
     aRv.Throw(NS_ERROR_NOT_INITIALIZED);
     return;
   }
 
   // Step 1
   if (mState != XMLHttpRequest_Binding::OPENED) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED);
+    aRv.ThrowInvalidStateError("XMLHttpRequest state must be OPENED.");
     return;
   }
 
   // Step 2
   if (mFlagSend) {
     aRv.ThrowInvalidStateError("XMLHttpRequest must not be sending.");
     return;
   }
@@ -3101,17 +3101,17 @@ void XMLHttpRequestMainThread::SendInter
 // http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader
 void XMLHttpRequestMainThread::SetRequestHeader(const nsACString& aName,
                                                 const nsACString& aValue,
                                                 ErrorResult& aRv) {
   NOT_CALLABLE_IN_SYNC_SEND_RV
 
   // Step 1
   if (mState != XMLHttpRequest_Binding::OPENED) {
-    aRv.Throw(NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED);
+    aRv.ThrowInvalidStateError("XMLHttpRequest state must be OPENED.");
     return;
   }
 
   // Step 2
   if (mFlagSend) {
     aRv.ThrowInvalidStateError("XMLHttpRequest must not be sending.");
     return;
   }
--- a/xpcom/base/ErrorList.py
+++ b/xpcom/base/ErrorList.py
@@ -709,17 +709,16 @@ with modules["DOM"]:
 
     # A way to represent uncatchable exceptions
     errors["NS_ERROR_UNCATCHABLE_EXCEPTION"] = FAILURE(1015)
 
     errors["NS_ERROR_DOM_MALFORMED_URI"] = FAILURE(1016)
     errors["NS_ERROR_DOM_INVALID_HEADER_NAME"] = FAILURE(1017)
 
     errors["NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT"] = FAILURE(1018)
-    errors["NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED"] = FAILURE(1019)
 
     # When manipulating the bytecode cache with the JS API, some transcoding
     # errors, such as a different bytecode format can cause failures of the
     # decoding process.
     errors["NS_ERROR_DOM_JS_DECODING_ERROR"] = FAILURE(1026)
 
     # Image decode errors.
     errors["NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT"] = FAILURE(1027)