Backed out 2 changesets (bug 1539208) for causing bug 1540569 a=backout
authorAndreea Pavel <apavel@mozilla.com>
Mon, 01 Apr 2019 10:36:18 +0300
changeset 467008 12014960188da2a6c78f281b072f9bb9f69ec8ef
parent 467007 70a50fe09a18b2516e9ffdb2083debfab7de720d
child 467020 a4ba89d3c83e000e402a6f275240b8b293d446a1
push id35792
push userapavel@mozilla.com
push dateMon, 01 Apr 2019 07:38:04 +0000
treeherdermozilla-central@12014960188d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1539208, 1540569
milestone68.0a1
backs out7b17d77256be8a810d75865b422a49b4adca7a90
cec67adbdbb6d5b2948a68e4f6fb13612f949368
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
Backed out 2 changesets (bug 1539208) for causing bug 1540569 a=backout Backed out changeset 7b17d77256be (bug 1539208) Backed out changeset cec67adbdbb6 (bug 1539208)
dom/fetch/FetchDriver.cpp
dom/fetch/InternalResponse.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -1043,17 +1043,17 @@ FetchDriver::OnStartRequest(nsIRequest* 
 
   // Resolves fetch() promise which may trigger code running in a worker.  Make
   // sure the Response is fully initialized before calling this.
   mResponse = BeginAndGetFilteredResponse(response, foundOpaqueRedirect);
   if (NS_WARN_IF(!mResponse)) {
     // Fail to generate a paddingInfo for opaque response.
     MOZ_DIAGNOSTIC_ASSERT(mResponse->Type() == ResponseType::Opaque);
     FailWithNetworkError(NS_ERROR_UNEXPECTED);
-    return NS_ERROR_UNEXPECTED;
+    return rv;
   }
 
   // From "Main Fetch" step 19: SRI-part1.
   if (ShouldCheckSRI(mRequest, mResponse) && mSRIMetadata.IsEmpty()) {
     nsIConsoleReportCollector* reporter = nullptr;
     if (mObserver) {
       reporter = mObserver->GetReporter();
     }
--- a/dom/fetch/InternalResponse.cpp
+++ b/dom/fetch/InternalResponse.cpp
@@ -6,17 +6,16 @@
 
 #include "InternalResponse.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/InternalHeaders.h"
 #include "mozilla/dom/cache/CacheTypes.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
-#include "mozilla/RandomNum.h"
 #include "nsIRandomGenerator.h"
 #include "nsIURI.h"
 #include "nsStreamUtils.h"
 
 namespace mozilla {
 namespace dom {
 
 namespace {
@@ -118,34 +117,24 @@ nsresult InternalResponse::GeneratePaddi
   MOZ_DIAGNOSTIC_ASSERT(mPaddingSize == UNKNOWN_PADDING_SIZE);
 
   // Utilize random generator to generator a random number
   nsresult rv;
   uint32_t randomNumber = 0;
   nsCOMPtr<nsIRandomGenerator> randomGenerator =
       do_GetService("@mozilla.org/security/random-generator;1", &rv);
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    Maybe<uint64_t> maybeRandomNum = RandomUint64();
-    if (maybeRandomNum.isSome()) {
-      mPaddingInfo.emplace(uint32_t(maybeRandomNum.value() % kMaxRandomNumber));
-      return NS_OK;
-    }
     return rv;
   }
 
   MOZ_DIAGNOSTIC_ASSERT(randomGenerator);
 
   uint8_t* buffer;
   rv = randomGenerator->GenerateRandomBytes(sizeof(randomNumber), &buffer);
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    Maybe<uint64_t> maybeRandomNum = RandomUint64();
-    if (maybeRandomNum.isSome()) {
-      mPaddingInfo.emplace(uint32_t(maybeRandomNum.value() % kMaxRandomNumber));
-      return NS_OK;
-    }
     return rv;
   }
 
   memcpy(&randomNumber, buffer, sizeof(randomNumber));
   free(buffer);
 
   mPaddingInfo.emplace(randomNumber % kMaxRandomNumber);