Bug 902121 - Do not normalize missing referrer URIs. r=Yoric
authorBen Kelly <ben@wanderview.com>
Tue, 26 Nov 2013 17:30:46 -0500
changeset 157673 4704a41581c6ba49604ac185710a0f80c3274739
parent 157672 a1523aeef7d8268d99538c230814de03b2780702
child 157674 623708981907522405aca59408aaf17e533954ef
push id25719
push usercbook@mozilla.com
push dateWed, 27 Nov 2013 09:57:23 +0000
treeherdermozilla-central@2e3d89ed5dc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs902121
milestone28.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 902121 - Do not normalize missing referrer URIs. r=Yoric
toolkit/components/telemetry/ThirdPartyCookieProbe.jsm
--- a/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm
+++ b/toolkit/components/telemetry/ThirdPartyCookieProbe.jsm
@@ -71,17 +71,19 @@ this.ThirdPartyCookieProbe.prototype = {
         this.dispose();
       }
       if (topic != "third-party-cookie-accepted"
           && topic != "third-party-cookie-rejected") {
         // Not a third-party cookie
         return;
       }
       // Add host to this._thirdPartyCookies
-      let firstParty = normalizeHost(referrer);
+      // Note: nsCookieService passes "?" if the issuer is unknown.  Avoid
+      //       normalizing in this case since its not a valid URI.
+      let firstParty = (referrer === "?") ? referrer : normalizeHost(referrer);
       let thirdParty = normalizeHost(docURI.QueryInterface(Ci.nsIURI).host);
       let data = this._thirdPartyCookies.get(thirdParty);
       if (!data) {
         data = new RejectStats();
         this._thirdPartyCookies.set(thirdParty, data);
       }
       if (topic == "third-party-cookie-accepted") {
         data.addAccepted(firstParty);