This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-91.12.0esr-12.0-1
in repository tor-browser.
The following commit(s) were added to refs/heads/tor-browser-91.12.0esr-12.0-1 by this push:
new 4101a6cde2358 fixup! Bug 40926: Implemented the New Identity feature
4101a6cde2358 is described below
commit 4101a6cde23588f852b6034489bbedcdd1307941
Author: Pier Angelo Vendrame <pierov(a)torproject.org>
AuthorDate: Mon Aug 8 16:27:08 2022 +0200
fixup! Bug 40926: Implemented the New Identity feature
Bug 40999: Update "cleared data" on New Identity
---
.../components/newidentity/content/newidentity.js | 61 +++++++++++-----------
1 file changed, 30 insertions(+), 31 deletions(-)
diff --git a/browser/components/newidentity/content/newidentity.js b/browser/components/newidentity/content/newidentity.js
index 74cfd26036fcd..7fe62cf1e5b7e 100644
--- a/browser/components/newidentity/content/newidentity.js
+++ b/browser/components/newidentity/content/newidentity.js
@@ -133,8 +133,9 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
this.clearOCSPCache();
this.clearSecuritySettings();
this.clearImageCaches();
- await this.clearStorage();
+ this.clearStorage();
this.clearPreferencesAndPermissions();
+ await this.clearData();
this.clearConnections();
this.clearPrivateSession();
}
@@ -152,7 +153,9 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
closeTabs() {
logger.info("Closing tabs");
- if (!Services.prefs.getBoolPref("extensions.torbutton.close_newnym", true)) {
+ if (
+ !Services.prefs.getBoolPref("extensions.torbutton.close_newnym", true)
+ ) {
logger.info("Not closing tabs");
return;
}
@@ -228,7 +231,12 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
}
clearHTTPAuths() {
- if (!Services.prefs.getBoolPref("extensions.torbutton.clear_http_auth", true)) {
+ if (
+ !Services.prefs.getBoolPref(
+ "extensions.torbutton.clear_http_auth",
+ true
+ )
+ ) {
logger.info("Skipping HTTP Auths, because disabled");
return;
}
@@ -269,22 +277,6 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
sss.clearAll();
}
- async clearData(flags) {
- return new Promise((resolve, reject) => {
- Services.clearData.deleteData(flags, {
- onDataDeleted(code) {
- if (code === Cr.NS_OK) {
- resolve();
- } else {
- reject(
- new Error(`Error deleting data with flags ${flags}: ${code}`)
- );
- }
- },
- });
- });
- }
-
clearImageCaches() {
logger.info("Clearing Image Cache");
// In Firefox 18 and newer, there are two image caches: one that is used
@@ -345,7 +337,7 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
}
}
- async clearStorage() {
+ clearStorage() {
logger.info("Clearing Disk and Memory Caches");
try {
Services.cache2.clear();
@@ -353,17 +345,6 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
logger.error("Exception on cache clearing", e);
}
- logger.info("Clearing storage, media devices and predictor network data");
- try {
- await this.clearData(
- Services.clearData.CLEAR_DOM_STORAGES |
- Services.clearData.CLEAR_MEDIA_DEVICES |
- Services.clearData.CLEAR_PREDICTOR_NETWORK_DATA
- );
- } catch (e) {
- logger.error("Exception on storage clearing", e);
- }
-
logger.info("Clearing Cookies and DOM Storage");
Services.cookies.removeAll();
}
@@ -396,6 +377,24 @@ XPCOMUtils.defineLazyGetter(this, "NewIdentityButton", () => {
Services.prefs.savePrefFile(null);
}
+ async clearData() {
+ logger.info("Calling the clearDataService");
+ const flags =
+ Services.clearData.CLEAR_ALL ^ Services.clearData.CLEAR_PASSWORDS;
+ return new Promise((resolve, reject) => {
+ Services.clearData.deleteData(flags, {
+ onDataDeleted(code) {
+ if (code !== Cr.NS_OK) {
+ logger.error(`Error while calling the clearDataService: ${code}`);
+ }
+ // We always resolve, because we do not want to interrupt the new
+ // identity procedure.
+ resolve();
+ },
+ });
+ });
+ }
+
clearConnections() {
logger.info("Closing open connections");
// Clear keep-alive
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.