2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/12980 - Unify deleteBrowsingData() and deleteHistoryAndDOMStorages()

The two methods are serving the same purpose, with one calling the other.
This prepares the ground for adding a method to delete icons in only one place
and remove confusion about what that place should be.
This commit is contained in:
Mugurell 2020-08-26 18:03:23 +03:00 committed by Mihai Adrian Carare
parent e812181ec3
commit 6a06883e22
2 changed files with 2 additions and 7 deletions

View File

@ -53,7 +53,7 @@ fun deleteAndQuit(activity: Activity, coroutineScope: CoroutineScope, snackbar:
private suspend fun DeleteBrowsingDataController.deleteType(type: DeleteBrowsingDataOnQuitType) {
when (type) {
DeleteBrowsingDataOnQuitType.TABS -> deleteTabs()
DeleteBrowsingDataOnQuitType.HISTORY -> deleteHistoryAndDOMStorages()
DeleteBrowsingDataOnQuitType.HISTORY -> deleteBrowsingData()
DeleteBrowsingDataOnQuitType.COOKIES -> deleteCookies()
DeleteBrowsingDataOnQuitType.CACHE -> deleteCachedFiles()
DeleteBrowsingDataOnQuitType.PERMISSIONS -> withContext(IO) {

View File

@ -15,7 +15,6 @@ import kotlin.coroutines.CoroutineContext
interface DeleteBrowsingDataController {
suspend fun deleteTabs()
suspend fun deleteBrowsingData()
suspend fun deleteHistoryAndDOMStorages()
suspend fun deleteCookies()
suspend fun deleteCachedFiles()
suspend fun deleteSitePermissions()
@ -36,14 +35,10 @@ class DefaultDeleteBrowsingDataController(
}
override suspend fun deleteBrowsingData() {
deleteHistoryAndDOMStorages()
}
override suspend fun deleteHistoryAndDOMStorages() {
withContext(coroutineContext) {
engine.clearData(Engine.BrowsingData.select(Engine.BrowsingData.DOM_STORAGES))
historyStorage.deleteEverything()
}
historyStorage.deleteEverything()
}
override suspend fun deleteCookies() {