Backed out 3 changesets (bug 1217501) for m(4) leaks CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 26 Oct 2015 11:52:23 -0700
changeset 304790 c6cc9d6108651a36914189dd326856e8f2692b42
parent 304789 924e0fbf9726575d31322e1e0a7fe3aae1a18744
child 304791 05868efaa702fa95499e0f491305af36f02c2fe6
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1217501
milestone44.0a1
backs outf00f079f712ba026c008a4f339a2e8bc8de996c3
86ac4feb0e38af9001d73b9b011427390a53e210
0c7e876a69e54646265585c4363794acb9e1aedb
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 3 changesets (bug 1217501) for m(4) leaks CLOSED TREE Backed out changeset f00f079f712b (bug 1217501) Backed out changeset 86ac4feb0e38 (bug 1217501) Backed out changeset 0c7e876a69e5 (bug 1217501)
dom/fetch/FetchDriver.cpp
netwerk/protocol/http/nsHttpHandler.cpp
testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-header-visibility.https.html
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-header-visibility-iframe.html
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -298,34 +298,24 @@ FetchDriver::HttpFetch()
     nsAutoCString method;
     mRequest->GetMethod(method);
     rv = httpChan->SetRequestMethod(method);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Set the same headers.
     nsAutoTArray<InternalHeaders::Entry, 5> headers;
     mRequest->Headers()->GetEntries(headers);
-    bool hasAccept = false;
     for (uint32_t i = 0; i < headers.Length(); ++i) {
-      if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
-        hasAccept = true;
-      }
       if (headers[i].mValue.IsEmpty()) {
         httpChan->SetEmptyRequestHeader(headers[i].mName);
       } else {
         httpChan->SetRequestHeader(headers[i].mName, headers[i].mValue, false /* merge */);
       }
     }
 
-    if (!hasAccept) {
-      httpChan->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
-                                 NS_LITERAL_CSTRING("*/*"),
-                                 false /* merge */);
-    }
-
     // Step 2. Set the referrer.
     nsAutoString referrer;
     mRequest->GetReferrer(referrer);
     if (referrer.EqualsLiteral(kFETCH_CLIENT_REFERRER_STR)) {
       rv = nsContentUtils::SetFetchReferrerURIWithPolicy(mPrincipal,
                                                          mDocument,
                                                          httpChan);
       NS_ENSURE_SUCCESS(rv, rv);
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -425,29 +425,26 @@ nsHttpHandler::AddStandardRequestHeaders
     nsresult rv;
 
     // Add the "User-Agent" header
     rv = request->SetHeader(nsHttp::User_Agent, UserAgent(),
                             false, nsHttpHeaderArray::eVarietyDefault);
     if (NS_FAILED(rv)) return rv;
 
     // MIME based content negotiation lives!
-    // Add the "Accept" header.  Note, this is set as an override because the
-    // service worker expects to see it.  The other "default" headers are
-    // hidden from service worker interception.
+    // Add the "Accept" header
     rv = request->SetHeader(nsHttp::Accept, mAccept,
-                            false, nsHttpHeaderArray::eVarietyOverride);
+                            false, nsHttpHeaderArray::eVarietyDefault);
     if (NS_FAILED(rv)) return rv;
 
-    // Add the "Accept-Language" header.  This header is also exposed to the
-    // service worker.
+    // Add the "Accept-Language" header
     if (!mAcceptLanguages.IsEmpty()) {
         // Add the "Accept-Language" header
         rv = request->SetHeader(nsHttp::Accept_Language, mAcceptLanguages,
-                                false, nsHttpHeaderArray::eVarietyOverride);
+                                false, nsHttpHeaderArray::eVarietyDefault);
         if (NS_FAILED(rv)) return rv;
     }
 
     // Add the "Accept-Encoding" header
     if (isSecure) {
         rv = request->SetHeader(nsHttp::Accept_Encoding, mHttpsAcceptEncodings,
                                 false, nsHttpHeaderArray::eVarietyDefault);
     } else {
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-header-visibility.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-header-visibility.https.html
@@ -18,17 +18,17 @@
       })
       .then(function() {
         var frame = document.createElement('iframe');
         frame.src = scope;
         document.body.appendChild(frame);
 
         // Resolve a promise when we recieve 2 success messages
         return new Promise(function(resolve, reject) {
-          var remaining = 4;
+          var remaining = 2;
           function onMessage(e) {
             if (e.data == 'PASS') {
               remaining--;
               if (remaining == 0) {
                 resolve();
               } else {
                 return;
               }
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-header-visibility-iframe.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-header-visibility-iframe.html
@@ -27,40 +27,9 @@
     if (text == 'NO_UA') {
       parent.postMessage('PASS', '*');
     } else {
       parent.postMessage('noUA FAIL - expected "NO_UA", got "' + text + '"', '*');
     }
   }).catch(function(err) {
     parent.postMessage('noUA FAIL - unexpected error: ' + err, '*');
   });
-
-  var uri = document.location + '?check-accept-header';
-  var headers = new Headers();
-  headers.set('Accept', 'hmm');
-
-  // Check for custom accept header
-  fetch(uri, { headers: headers }).then(function(response) {
-    return response.text();
-  }).then(function(text) {
-    if (text === headers.get('Accept')) {
-      parent.postMessage('PASS', '*');
-    } else {
-      parent.postMessage('custom accept FAIL - expected ' + headers.get('Accept') +
-                         ' got "' + text + '"', '*');
-    }
-  }).catch(function(err) {
-    parent.postMessage('custom accept FAIL - unexpected error: ' + err, '*');
-  });
-
-  // Check for default accept header
-  fetch(uri).then(function(response) {
-    return response.text();
-  }).then(function(text) {
-    if (text === '*/*') {
-      parent.postMessage('PASS', '*');
-    } else {
-      parent.postMessage('accept FAIL - expected */* got "' + text + '"', '*');
-    }
-  }).catch(function(err) {
-    parent.postMessage('accept FAIL - unexpected error: ' + err, '*');
-  });
 </script>
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
@@ -58,24 +58,16 @@ self.addEventListener('fetch', function(
         // We have a user agent!
         event.respondWith(new Response(new Blob([ua])));
       } else {
         // We don't have a user-agent!
         event.respondWith(new Response(new Blob(["NO_UA"])));
       }
       return;
     }
-    if (params['check-accept-header']) {
-      var accept = event.request.headers.get('Accept');
-      if (accept) {
-        event.respondWith(new Response(accept));
-      } else {
-        event.respondWith(new Response('NO_ACCEPT'));
-      }
-    }
     event.respondWith(new Promise(function(resolve, reject) {
         var request = event.request;
         if (url) {
           request = new Request(url, init);
         }
         fetch(request).then(function(response) {
           var expectedType = params['expected_type'];
           if (expectedType && response.type !== expectedType) {