vfs_wrapper.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SQL_VFS_WRAPPER_H_
  5. #define SQL_VFS_WRAPPER_H_
  6. #include <string>
  7. #include "build/build_config.h"
  8. #include "third_party/sqlite/sqlite3.h"
  9. namespace sql {
  10. // A wrapper around the default VFS.
  11. //
  12. // On OSX, the wrapper propagates Time Machine exclusions from the main database
  13. // file to associated files such as journals. <http://crbug.com/23619> and
  14. // <http://crbug.com/25959> and others.
  15. //
  16. // On Fuchsia the wrapper adds in-process file locking (Fuchsia doesn't support
  17. // file locking).
  18. //
  19. // TODO(shess): On Windows, wrap xFetch() with a structured exception handler.
  20. sqlite3_vfs* VFSWrapper();
  21. // Internal representation of sqlite3_file for VFSWrapper.
  22. struct VfsFile {
  23. const sqlite3_io_methods* methods;
  24. sqlite3_file* wrapped_file;
  25. #if BUILDFLAG(IS_FUCHSIA)
  26. std::string file_name;
  27. #endif
  28. };
  29. } // namespace sql
  30. #endif // SQL_VFS_WRAPPER_H_