tree: b6ea13ddf381aa0f84f8c388a2537319632b93d6 [path history] [tgz]
  1. mojom/
  2. BUILD.gn
  3. client.h
  4. constants.h
  5. DEPS
  6. file_type.h
  7. lock_state.h
  8. metrics_util.cc
  9. metrics_util.h
  10. OWNERS
  11. pending_file_set.cc
  12. pending_file_set.h
  13. README.md
  14. sandboxed_file.cc
  15. sandboxed_file.h
  16. sandboxed_file_unittest.cc
  17. sqlite_database_vfs_file_set.cc
  18. sqlite_database_vfs_file_set.h
  19. sqlite_database_vfs_file_set_unittest.cc
  20. sqlite_sandboxed_vfs.cc
  21. sqlite_sandboxed_vfs.h
  22. sqlite_sandboxed_vfs_unittest.cc
  23. vfs_utils.cc
  24. vfs_utils.h
components/sqlite_vfs/README.md

SQLite VFS

This component provides a sandboxed SQLite Virtual File System (VFS). It is used by components/persistent_cache to provide a sandboxed SQLite database access.

Usage

A trusted process (that can access the filesystem) can create a PendingFileSet object. This PendingFileSet object is then used by clients to connect to a database in a sandboxed process.

persistent_cache::PersistentCache is one such client that utilizes a PendingFileSet. Specifically, persistent_cache::SqliteBackendImpl (located in components/persistent_cache/sqlite/sqlite_backend_impl.cc) takes a PendingFileSet, registers the SqliteVfsFileSet with SqliteSandboxedVfsDelegate::RegisterSandboxedFiles(), and then opens the database using sql::Database with the virtual file path returned by SqliteVfsFileSet::GetDbVirtualFilePath(), allowing access from a sandboxed process.