Bug 1208376 - Disable v2 data upload in Firefox 42+. r=gfritzsche
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Fri, 25 Sep 2015 06:02:00 +0200
changeset 264461 a39fdef2430076b3fd399aefc8d01aa309a0cecc
parent 264460 a5156dc31261fc8c1034086e770fc8a2289cbf68
child 264462 881864ab2ba45c4a3b57bc7fafff2d25022c519f
push id29443
push usercbook@mozilla.com
push dateMon, 28 Sep 2015 12:12:37 +0000
treeherdermozilla-central@3323f5c35ed3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1208376
milestone44.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 1208376 - Disable v2 data upload in Firefox 42+. r=gfritzsche
services/datareporting/datareporting-prefs.js
services/datareporting/policy.jsm
--- a/services/datareporting/datareporting-prefs.js
+++ b/services/datareporting/datareporting-prefs.js
@@ -1,12 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 pref("datareporting.policy.dataSubmissionEnabled", true);
+pref("datareporting.policy.dataSubmissionEnabled.v2", true);
 pref("datareporting.policy.firstRunTime", "0");
 pref("datareporting.policy.dataSubmissionPolicyNotifiedTime", "0");
 pref("datareporting.policy.dataSubmissionPolicyAcceptedVersion", 0);
 pref("datareporting.policy.dataSubmissionPolicyBypassNotification", false);
 pref("datareporting.policy.currentPolicyVersion", 2);
 pref("datareporting.policy.minimumPolicyVersion", 1);
 pref("datareporting.policy.minimumPolicyVersion.channel-beta", 2);
--- a/services/datareporting/policy.jsm
+++ b/services/datareporting/policy.jsm
@@ -373,16 +373,26 @@ this.DataReportingPolicy.prototype = Obj
     // Default is true because we are opt-out.
     return this._prefs.get("dataSubmissionEnabled", true);
   },
 
   set dataSubmissionEnabled(value) {
     this._prefs.set("dataSubmissionEnabled", !!value);
   },
 
+  /**
+   * Whether submission of data is allowed for v2.
+   *
+   * This is used to gently turn off data submission for FHR v2 in Firefox 42+.
+   */
+  get dataSubmissionEnabledV2() {
+    // Default is true because we are opt-out.
+    return this._prefs.get("dataSubmissionEnabled.v2", true);
+  },
+
   get currentPolicyVersion() {
     return this._prefs.get("currentPolicyVersion", DATAREPORTING_POLICY_VERSION);
   },
 
   /**
    * The minimum policy version which for dataSubmissionPolicyAccepted to
    * to be valid.
    */
@@ -643,17 +653,17 @@ this.DataReportingPolicy.prototype = Obj
    *
    * Typically this function is called automatically by the background polling.
    * But, it can safely be called manually as needed.
    */
   checkStateAndTrigger: function checkStateAndTrigger() {
     // If the master data submission kill switch is toggled, we have nothing
     // to do. We don't notify about data policies because this would have
     // no effect.
-    if (!this.dataSubmissionEnabled) {
+    if (!this.dataSubmissionEnabled || !this.dataSubmissionEnabledV2) {
       this._log.debug("Data submission is disabled. Doing nothing.");
       return;
     }
 
     let now = this.now();
     let nowT = now.getTime();
     let nextSubmissionDate = this.nextDataSubmissionDate;