[web-db] implement clearing sensitive data
Summary: Initial version of hook responsible for handling sensitive data.
Test Plan:
Tested on both web and desktop
- Make sure the user is logged out and there is no opened app
- IndexedDB storage should be empty
- And view shared workers (in Chrome it's URL chrome://inspect/#workers) and there shouldn't be anything connected to localhost.
- Log in
- console should log Database initialization success
- check indexedDB content
- see if worker was spawned
- see Worker logs (it's separate console)
- it should say Creating fresh database - Db version: 0
- Close the tab
- worker should die (not listed)
- Open the tab
- console should log Database initialization success
- see if worker was spawned
- see Worker logs - it should say Database exists and is properly encrypted, using persisted data
- Log out
- IndexedDB content should be deleted
- worker is alive until tab is opened
Reviewers: michal, tomek, marcin
Reviewed By: tomek, marcin
Subscribers: ashoat, atul
Differential Revision: https://phab.comm.dev/D7191