Feat: runtime profile override with getenv
[platform/framework/web/chromium-efl.git] / sql / vfs_wrapper.h
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SQL_VFS_WRAPPER_H_
6 #define SQL_VFS_WRAPPER_H_
7
8 #include <string>
9
10 #include "base/memory/raw_ptr_exclusion.h"
11 #include "build/build_config.h"
12 #include "third_party/sqlite/sqlite3.h"
13
14 namespace sql {
15
16 // A wrapper around the default VFS.
17 //
18 // On OSX, the wrapper propagates Time Machine exclusions from the main database
19 // file to associated files such as journals. <http://crbug.com/23619> and
20 // <http://crbug.com/25959> and others.
21 //
22 // On Fuchsia the wrapper adds in-process file locking (Fuchsia doesn't support
23 // file locking).
24 //
25 // TODO(shess): On Windows, wrap xFetch() with a structured exception handler.
26 sqlite3_vfs* VFSWrapper();
27
28 // Internal representation of sqlite3_file for VFSWrapper.
29 struct VfsFile {
30   // This field is not a raw_ptr<> because it was filtered by the rewriter for:
31   // #reinterpret-cast-trivial-type
32   RAW_PTR_EXCLUSION const sqlite3_io_methods* methods;
33   // This field is not a raw_ptr<> because it was filtered by the rewriter for:
34   // #reinterpret-cast-trivial-type
35   RAW_PTR_EXCLUSION sqlite3_file* wrapped_file;
36 #if BUILDFLAG(IS_FUCHSIA)
37   std::string file_name;
38 #endif
39 };
40
41 }  // namespace sql
42
43 #endif  // SQL_VFS_WRAPPER_H_