| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 int chromiumSleep(sqlite3_vfs* vfs, int microseconds) { | 148 int chromiumSleep(sqlite3_vfs* vfs, int microseconds) { |
| 149 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 149 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); |
| 150 return wrappedVfs->xSleep(wrappedVfs, microseconds); | 150 return wrappedVfs->xSleep(wrappedVfs, microseconds); |
| 151 } | 151 } |
| 152 | 152 |
| 153 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) { | 153 int chromiumCurrentTime(sqlite3_vfs* vfs, double* prNow) { |
| 154 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); | 154 sqlite3_vfs* wrappedVfs = static_cast<sqlite3_vfs*>(vfs->pAppData); |
| 155 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); | 155 return wrappedVfs->xCurrentTime(wrappedVfs, prNow); |
| 156 } | 156 } |
| 157 | 157 |
| 158 int chromiumGetLastError(sqlite3_vfs* vfs, int e, char* s) { | 158 int chromiumGetLastError(sqlite3_vfs* vfs, int nBuf, char* zBuf) { |
| 159 // xGetLastError() has never been used by SQLite. The implementation in | 159 if (nBuf && zBuf) |
| 160 // os_win.c indicates this is a reasonable implementation. | 160 *zBuf = '\0'; |
| 161 *s = '\0'; | |
| 162 return 0; | 161 return 0; |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace | 164 } // namespace |
| 166 | 165 |
| 167 void SQLiteFileSystem::registerSQLiteVFS() { | 166 void SQLiteFileSystem::registerSQLiteVFS() { |
| 168 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32"); | 167 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("win32"); |
| 169 | 168 |
| 170 // These are implemented by delegating to |wrappedVfs|. | 169 // These are implemented by delegating to |wrappedVfs|. |
| 171 // TODO(shess): Implement local versions. | 170 // TODO(shess): Implement local versions. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 188 chromiumDlSym, | 187 chromiumDlSym, |
| 189 chromiumDlClose, | 188 chromiumDlClose, |
| 190 chromiumRandomness, | 189 chromiumRandomness, |
| 191 chromiumSleep, | 190 chromiumSleep, |
| 192 chromiumCurrentTime, | 191 chromiumCurrentTime, |
| 193 chromiumGetLastError}; | 192 chromiumGetLastError}; |
| 194 sqlite3_vfs_register(&chromium_vfs, 0); | 193 sqlite3_vfs_register(&chromium_vfs, 0); |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |