Feat: runtime profile override with getenv
[platform/framework/web/chromium-efl.git] / sql / vfs_wrapper_fuchsia.h
1 // Copyright 2019 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_FUCHSIA_H_
6 #define SQL_VFS_WRAPPER_FUCHSIA_H_
7
8 #include "third_party/sqlite/sqlite3.h"
9
10 namespace sql {
11
12 // Fuchsia doesn't provide a file locking mechanism like flock(). These
13 // functions are used to simulate file locking. On Fuchsia profile directories
14 // are not expected to be shared with other processes and therefore only one
15 // browser process may access sqlite files. These functions are designed to
16 // handle the case when the same sqlite database is open more than once from the
17 // same browser process. In most cases databases do not need to be open more
18 // than once, i.e. contention is expected to be rare, so the main goal of the
19 // design is simplicity and not performance. The manager maintains a list of all
20 // currently locked files.
21 int Lock(sqlite3_file* sqlite_file, int file_lock);
22 int Unlock(sqlite3_file* sqlite_file, int file_lock);
23 int CheckReservedLock(sqlite3_file* sqlite_file, int* result);
24
25 }  // namespace sql
26
27 #endif  // SQL_VFS_WRAPPER_FUCHSIA_H_