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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
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 <windows.h> | 34 #include <windows.h> |
35 #include <sqlite3.h> | 35 #include <sqlite3.h> |
36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
37 | 37 |
38 using namespace WebCore; | 38 using namespace blink; |
39 | 39 |
40 // Defined in Chromium's codebase in third_party/sqlite/src/os_win.c | 40 // Defined in Chromium's codebase in third_party/sqlite/src/os_win.c |
41 extern "C" { | 41 extern "C" { |
42 int chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE hand
le); | 42 int chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE hand
le); |
43 } | 43 } |
44 | 44 |
45 // Chromium's Windows implementation of SQLite VFS | 45 // Chromium's Windows implementation of SQLite VFS |
46 namespace { | 46 namespace { |
47 | 47 |
48 // Opens a file. | 48 // Opens a file. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void* chromiumDlOpen(sqlite3_vfs*, const char*) | 131 void* chromiumDlOpen(sqlite3_vfs*, const char*) |
132 { | 132 { |
133 return 0; | 133 return 0; |
134 } | 134 } |
135 #else | 135 #else |
136 #define chromiumDlOpen 0 | 136 #define chromiumDlOpen 0 |
137 #endif // SQLITE_OMIT_LOAD_EXTENSION | 137 #endif // SQLITE_OMIT_LOAD_EXTENSION |
138 | 138 |
139 } // namespace | 139 } // namespace |
140 | 140 |
141 namespace WebCore { | 141 namespace blink { |
142 | 142 |
143 void SQLiteFileSystem::registerSQLiteVFS() | 143 void SQLiteFileSystem::registerSQLiteVFS() |
144 { | 144 { |
145 sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32"); | 145 sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32"); |
146 static sqlite3_vfs chromium_vfs = { | 146 static sqlite3_vfs chromium_vfs = { |
147 1, | 147 1, |
148 win32_vfs->szOsFile, | 148 win32_vfs->szOsFile, |
149 win32_vfs->mxPathname, | 149 win32_vfs->mxPathname, |
150 0, | 150 0, |
151 "chromium_vfs", | 151 "chromium_vfs", |
152 win32_vfs->pAppData, | 152 win32_vfs->pAppData, |
153 chromiumOpen, | 153 chromiumOpen, |
154 chromiumDelete, | 154 chromiumDelete, |
155 chromiumAccess, | 155 chromiumAccess, |
156 chromiumFullPathname, | 156 chromiumFullPathname, |
157 chromiumDlOpen, | 157 chromiumDlOpen, |
158 win32_vfs->xDlError, | 158 win32_vfs->xDlError, |
159 win32_vfs->xDlSym, | 159 win32_vfs->xDlSym, |
160 win32_vfs->xDlClose, | 160 win32_vfs->xDlClose, |
161 win32_vfs->xRandomness, | 161 win32_vfs->xRandomness, |
162 win32_vfs->xSleep, | 162 win32_vfs->xSleep, |
163 win32_vfs->xCurrentTime, | 163 win32_vfs->xCurrentTime, |
164 win32_vfs->xGetLastError | 164 win32_vfs->xGetLastError |
165 }; | 165 }; |
166 sqlite3_vfs_register(&chromium_vfs, 0); | 166 sqlite3_vfs_register(&chromium_vfs, 0); |
167 } | 167 } |
168 | 168 |
169 } // namespace WebCore | 169 } // namespace blink |
OLD | NEW |