OLD | NEW |
1 The WebDatabase implementation in the renderer users a custom vfs to | 1 The WebDatabase implementation in the renderer users a custom vfs to |
2 broker file open and other requests. This modifies the built-in vfs | 2 broker file open and other requests. This modifies the built-in vfs |
3 implementation to let that code share much of the implementation | 3 implementation to let that code share much of the implementation |
4 details. | 4 details. |
5 | 5 |
6 diff --git src/os_unix.c src/os_unix.c | 6 diff --git src/os_unix.c src/os_unix.c |
7 index ef04a72..e5e1509 100644 | 7 index ef04a72..e5e1509 100644 |
8 --- src/os_unix.c | 8 --- src/os_unix.c |
9 +++ src/os_unix.c | 9 +++ src/os_unix.c |
10 @@ -3496,9 +3496,16 @@ typedef const sqlite3_io_methods *(*finder_type)(const ch
ar*,unixFile*); | 10 @@ -3496,9 +3496,16 @@ typedef const sqlite3_io_methods *(*finder_type)(const ch
ar*,unixFile*); |
(...skipping 24 matching lines...) Expand all Loading... |
35 + memset(file, 0, sizeof(unixFile)); | 35 + memset(file, 0, sizeof(unixFile)); |
36 +} | 36 +} |
37 + | 37 + |
38 +int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* vfs, | 38 +int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* vfs, |
39 + int fd, | 39 + int fd, |
40 + int dirfd, | 40 + int dirfd, |
41 + sqlite3_file* file, | 41 + sqlite3_file* file, |
42 + const char* fileName, | 42 + const char* fileName, |
43 + int noLock, | 43 + int noLock, |
44 + int isDelete) { | 44 + int isDelete) { |
45 + return fillInUnixFile(vfs, fd, dirfd, file, fileName, noLock, isDelete); | 45 + return fillInUnixFile(vfs, fd, dirfd, file, fileName, noLock, isDelete, 0); |
46 +} | 46 +} |
47 + | 47 + |
48 +/* | 48 +/* |
49 +** Search for an unused file descriptor that was opened on the database file. | 49 +** Search for an unused file descriptor that was opened on the database file. |
50 +** If a suitable file descriptor if found, then it is stored in *fd; otherwise, | 50 +** If a suitable file descriptor if found, then it is stored in *fd; otherwise, |
51 +** *fd is not modified. | 51 +** *fd is not modified. |
52 +** | 52 +** |
53 +** If a reusable file descriptor is not found, and a new UnixUnusedFd cannot | 53 +** If a reusable file descriptor is not found, and a new UnixUnusedFd cannot |
54 +** be allocated, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK is returned. | 54 +** be allocated, SQLITE_NOMEM is returned. Otherwise, SQLITE_OK is returned. |
55 +*/ | 55 +*/ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 | 155 |
156 +void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE ha
ndle) { | 156 +void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE ha
ndle) { |
157 + winFile* winSQLite3File = (winFile*)file; | 157 + winFile* winSQLite3File = (winFile*)file; |
158 + memset(file, 0, sizeof(*file)); | 158 + memset(file, 0, sizeof(*file)); |
159 + winSQLite3File->pMethod = &winIoMethod; | 159 + winSQLite3File->pMethod = &winIoMethod; |
160 + winSQLite3File->h = handle; | 160 + winSQLite3File->h = handle; |
161 +} | 161 +} |
162 + | 162 + |
163 #endif /* SQLITE_OS_WIN */ | 163 #endif /* SQLITE_OS_WIN */ |
OLD | NEW |