Bug 1160447 - Back out XHR internalErrorCode debug code added for Netflix test. r=khuey, a=sylvestre
authorChris Peterson <cpeterson@mozilla.com>
Fri, 09 Oct 2015 11:39:04 -0700
changeset 289553 124a1bf2bdfb
parent 289552 8b303a74c515
child 289554 331b9e49f805
push id5184
push usercbook@mozilla.com
push date2015-10-15 14:03 +0000
treeherdermozilla-beta@124a1bf2bdfb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, sylvestre
bugs1160447
milestone42.0
Bug 1160447 - Back out XHR internalErrorCode debug code added for Netflix test. r=khuey, a=sylvestre
dom/base/nsXMLHttpRequest.cpp
dom/base/nsXMLHttpRequest.h
dom/webidl/XMLHttpRequest.webidl
dom/workers/XMLHttpRequest.h
--- a/dom/base/nsXMLHttpRequest.cpp
+++ b/dom/base/nsXMLHttpRequest.cpp
@@ -298,17 +298,16 @@ nsXMLHttpRequest::sDontWarnAboutSyncXHR 
 nsXMLHttpRequest::nsXMLHttpRequest()
   : mResponseBodyDecodedPos(0),
     mResponseType(XML_HTTP_RESPONSE_TYPE_DEFAULT),
     mRequestObserver(nullptr),
     mState(XML_HTTP_REQUEST_UNSENT | XML_HTTP_REQUEST_ASYNC),
     mUploadTransferred(0), mUploadTotal(0), mUploadComplete(true),
     mProgressSinceLastProgressEvent(false),
     mRequestSentTime(0), mTimeoutMilliseconds(0),
-    mErrorStatus(NS_OK),
     mErrorLoad(false), mWaitingForOnStopRequest(false),
     mProgressTimerIsActive(false),
     mIsHtml(false),
     mWarnAboutSyncHtml(false),
     mLoadLengthComputable(false), mLoadTotal(0),
     mIsSystem(false),
     mIsAnon(false),
     mFirstStartRequestSeen(false),
@@ -1164,25 +1163,16 @@ nsXMLHttpRequest::Status()
   nsresult rv = httpChannel->GetResponseStatus(&status);
   if (NS_FAILED(rv)) {
     status = 0;
   }
 
   return status;
 }
 
-uint32_t
-nsXMLHttpRequest::InternalErrorCode() {
-  if (IsDeniedCrossSiteRequest()) {
-    return 0;
-  }
-
-  return (uint32_t)mErrorStatus;
-}
-
 IMPL_CSTRING_GETTER(GetStatusText)
 void
 nsXMLHttpRequest::GetStatusText(nsCString& aStatusText)
 {
   // Return an empty status text on all error loads.
   aStatusText.Truncate();
 
   // Make sure we don't leak status information from denied cross-site
@@ -2224,18 +2214,16 @@ nsXMLHttpRequest::OnStopRequest(nsIReque
   PROFILER_LABEL("nsXMLHttpRequest", "OnStopRequest",
     js::ProfileEntry::Category::NETWORK);
 
   if (request != mChannel) {
     // Can this still happen?
     return NS_OK;
   }
 
-  mErrorStatus = status;
-
   mWaitingForOnStopRequest = false;
 
   if (mRequestObserver) {
     NS_ASSERTION(mFirstStartRequestSeen, "Inconsistent state!");
     mFirstStartRequestSeen = false;
     mRequestObserver->OnStopRequest(request, ctxt, status);
   }
 
--- a/dom/base/nsXMLHttpRequest.h
+++ b/dom/base/nsXMLHttpRequest.h
@@ -494,17 +494,16 @@ public:
     aRv = Send(RequestBody(aStream));
   }
 
   void Abort();
 
   // response
   void GetResponseURL(nsAString& aUrl);
   uint32_t Status();
-  uint32_t InternalErrorCode();
   void GetStatusText(nsCString& aStatusText);
   void GetResponseHeader(const nsACString& aHeader, nsACString& aResult,
                          ErrorResult& aRv);
   void GetResponseHeader(const nsAString& aHeader, nsString& aResult,
                          ErrorResult& aRv)
   {
     nsCString result;
     GetResponseHeader(NS_ConvertUTF16toUTF8(aHeader), result, aRv);
@@ -747,17 +746,16 @@ protected:
   bool mProgressSinceLastProgressEvent;
 
   // Timeout support
   PRTime mRequestSentTime;
   uint32_t mTimeoutMilliseconds;
   nsCOMPtr<nsITimer> mTimeoutTimer;
   void StartTimeoutTimer();
   void HandleTimeoutCallback();
-  nsresult mErrorStatus;
 
   bool mErrorLoad;
   bool mWaitingForOnStopRequest;
   bool mProgressTimerIsActive;
   bool mIsHtml;
   bool mWarnAboutMultipartHtml;
   bool mWarnAboutSyncHtml;
   bool mLoadLengthComputable;
--- a/dom/webidl/XMLHttpRequest.webidl
+++ b/dom/webidl/XMLHttpRequest.webidl
@@ -107,18 +107,16 @@ interface XMLHttpRequest : XMLHttpReques
   void abort();
 
   // response
   readonly attribute DOMString responseURL;
 
   [Throws=Workers]
   readonly attribute unsigned short status;
 
-  readonly attribute unsigned long internalErrorCode;
-
   readonly attribute ByteString statusText;
   [Throws]
   ByteString? getResponseHeader(ByteString header);
 
   [Throws=Workers]
   ByteString getAllResponseHeaders();
 
   [Throws=Workers]
--- a/dom/workers/XMLHttpRequest.h
+++ b/dom/workers/XMLHttpRequest.h
@@ -194,21 +194,16 @@ public:
 
   uint16_t
   GetStatus(ErrorResult& aRv) const
   {
     aRv = mStateData.mStatusResult;
     return mStateData.mStatus;
   }
 
-  uint32_t
-  InternalErrorCode() const {
-    return 0;
-  }
-
   void
   GetStatusText(nsACString& aStatusText) const
   {
     aStatusText = mStateData.mStatusText;
   }
 
   void
   GetResponseHeader(const nsACString& aHeader, nsACString& aResponseHeader,