class DefaultSessionStorage : SessionStorage
(source)
Default implementation of SessionStorage which persists browser and engine session states to a JSON file.
The JSON format used for persisting: { "version": Int, "selectedSessionIndex": Int, "sessionStateTuples": {session{},engineSession{}},... }
DefaultSessionStorage(context: Context, savePeriodically: Boolean = true, saveIntervalInSeconds: Long = 300, scheduler: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor())
Default implementation of SessionStorage which persists browser and engine session states to a JSON file. |
fun clear(engine: Engine): Unit
Erases persisted SessionsSnapshot (if present) for a given Engine. |
|
fun persist(engine: Engine, snapshot: SessionsSnapshot): Boolean
Persists the provided SessionsSnapshot for a given Engine. SessionsSnapshot may be obtained using SessionManager.createSnapshot. Throws if snapshot is empty or otherwise incoherent. |
|
fun read(engine: Engine): SessionsSnapshot?
Returns the latest persisted sessions snapshot that may be used to read sessions. Resulting SessionsSnapshot may be restored via SessionManager.restore. |
|
fun start(sessionManager: SessionManager): Unit
Starts persisting the state frequently and automatically. |
|
fun stop(): Unit
Stops persisting the state automatically. |