Bug 792808 - Migrate XMLHttpRequestMainThread away from needing nsIXMLHttpRequest's constants; r=baku
authorThomas Wisniewski <wisniewskit@gmail.com>
Sun, 24 Sep 2017 14:08:38 -0400
changeset 404231 a4b33f7c71beb35c9693dfe0b6faf2d9e3493006
parent 404230 b4d46a5196fec93a482cbbd00cf5d4d7018f2206
child 404232 05e1fd3789a8b30465d4f12da61f3f8e3913974d
push id99968
push userrgurzau@mozilla.com
push dateFri, 16 Feb 2018 22:14:56 +0000
treeherdermozilla-inbound@2e16779c96cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs792808
milestone60.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 792808 - Migrate XMLHttpRequestMainThread away from needing nsIXMLHttpRequest's constants; r=baku MozReview-Commit-ID: 1yaM9DAKPW7
dom/xhr/XMLHttpRequestMainThread.cpp
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -3347,32 +3347,17 @@ XMLHttpRequestMainThread::GetReadyState(
 {
   *aState = ReadyState();
   return NS_OK;
 }
 
 uint16_t
 XMLHttpRequestMainThread::ReadyState() const
 {
-  // Translate some of our internal states for external consumers
-  switch(mState) {
-    case State::unsent:
-      return UNSENT;
-    case State::opened:
-      return OPENED;
-    case State::headers_received:
-      return HEADERS_RECEIVED;
-    case State::loading:
-      return LOADING;
-    case State::done:
-      return DONE;
-    default:
-      MOZ_CRASH("Unknown state");
-  }
-  return 0;
+  return static_cast<uint16_t>(mState);
 }
 
 void
 XMLHttpRequestMainThread::OverrideMimeType(const nsAString& aMimeType,
                                            ErrorResult& aRv)
 {
   NOT_CALLABLE_IN_SYNC_SEND_RV