Backed out changeset 4b38a09cca56 (bug 1189673) for W(4) and W(8) bustages ON A CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Tue, 20 Oct 2015 13:52:22 +0530
changeset 303656 a4334a6c531326e239293511a3bdb670b83effdf
parent 303655 4ed118d4faff0282d6783182aba8fd96b50f583a
child 303657 f7b746b4e91307448cb0746a41f677bfc23908b0
child 303658 11e681d48acde9fb42dd1d564a8136539d7cd4e8
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)
bugs1189673
milestone44.0a1
backs out4b38a09cca568ef84499ad5f8ed8f4ad1e2f414f
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 changeset 4b38a09cca56 (bug 1189673) for W(4) and W(8) bustages ON A CLOSED TREE
dom/fetch/InternalHeaders.h
dom/workers/ServiceWorkerPrivate.cpp
testing/web-platform/mozilla/meta/service-workers/service-worker/request-end-to-end.https.html.ini
testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
--- a/dom/fetch/InternalHeaders.h
+++ b/dom/fetch/InternalHeaders.h
@@ -46,24 +46,21 @@ private:
 
 public:
   explicit InternalHeaders(HeadersGuardEnum aGuard = HeadersGuardEnum::None)
     : mGuard(aGuard)
   {
   }
 
   explicit InternalHeaders(const InternalHeaders& aOther)
-    : mGuard(HeadersGuardEnum::None)
+    : mGuard(aOther.mGuard)
   {
     ErrorResult result;
     Fill(aOther, result);
     MOZ_ASSERT(!result.Failed());
-    // Note that it's important to set the guard after Fill(), to make sure
-    // that Fill() doesn't fail if aOther is immutable.
-    mGuard = aOther.mGuard;
   }
 
   explicit InternalHeaders(const nsTArray<Entry>&& aHeaders,
                            HeadersGuardEnum aGuard = HeadersGuardEnum::None);
 
   void Append(const nsACString& aName, const nsACString& aValue,
               ErrorResult& aRv);
   void Delete(const nsACString& aName, ErrorResult& aRv);
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -1032,22 +1032,16 @@ private:
     MOZ_ASSERT(internalReq);
     internalReq->SetCreatedByFetchEvent();
 
     internalReq->SetBody(mUploadStream);
     internalReq->SetReferrer(NS_ConvertUTF8toUTF16(mReferrer));
 
     request->SetContentPolicyType(mContentPolicyType);
 
-    request->GetInternalHeaders()->SetGuard(HeadersGuardEnum::Immutable, result);
-    if (NS_WARN_IF(result.Failed())) {
-      result.SuppressException();
-      return false;
-    }
-
     // TODO: remove conditional on http here once app protocol support is
     //       removed from service worker interception
     MOZ_ASSERT_IF(mIsHttpChannel && internalReq->IsNavigationRequest(),
                   request->Redirect() == RequestRedirect::Manual);
 
     RootedDictionary<FetchEventInit> init(aCx);
     init.mRequest.Construct();
     init.mRequest.Value() = request;
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/mozilla/meta/service-workers/service-worker/request-end-to-end.https.html.ini
@@ -0,0 +1,6 @@
+[request-end-to-end.https.html]
+  type: testharness
+  expected: TIMEOUT
+  [Request: end-to-end]
+    expected: TIMEOUT
+
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/request-end-to-end.https.html
@@ -41,17 +41,17 @@ t.step(function() {
             event.data.url,
             location.href.substring(0, location.href.lastIndexOf('/') + 1) +
             scope,
             'request.url should be passed to onfetch event.');
         assert_equals(event.data.method, 'GET',
                       'request.method should be passed to onfetch event.');
         assert_equals(event.data.referrer, location.href,
                       'request.referrer should be passed to onfetch event.');
-        assert_equals(event.data.headers['user-agent'], undefined,
-                      'Default User-Agent header should not be passed to onfetch event.')
+        assert_equals(event.data.headers['user-agent'], navigator.userAgent,
+                      'User-Agent header should be passed to onfetch event.')
         assert_equals(event.data.errorNameWhileAppendingHeader, 'TypeError',
                       'Appending a new header to the request must throw a ' +
                       'TypeError.')
         service_worker_unregister_and_done(t, scope);
     }
 });
 </script>
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/request-end-to-end-worker.js
@@ -4,17 +4,16 @@ onmessage = function(e) {
   var message = e.data;
   if (typeof message === 'object' && 'port' in message) {
     port = message.port;
   }
 };
 
 onfetch = function(e) {
   var headers = {};
-  var errorNameWhileAppendingHeader;
   for (var header of e.request.headers) {
     var key = header[0], value = header[1];
     headers[key] = value;
   }
   var errorNameWhileAddingHeader = '';
   try {
     e.request.headers.append('Test-Header', 'TestValue');
   } catch (e) {