[fenix] For https://github.com/mozilla-mobile/fenix/issues/1696 - Replace session bundle storage with session storage

pull/600/head
Jeff Boek 5 years ago
parent ac9b6fc726
commit e081fba700

@ -76,9 +76,8 @@ class Core(private val context: Context) {
GeckoViewFetchClient(context, runtime) GeckoViewFetchClient(context, runtime)
} }
val sessionStorage: SessionBundleStorage by lazy { val sessionStorage: SessionStorage by lazy {
SessionBundleStorage(context, bundleLifetime = Pair(BUNDLE_LIFETIME_IN_MINUTES, TimeUnit.MINUTES), SessionStorage(context, engine = engine)
engine = engine)
} }
/** /**
@ -92,7 +91,7 @@ class Core(private val context: Context) {
// Restore a previous, still active bundle. // Restore a previous, still active bundle.
GlobalScope.launch(Dispatchers.Main) { GlobalScope.launch(Dispatchers.Main) {
val snapshot = async(Dispatchers.IO) { val snapshot = async(Dispatchers.IO) {
sessionStorage.restore()?.restoreSnapshot() sessionStorage.restore()
} }
// There's an active bundle with a snapshot: Feed it into the SessionManager. // There's an active bundle with a snapshot: Feed it into the SessionManager.
@ -111,7 +110,6 @@ class Core(private val context: Context) {
.periodicallyInForeground(interval = 30, unit = TimeUnit.SECONDS) .periodicallyInForeground(interval = 30, unit = TimeUnit.SECONDS)
.whenGoingToBackground() .whenGoingToBackground()
.whenSessionsChange() .whenSessionsChange()
autoClose(sessionManager)
} }
} }
} }

Loading…
Cancel
Save