Merge m-c to inbound.

This commit is contained in:
Ryan VanderMeulen 2013-04-23 20:50:28 -04:00
commit b1843e1c3c
6 changed files with 25 additions and 11 deletions

View File

@ -2,6 +2,11 @@
* 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/. */
// Equivalent to 0600 permissions; used for saved Sync Recovery Key.
// This constant can be replaced when the equivalent values are available to
// chrome JS; see Bug 433295 and Bug 757351.
const PERMISSIONS_RWUSR = 0x180;
// Weave should always exist before before this file gets included.
let gSyncUtils = {
get bundle() {
@ -157,7 +162,7 @@ let gSyncUtils = {
aResult == Ci.nsIFilePicker.returnReplace) {
let stream = Cc["@mozilla.org/network/file-output-stream;1"].
createInstance(Ci.nsIFileOutputStream);
stream.init(fp.file, -1, 0600, 0);
stream.init(fp.file, -1, PERMISSIONS_RWUSR, 0);
let serializer = new XMLSerializer();
let output = serializer.serializeToString(iframe.contentDocument);

View File

@ -504,6 +504,8 @@ AbstractHealthReporter.prototype = Object.freeze({
}
return Task.spawn(function doCollection() {
yield this._providerManager.ensurePullOnlyProvidersRegistered();
try {
TelemetryStopwatch.start(TELEMETRY_COLLECT_CONSTANT, this);
yield this._providerManager.collectConstantData();
@ -535,6 +537,8 @@ AbstractHealthReporter.prototype = Object.freeze({
}
}
yield this._providerManager.ensurePullOnlyProvidersUnregistered();
// Flush gathered data to disk. This will incur an fsync. But, if
// there is ever a time we want to persist data to disk, it's
// after a massive collection.
@ -634,6 +638,11 @@ AbstractHealthReporter.prototype = Object.freeze({
let pingDateString = this._formatDate(now);
this._log.info("Producing JSON payload for " + pingDateString);
// May not be present if we are generating as a result of init error.
if (this._providerManager) {
yield this._providerManager.ensurePullOnlyProvidersRegistered();
}
let o = {
version: 2,
thisPingDate: pingDateString,
@ -762,6 +771,10 @@ AbstractHealthReporter.prototype = Object.freeze({
TelemetryStopwatch.finish(TELEMETRY_JSON_PAYLOAD_SERIALIZE, this);
}
if (this._providerManager) {
yield this._providerManager.ensurePullOnlyProvidersUnregistered();
}
throw new Task.Result(o);
},

View File

@ -197,11 +197,7 @@ add_task(function test_pull_only_providers() {
do_check_neq(reporter.getProvider("DummyProvider"), null);
do_check_null(reporter.getProvider("DummyConstantProvider"));
yield reporter._providerManager.ensurePullOnlyProvidersRegistered();
do_check_eq(reporter._providerManager._providers.size, 2);
do_check_true(reporter._storage.hasProvider("DummyConstantProvider"));
yield reporter.collectMeasurements();
yield reporter._providerManager.ensurePullOnlyProvidersUnregistered();
do_check_eq(reporter._providerManager._providers.size, 1);
do_check_true(reporter._storage.hasProvider("DummyConstantProvider"));

View File

@ -23,7 +23,7 @@ var prefs1 = [
{ name: "browser.urlbar.maxRichResults",
value: 20
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: true
}
];
@ -35,7 +35,7 @@ var prefs2 = [
{ name: "browser.urlbar.maxRichResults",
value: 18
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: false
}
];

View File

@ -108,7 +108,7 @@ var prefs1 = [
{ name: "browser.urlbar.maxRichResults",
value: 20
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: true
}
];
@ -120,7 +120,7 @@ var prefs2 = [
{ name: "browser.urlbar.maxRichResults",
value: 18
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: false
}
];

View File

@ -19,7 +19,7 @@ var prefs1 = [
{ name: "browser.urlbar.maxRichResults",
value: 20
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: true
}
];
@ -31,7 +31,7 @@ var prefs2 = [
{ name: "browser.urlbar.maxRichResults",
value: 18
},
{ name: "browser.link.open_newwindow",
{ name: "security.OCSP.require",
value: false
}
];