Backed out 2 changesets (bug 1341678) under suspicion of causing wpt failures in test_fetch_event.html a=backout
authorWes Kocher <wkocher@mozilla.com>
Tue, 28 Feb 2017 17:10:23 -0800
changeset 374288 9a0b4db0c156d34aff2e1c9ad235013849af304e
parent 374287 f2606ea1b31d32b8662065a9065db805c5022f54
child 374289 2b4713a7a0825a515e212d9300885648a9e9e975
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1341678
milestone54.0a1
backs out87ea3256dd8b3bf3f6f924525f44d12212b936ff
ccc9257cda4d4d42c77b2ddbae043f587f6039fb
Backed out 2 changesets (bug 1341678) under suspicion of causing wpt failures in test_fetch_event.html a=backout Backed out changeset 87ea3256dd8b (bug 1341678) Backed out changeset ccc9257cda4d (bug 1341678) MozReview-Commit-ID: KqHfX6DZuwf
dom/fetch/Request.cpp
testing/web-platform/meta/fetch/api/request/request-disturbed.html.ini
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -272,33 +272,31 @@ private:
 
 } // namespace
 
 /*static*/ already_AddRefed<Request>
 Request::Constructor(const GlobalObject& aGlobal,
                      const RequestOrUSVString& aInput,
                      const RequestInit& aInit, ErrorResult& aRv)
 {
-  bool hasCopiedBody = false;
+  nsCOMPtr<nsIInputStream> temporaryBody;
   RefPtr<InternalRequest> request;
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
 
   if (aInput.IsRequest()) {
     RefPtr<Request> inputReq = &aInput.GetAsRequest();
     nsCOMPtr<nsIInputStream> body;
     inputReq->GetBody(getter_AddRefs(body));
     if (inputReq->BodyUsed()) {
       aRv.ThrowTypeError<MSG_FETCH_BODY_CONSUMED_ERROR>();
       return nullptr;
     }
-
-    // The body will be copied when GetRequestConstructorCopy() is executed.
     if (body) {
-      hasCopiedBody = true;
+      temporaryBody = body;
     }
 
     request = inputReq->GetInternalRequest();
   } else {
     // aInput is USVString.
     // We need to get url before we create a InternalRequest.
     nsAutoString input;
     input.Assign(aInput.GetAsUSVString());
@@ -526,17 +524,17 @@ Request::Constructor(const GlobalObject&
   }
 
   requestHeaders->Fill(*headers, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   if ((aInit.mBody.WasPassed() && !aInit.mBody.Value().IsNull()) ||
-      hasCopiedBody) {
+      temporaryBody) {
     // HEAD and GET are not allowed to have a body.
     nsAutoCString method;
     request->GetMethod(method);
     // method is guaranteed to be uppercase due to step 14.2 above.
     if (method.EqualsLiteral("HEAD") || method.EqualsLiteral("GET")) {
       aRv.ThrowTypeError<MSG_NO_BODY_ALLOWED_FOR_GET_AND_HEAD>();
       return nullptr;
     }
@@ -552,34 +550,29 @@ Request::Constructor(const GlobalObject&
       aRv = ExtractByteStreamFromBody(bodyInit,
                                       getter_AddRefs(stream),
                                       contentTypeWithCharset,
                                       contentLengthUnused);
       if (NS_WARN_IF(aRv.Failed())) {
         return nullptr;
       }
 
-      nsCOMPtr<nsIInputStream> temporaryBody = stream;
+      temporaryBody = stream;
 
       if (!contentTypeWithCharset.IsVoid() &&
           !requestHeaders->Has(NS_LITERAL_CSTRING("Content-Type"), aRv)) {
         requestHeaders->Append(NS_LITERAL_CSTRING("Content-Type"),
                                contentTypeWithCharset, aRv);
       }
 
       if (NS_WARN_IF(aRv.Failed())) {
         return nullptr;
       }
 
       request->ClearCreatedByFetchEvent();
-
-      if (hasCopiedBody) {
-        request->SetBody(nullptr);
-      }
-
       request->SetBody(temporaryBody);
     }
   }
 
   RefPtr<Request> domRequest = new Request(global, request);
   domRequest->SetMimeType();
 
   if (aInput.IsRequest()) {
--- a/testing/web-platform/meta/fetch/api/request/request-disturbed.html.ini
+++ b/testing/web-platform/meta/fetch/api/request/request-disturbed.html.ini
@@ -1,10 +1,21 @@
 [request-disturbed.html]
   type: testharness
+  expected:
+    if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH
+    if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): TIMEOUT
+    if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): CRASH
+    if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
+    if debug and not e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): CRASH
+    if debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): TIMEOUT
+    if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): TIMEOUT
+    if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): TIMEOUT
+    if debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): CRASH
+    if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): CRASH
   [Request without body cannot be disturbed]
     expected: FAIL
 
   [Request's body: initial state]
     expected: FAIL
 
   [Input request used for creating new request became disturbed]
     expected: FAIL