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

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: 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
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 return SQLITE_ERROR;
307 return wrappedVfs->xGetLastError(wrappedVfs, e, s);
308 } 307 }
309 308
310 } // namespace 309 } // namespace
311 310
312 void SQLiteFileSystem::registerSQLiteVFS() 311 void SQLiteFileSystem::registerSQLiteVFS()
313 { 312 {
314 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("unix"); 313 sqlite3_vfs* wrappedVfs = sqlite3_vfs_find("unix");
314
315 // These are implemented by delegating to |wrappedVfs|.
316 // TODO(shess): Implement local versions.
317 ASSERT(wrappedVfs->xRandomness);
318 ASSERT(wrappedVfs->xSleep);
319 ASSERT(wrappedVfs->xCurrentTime);
320
315 static sqlite3_vfs chromium_vfs = { 321 static sqlite3_vfs chromium_vfs = {
316 1, 322 1,
317 sizeof(chromiumVfsFile), 323 sizeof(chromiumVfsFile),
318 wrappedVfs->mxPathname, 324 wrappedVfs->mxPathname,
319 0, 325 0,
320 "chromium_vfs", 326 "chromium_vfs",
321 wrappedVfs, 327 wrappedVfs,
322 chromiumOpen, 328 chromiumOpen,
323 chromiumDelete, 329 chromiumDelete,
324 chromiumAccess, 330 chromiumAccess,
325 chromiumFullPathname, 331 chromiumFullPathname,
326 chromiumDlOpen, 332 chromiumDlOpen,
327 chromiumDlError, 333 chromiumDlError,
328 chromiumDlSym, 334 chromiumDlSym,
329 chromiumDlClose, 335 chromiumDlClose,
330 chromiumRandomness, 336 chromiumRandomness,
331 chromiumSleep, 337 chromiumSleep,
332 chromiumCurrentTime, 338 chromiumCurrentTime,
333 chromiumGetLastError 339 chromiumGetLastError
334 }; 340 };
335 sqlite3_vfs_register(&chromium_vfs, 0); 341 sqlite3_vfs_register(&chromium_vfs, 0);
336 } 342 }
337 343
338 } // namespace blink 344 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698