| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/webdatabase/sqlite/SQLiteFileSystem.h" | 32 #include "modules/webdatabase/sqlite/SQLiteFileSystem.h" |
| 33 | 33 |
| 34 #include <sqlite3.h> | 34 #include <sqlite3.h> |
| 35 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 36 | 36 |
| 37 #include <fcntl.h> | 37 #include <fcntl.h> |
| 38 #include <string.h> | 38 #include <string.h> |
| 39 #include <unistd.h> | 39 #include <unistd.h> |
| 40 | 40 |
| 41 using namespace WebCore; | 41 using namespace blink; |
| 42 | 42 |
| 43 // Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c | 43 // Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c |
| 44 extern "C" { | 44 extern "C" { |
| 45 void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file); | 45 void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file); |
| 46 int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* vfs, int fd, int dir
fd, sqlite3_file* file, const char* fileName, int noLock); | 46 int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* vfs, int fd, int dir
fd, sqlite3_file* file, const char* fileName, int noLock); |
| 47 int chromium_sqlite3_get_reusable_file_handle(sqlite3_file* file, const char* fi
leName, int flags, int* fd); | 47 int chromium_sqlite3_get_reusable_file_handle(sqlite3_file* file, const char* fi
leName, int flags, int* fd); |
| 48 void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, in
t flags); | 48 void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, in
t flags); |
| 49 void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file); | 49 void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file); |
| 50 } | 50 } |
| 51 | 51 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 void* chromiumDlOpen(sqlite3_vfs*, const char*) | 159 void* chromiumDlOpen(sqlite3_vfs*, const char*) |
| 160 { | 160 { |
| 161 return 0; | 161 return 0; |
| 162 } | 162 } |
| 163 #else | 163 #else |
| 164 #define chromiumDlOpen 0 | 164 #define chromiumDlOpen 0 |
| 165 #endif // SQLITE_OMIT_LOAD_EXTENSION | 165 #endif // SQLITE_OMIT_LOAD_EXTENSION |
| 166 | 166 |
| 167 } // namespace | 167 } // namespace |
| 168 | 168 |
| 169 namespace WebCore { | 169 namespace blink { |
| 170 | 170 |
| 171 void SQLiteFileSystem::registerSQLiteVFS() | 171 void SQLiteFileSystem::registerSQLiteVFS() |
| 172 { | 172 { |
| 173 sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix"); | 173 sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix"); |
| 174 static sqlite3_vfs chromium_vfs = { | 174 static sqlite3_vfs chromium_vfs = { |
| 175 1, | 175 1, |
| 176 unix_vfs->szOsFile, | 176 unix_vfs->szOsFile, |
| 177 unix_vfs->mxPathname, | 177 unix_vfs->mxPathname, |
| 178 0, | 178 0, |
| 179 "chromium_vfs", | 179 "chromium_vfs", |
| 180 unix_vfs->pAppData, | 180 unix_vfs->pAppData, |
| 181 chromiumOpen, | 181 chromiumOpen, |
| 182 chromiumDelete, | 182 chromiumDelete, |
| 183 chromiumAccess, | 183 chromiumAccess, |
| 184 chromiumFullPathname, | 184 chromiumFullPathname, |
| 185 chromiumDlOpen, | 185 chromiumDlOpen, |
| 186 unix_vfs->xDlError, | 186 unix_vfs->xDlError, |
| 187 unix_vfs->xDlSym, | 187 unix_vfs->xDlSym, |
| 188 unix_vfs->xDlClose, | 188 unix_vfs->xDlClose, |
| 189 unix_vfs->xRandomness, | 189 unix_vfs->xRandomness, |
| 190 unix_vfs->xSleep, | 190 unix_vfs->xSleep, |
| 191 unix_vfs->xCurrentTime, | 191 unix_vfs->xCurrentTime, |
| 192 unix_vfs->xGetLastError | 192 unix_vfs->xGetLastError |
| 193 }; | 193 }; |
| 194 sqlite3_vfs_register(&chromium_vfs, 0); | 194 sqlite3_vfs_register(&chromium_vfs, 0); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace WebCore | 197 } // namespace blink |
| OLD | NEW |