Chromium Code Reviews| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 } | 151 } |
| 152 | 152 |
| 153 int chromiumCurrentTime(sqlite3_vfs *vfs, double *prNow) | 153 int chromiumCurrentTime(sqlite3_vfs *vfs, double *prNow) |
| 154 { | 154 { |
| 155 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 155 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); |
| 156 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); | 156 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); |
| 157 } | 157 } |
| 158 | 158 |
| 159 int chromiumGetLastError(sqlite3_vfs *vfs, int e, char* s) | 159 int chromiumGetLastError(sqlite3_vfs *vfs, int e, char* s) |
| 160 { | 160 { |
| 161 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 161 return SQLITE_ERROR; |
|
michaeln
2016/01/26 21:59:34
What's going on with this function? Can you update
Scott Hess - ex-Googler
2016/01/26 23:44:24
OK.
SQLite introduced this at one point and then
| |
| 162 return wrappedVfs->xGetLastError(wrappedVfs, e, s); | |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace | 164 } // namespace |
| 166 | 165 |
| 167 void SQLiteFileSystem::registerSQLiteVFS() | 166 void SQLiteFileSystem::registerSQLiteVFS() |
| 168 { | 167 { |
| 169 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32"); | 168 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32"); |
| 169 | |
| 170 // These are implemented by delegating to |wrappedVfs|. | |
| 171 // TODO(shess): Implement local versions. | |
| 172 ASSERT(wrappedVfs->xRandomness); | |
| 173 ASSERT(wrappedVfs->xSleep); | |
| 174 ASSERT(wrappedVfs->xCurrentTime); | |
| 175 | |
| 170 static sqlite3_vfs chromium_vfs = { | 176 static sqlite3_vfs chromium_vfs = { |
| 171 1, | 177 1, |
| 172 wrappedVfs->szOsFile, | 178 wrappedVfs->szOsFile, |
| 173 wrappedVfs->mxPathname, | 179 wrappedVfs->mxPathname, |
| 174 0, | 180 0, |
| 175 "chromium_vfs", | 181 "chromium_vfs", |
| 176 wrappedVfs, | 182 wrappedVfs, |
| 177 chromiumOpen, | 183 chromiumOpen, |
| 178 chromiumDelete, | 184 chromiumDelete, |
| 179 chromiumAccess, | 185 chromiumAccess, |
| 180 chromiumFullPathname, | 186 chromiumFullPathname, |
| 181 chromiumDlOpen, | 187 chromiumDlOpen, |
| 182 chromiumDlError, | 188 chromiumDlError, |
| 183 chromiumDlSym, | 189 chromiumDlSym, |
| 184 chromiumDlClose, | 190 chromiumDlClose, |
| 185 chromiumRandomness, | 191 chromiumRandomness, |
| 186 chromiumSleep, | 192 chromiumSleep, |
| 187 chromiumCurrentTime, | 193 chromiumCurrentTime, |
| 188 chromiumGetLastError | 194 chromiumGetLastError |
| 189 }; | 195 }; |
| 190 sqlite3_vfs_register(&chromium_vfs, 0); | 196 sqlite3_vfs_register(&chromium_vfs, 0); |
| 191 } | 197 } |
| 192 | 198 |
| 193 } // namespace blink | 199 } // namespace blink |
| OLD | NEW |