Deprecate SessionManager component

This commit is contained in:
Christian Sadilek 2021-02-18 13:31:00 -05:00
parent 2d87307144
commit e07f4ac590
3 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,7 @@ class Components(private val context: Context) {
} }
val services by lazyMonitored { Services(context, backgroundServices.accountManager) } val services by lazyMonitored { Services(context, backgroundServices.accountManager) }
val core by lazyMonitored { Core(context, analytics.crashReporter, strictMode) } val core by lazyMonitored { Core(context, analytics.crashReporter, strictMode) }
@Suppress("Deprecation")
val useCases by lazyMonitored { val useCases by lazyMonitored {
UseCases( UseCases(
context, context,
@ -66,6 +67,7 @@ class Components(private val context: Context) {
core.topSitesStorage core.topSitesStorage
) )
} }
@Suppress("Deprecation")
val intentProcessors by lazyMonitored { val intentProcessors by lazyMonitored {
IntentProcessors( IntentProcessors(
context, context,

View File

@ -201,10 +201,12 @@ class Core(
) )
} }
@Suppress("Deprecation")
private fun lookupSessionManager(): SessionManager { private fun lookupSessionManager(): SessionManager {
return sessionManager return sessionManager
} }
@Suppress("Deprecation")
private fun findSessionById(tabId: String): Session? { private fun findSessionById(tabId: String): Session? {
return sessionManager.findSessionById(tabId) return sessionManager.findSessionById(tabId)
} }
@ -227,6 +229,7 @@ class Core(
* sessions from the [SessionStorage], and with a default session (about:blank) in * sessions from the [SessionStorage], and with a default session (about:blank) in
* case all sessions/tabs are closed. * case all sessions/tabs are closed.
*/ */
@Deprecated("Use browser store (for reading) and use cases (for writing) instead")
val sessionManager by lazyMonitored { val sessionManager by lazyMonitored {
SessionManager(engine, store).also { SessionManager(engine, store).also {
// Install the "icons" WebExtension to automatically load icons for every visited website. // Install the "icons" WebExtension to automatically load icons for every visited website.

View File

@ -16,6 +16,7 @@ class TestComponents(private val context: Context) : Components(context) {
} }
override val services by lazy { Services(context, backgroundServices.accountManager) } override val services by lazy { Services(context, backgroundServices.accountManager) }
override val core by lazy { TestCore(context, analytics.crashReporter) } override val core by lazy { TestCore(context, analytics.crashReporter) }
@Suppress("Deprecation")
override val useCases by lazy { override val useCases by lazy {
UseCases( UseCases(
context, context,