Bug 849947 - Flush preferences after FHR document submission; r=glandium, rnewman; a=bajaj
authorGregory Szorc <gps@mozilla.com>
Fri, 15 Mar 2013 13:19:38 -0700
changeset 132450 f5d00a1b6731b94efab1887b9a586505fa72b594
parent 132449 4dd735a81d7f72013a78cce3bdec278db846d204
child 132451 939d9a29867777ceb7f185a2a6d0e8f95e7fea45
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, rnewman, bajaj
bugs849947
milestone21.0a2
Bug 849947 - Flush preferences after FHR document submission; r=glandium, rnewman; a=bajaj
services/healthreport/Makefile.in
services/healthreport/healthreporter.jsm
--- a/services/healthreport/Makefile.in
+++ b/services/healthreport/Makefile.in
@@ -29,22 +29,29 @@ healthreport_depends = \
   ../metrics/providermanager.jsm \
   ../metrics/dataprovider.jsm \
   ../metrics/storage.jsm \
   healthreporter.jsm \
   profile.jsm \
   providers.jsm \
   $(NULL)
 
+
+ifneq (,$(findstring a,$(GRE_MILESTONE)))
+extra_pp_flags := -DPRERELEASE_BUILD
+endif
+
 MAIN_JS_MODULE := HealthReport.jsm
 MAIN_JS_MODULE_PATH = $(FINAL_TARGET)/modules
+MAIN_JS_MODULE_FLAGS := $(extra_pp_flags)
 PP_TARGETS += MAIN_JS_MODULE
 
 MODULES := $(modules)
 MODULES_PATH = $(FINAL_TARGET)/modules/services/healthreport
+MODULES_FLAGS := $(extra_pp_flags)
 PP_TARGETS += MODULES
 
 TESTING_JS_MODULES := $(addprefix modules-testing/,$(testing_modules))
 TESTING_JS_MODULE_DIR := services/healthreport
 
 EXTRA_COMPONENTS := \
   HealthReportComponents.manifest \
   $(NULL)
--- a/services/healthreport/healthreporter.jsm
+++ b/services/healthreport/healthreporter.jsm
@@ -1121,16 +1121,26 @@ HealthReporter.prototype = Object.freeze
       this.lastSubmitID = null;
     } else {
       this.lastSubmitID = result.id;
       this.lastPingDate = now;
     }
 
     request.onSubmissionSuccess(now);
 
+#ifdef PRERELEASE_BUILD
+    // Intended to be temporary until we a) assess the impact b) bug 846133
+    // deploys more robust storage for state.
+    try {
+      Services.prefs.savePrefFile(null);
+    } catch (ex) {
+      this._log.warn("Error forcing prefs save: " + CommonUtils.exceptionStr(ex));
+    }
+#endif
+
     return promise;
   },
 
   _onSubmitDataRequestFailure: function (error) {
     this._log.error("Error processing request to submit data: " +
                     CommonUtils.exceptionStr(error));
   },