Skip to content

Commit

Permalink
For mozilla-mobile#23731 - Use the disk cache for the Contile top sites
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielluong committed Feb 15, 2022
1 parent 8f4b303 commit 9c297b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions app/src/main/java/org/mozilla/fenix/components/Core.kt
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@ class Core(
}
val pocketStoriesService by lazyMonitored { PocketStoriesService(context, pocketStoriesConfig) }

val contileTopSitesProvider by lazyMonitored { ContileTopSitesProvider(client) }
val contileTopSitesProvider by lazyMonitored {
ContileTopSitesProvider(
context = context,
client = client,
maxCacheAgeInMinutes = CONTILE_MAX_CACHE_AGE
)
}

val topSitesStorage by lazyMonitored {
val defaultTopSites = mutableListOf<Pair<String, String>>()
Expand Down Expand Up @@ -459,10 +465,9 @@ class Core(
}

companion object {
private const val KEY_STRENGTH = 256
private const val KEY_STORAGE_NAME = "core_prefs"
private const val PASSWORDS_KEY = "passwords"
private const val RECENTLY_CLOSED_MAX = 10
const val HISTORY_METADATA_MAX_AGE_IN_MS = 14 * 24 * 60 * 60 * 1000 // 14 days
private const val CONTILE_MAX_CACHE_AGE = 60L // 60 minutes
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/AndroidComponents.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

object AndroidComponents {
const val VERSION = "99.0.20220214225657"
const val VERSION = "99.0.20220214232836"
}

0 comments on commit 9c297b3

Please sign in to comment.