Bug 1265941 - Rename the ReferrerPolicy "origin-only" enum value to "origin"; r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 19 Apr 2016 20:16:39 -0400
changeset 332024 7672199e4347692cf5cd6bee43506502769a1d11
parent 332023 f8cc52e2b8f90ebe8982e927d31a0174c6bfe71e
child 332025 411f7ae1704d12648fab77210488692d23f42b74
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1265941
milestone48.0a1
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
Bug 1265941 - Rename the ReferrerPolicy "origin-only" enum value to "origin"; r=jdm
dom/cache/DBSchema.cpp
dom/fetch/FetchDriver.cpp
dom/webidl/Request.webidl
dom/workers/ServiceWorkerPrivate.cpp
testing/web-platform/tests/service-workers/service-worker/fetch-event.https.html
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -188,17 +188,17 @@ static_assert(int(HeadersGuardEnum::None
               int(HeadersGuardEnum::Request_no_cors) == 2 &&
               int(HeadersGuardEnum::Response) == 3 &&
               int(HeadersGuardEnum::Immutable) == 4 &&
               int(HeadersGuardEnum::EndGuard_) == 5,
               "HeadersGuardEnum values are as expected");
 static_assert(int(ReferrerPolicy::_empty) == 0 &&
               int(ReferrerPolicy::No_referrer) == 1 &&
               int(ReferrerPolicy::No_referrer_when_downgrade) == 2 &&
-              int(ReferrerPolicy::Origin_only) == 3 &&
+              int(ReferrerPolicy::Origin) == 3 &&
               int(ReferrerPolicy::Origin_when_cross_origin) == 4 &&
               int(ReferrerPolicy::Unsafe_url) == 5 &&
               int(ReferrerPolicy::EndGuard_) == 6,
               "ReferrerPolicy values are as expected");
 static_assert(int(RequestMode::Same_origin) == 0 &&
               int(RequestMode::No_cors) == 1 &&
               int(RequestMode::Cors) == 2 &&
               int(RequestMode::Navigate) == 3 &&
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -270,17 +270,17 @@ FetchDriver::HttpFetch()
       net_referrerPolicy = net::RP_Default;
       break;
     case ReferrerPolicy::No_referrer:
       net_referrerPolicy = net::RP_No_Referrer;
       break;
     case ReferrerPolicy::No_referrer_when_downgrade:
       net_referrerPolicy = net::RP_No_Referrer_When_Downgrade;
       break;
-    case ReferrerPolicy::Origin_only:
+    case ReferrerPolicy::Origin:
       net_referrerPolicy = net::RP_Origin;
       break;
     case ReferrerPolicy::Origin_when_cross_origin:
       net_referrerPolicy = net::RP_Origin_When_Crossorigin;
       break;
     case ReferrerPolicy::Unsafe_url:
       net_referrerPolicy = net::RP_Unsafe_URL;
       break;
--- a/dom/webidl/Request.webidl
+++ b/dom/webidl/Request.webidl
@@ -56,9 +56,9 @@ enum RequestContext {
   "sharedworker", "subresource", "style", "track", "video", "worker", "xmlhttprequest",
   "xslt"
 };
 
 enum RequestMode { "same-origin", "no-cors", "cors", "navigate" };
 enum RequestCredentials { "omit", "same-origin", "include" };
 enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache" };
 enum RequestRedirect { "follow", "error", "manual" };
-enum ReferrerPolicy { "", "no-referrer", "no-referrer-when-downgrade", "origin-only", "origin-when-cross-origin", "unsafe-url" };
+enum ReferrerPolicy { "", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url" };
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -1194,17 +1194,17 @@ public:
     uint32_t referrerPolicy = 0;
     rv = httpChannel->GetReferrerPolicy(&referrerPolicy);
     NS_ENSURE_SUCCESS(rv, rv);
     switch (referrerPolicy) {
     case nsIHttpChannel::REFERRER_POLICY_NO_REFERRER:
       mReferrerPolicy = ReferrerPolicy::No_referrer;
       break;
     case nsIHttpChannel::REFERRER_POLICY_ORIGIN:
-      mReferrerPolicy = ReferrerPolicy::Origin_only;
+      mReferrerPolicy = ReferrerPolicy::Origin;
       break;
     case nsIHttpChannel::REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE:
       mReferrerPolicy = ReferrerPolicy::No_referrer_when_downgrade;
       break;
     case nsIHttpChannel::REFERRER_POLICY_ORIGIN_WHEN_XORIGIN:
       mReferrerPolicy = ReferrerPolicy::Origin_when_cross_origin;
       break;
     case nsIHttpChannel::REFERRER_POLICY_UNSAFE_URL:
--- a/testing/web-platform/tests/service-workers/service-worker/fetch-event.https.html
+++ b/testing/web-platform/tests/service-workers/service-worker/fetch-event.https.html
@@ -109,37 +109,37 @@ function run_referrer_policy_tests(frame
       .then(function(response) { return response.text(); })
       .then(function(response_text) {
           assert_equals(
             response_text,
             'Referrer: about:client\n' +
             'ReferrerPolicy: no-referrer-when-downgrade',
             'Service Worker should respond to fetch with no referrer with ""');
           return frame.contentWindow.fetch('resources/simple.html?referrerFull',
-                                           {referrerPolicy: "origin-only", referrer: referrer});
+                                           {referrerPolicy: "origin", referrer: referrer});
         })
       .then(function(response) { return response.text(); })
       .then(function(response_text) {
           assert_equals(
             response_text,
             'Referrer: ' + origin + '/' + '\n' +
-            'ReferrerPolicy: origin-only',
-            'Service Worker should respond to fetch with the referrer origin with "origin-only" and a same origin request');
+            'ReferrerPolicy: origin',
+            'Service Worker should respond to fetch with the referrer origin with "origin" and a same origin request');
           var http_url = get_host_info()['HTTP_ORIGIN'] + base_path() +
                          '/resources/simple.html?referrerFull';
           return frame.contentWindow.fetch(http_url,
-                                           {referrerPolicy: "origin-only", referrer: referrer});
+                                           {referrerPolicy: "origin", referrer: referrer});
         })
       .then(function(response) { return response.text(); })
       .then(function(response_text) {
           assert_equals(
             response_text,
             'Referrer: ' + origin + '/' + '\n' +
-            'ReferrerPolicy: origin-only',
-            'Service Worker should respond to fetch with the referrer origin with "origin-only" and a cross origin request');
+            'ReferrerPolicy: origin',
+            'Service Worker should respond to fetch with the referrer origin with "origin" and a cross origin request');
           return frame.contentWindow.fetch('resources/simple.html?referrerFull',
                                            {referrerPolicy: "origin-when-cross-origin", referrer: referrer});
         })
       .then(function(response) { return response.text(); })
       .then(function(response_text) {
           assert_equals(
             response_text,
             'Referrer: ' + href + '\n' +