Bug 1321303 - Part 5: Implement browsingData.removeFormData, r=aswan

MozReview-Commit-ID: aK6m7vl3i1
This commit is contained in:
Bob Silverberg
2016-12-14 14:29:57 -05:00
parent c8b6355fd6
commit 56cc7b6721
4 changed files with 149 additions and 1 deletions

View File

@@ -72,6 +72,10 @@ function clearDownloads(options) {
return sanitizer.items.downloads.clear(makeRange(options));
}
function clearFormData(options) {
return sanitizer.items.formdata.clear(makeRange(options));
}
function clearHistory(options) {
return sanitizer.items.history.clear(makeRange(options));
}
@@ -97,6 +101,9 @@ function doRemoval(options, dataToRemove, extension) {
case "downloads":
removalPromises.push(clearDownloads(options));
break;
case "formData":
removalPromises.push(clearFormData(options));
break;
case "history":
removalPromises.push(clearHistory(options));
break;
@@ -154,6 +161,9 @@ extensions.registerSchemaAPI("browsingData", "addon_parent", context => {
removeDownloads(options) {
return doRemoval(options, {downloads: true});
},
removeFormData(options) {
return doRemoval(options, {formData: true});
},
removeHistory(options) {
return doRemoval(options, {history: true});
},