Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteFileSystemPosix.cpp

Issue 1639863003: [websql] Guard against vfs method deprecation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch chromiumGetLastError to successfully return an empty buffer. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteFileSystemWin.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webdatabase/sqlite/SQLiteFileSystemWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698