| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 296 } |
| 297 | 297 |
| 298 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) | 298 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) |
| 299 { | 299 { |
| 300 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 300 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); |
| 301 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); | 301 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); |
| 302 } | 302 } |
| 303 | 303 |
| 304 int chromiumGetLastError(sqlite3_vfs* vfs, int e, char* s) | 304 int chromiumGetLastError(sqlite3_vfs* vfs, int e, char* s) |
| 305 { | 305 { |
| 306 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 306 // xGetLastError() has never been used by SQLite. The implementation in os_
win.c indicates this is a reasonable implementation. |
| 307 return wrappedVfs->xGetLastError(wrappedVfs, e, s); | 307 *s = '\0'; |
| 308 return 0; |
| 308 } | 309 } |
| 309 | 310 |
| 310 } // namespace | 311 } // namespace |
| 311 | 312 |
| 312 void SQLiteFileSystem::registerSQLiteVFS() | 313 void SQLiteFileSystem::registerSQLiteVFS() |
| 313 { | 314 { |
| 314 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("unix"); | 315 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("unix"); |
| 316 |
| 317 // These are implemented by delegating to |wrappedVfs|. |
| 318 // TODO(shess): Implement local versions. |
| 319 ASSERT(wrappedVfs->xRandomness); |
| 320 ASSERT(wrappedVfs->xSleep); |
| 321 ASSERT(wrappedVfs->xCurrentTime); |
| 322 |
| 315 static sqlite3_vfs chromium_vfs = { | 323 static sqlite3_vfs chromium_vfs = { |
| 316 1, | 324 1, |
| 317 sizeof(chromiumVfsFile), | 325 sizeof(chromiumVfsFile), |
| 318 wrappedVfs->mxPathname, | 326 wrappedVfs->mxPathname, |
| 319 0, | 327 0, |
| 320 "chromium_vfs", | 328 "chromium_vfs", |
| 321 wrappedVfs, | 329 wrappedVfs, |
| 322 chromiumOpen, | 330 chromiumOpen, |
| 323 chromiumDelete, | 331 chromiumDelete, |
| 324 chromiumAccess, | 332 chromiumAccess, |
| 325 chromiumFullPathname, | 333 chromiumFullPathname, |
| 326 chromiumDlOpen, | 334 chromiumDlOpen, |
| 327 chromiumDlError, | 335 chromiumDlError, |
| 328 chromiumDlSym, | 336 chromiumDlSym, |
| 329 chromiumDlClose, | 337 chromiumDlClose, |
| 330 chromiumRandomness, | 338 chromiumRandomness, |
| 331 chromiumSleep, | 339 chromiumSleep, |
| 332 chromiumCurrentTime, | 340 chromiumCurrentTime, |
| 333 chromiumGetLastError | 341 chromiumGetLastError |
| 334 }; | 342 }; |
| 335 sqlite3_vfs_register(&chromium_vfs, 0); | 343 sqlite3_vfs_register(&chromium_vfs, 0); |
| 336 } | 344 } |
| 337 | 345 |
| 338 } // namespace blink | 346 } // namespace blink |
| OLD | NEW |