Backed out changeset 9b53ec0c065e (bug 1170809) for making ASAN opt builds timeout.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 10 Jun 2015 15:31:56 -0400
changeset 275015 a5826a94fc54d44f1ea1dd91348bb83324ebccdb
parent 275014 5d28d0c44fc1e0ae851d8b4b02793108afb8112a
child 275016 b807b5614da320fa25c3ed02f84cb53e88fed769
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1170809
milestone40.0a2
backs out9b53ec0c065e7d6565e3bb45f24dc9024ad81f2b
Backed out changeset 9b53ec0c065e (bug 1170809) for making ASAN opt builds timeout.
dom/base/nsXMLHttpRequest.cpp
--- a/dom/base/nsXMLHttpRequest.cpp
+++ b/dom/base/nsXMLHttpRequest.cpp
@@ -669,47 +669,38 @@ nsXMLHttpRequest::AppendToResponseText(c
 {
   NS_ENSURE_STATE(mDecoder);
 
   int32_t destBufferLen;
   nsresult rv = mDecoder->GetMaxLength(aSrcBuffer, aSrcBufferLen,
                                        &destBufferLen);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  CheckedInt32 neededCapacity = destBufferLen;
-  neededCapacity += mResponseText.Length();
-
-  if (!neededCapacity.isValid()) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  if (!mResponseText.SetCapacity(neededCapacity.value(), fallible)) {
+  if (!mResponseText.SetCapacity(mResponseText.Length() + destBufferLen, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   char16_t* destBuffer = mResponseText.BeginWriting() + mResponseText.Length();
 
-  CheckedInt32 totalChars = mResponseText.Length();
+  int32_t totalChars = mResponseText.Length();
 
   // This code here is basically a copy of a similar thing in
   // nsScanner::Append(const char* aBuffer, uint32_t aLen).
   int32_t srclen = (int32_t)aSrcBufferLen;
   int32_t destlen = (int32_t)destBufferLen;
   rv = mDecoder->Convert(aSrcBuffer,
                          &srclen,
                          destBuffer,
                          &destlen);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   totalChars += destlen;
-  if (!totalChars.isValid()) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  mResponseText.SetLength(totalChars.value());
+
+  mResponseText.SetLength(totalChars);
+
   return NS_OK;
 }
 
 /* readonly attribute AString responseText; */
 NS_IMETHODIMP
 nsXMLHttpRequest::GetResponseText(nsAString& aResponseText)
 {
   ErrorResult rv;