#include <string.h>
#include <unistd.h>
-using namespace WebCore;
-
// Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c
extern "C" {
void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file);
void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file);
}
+namespace blink {
+
// Chromium's Posix implementation of SQLite VFS
namespace {
return result;
if (fd < 0) {
- fd = blink::Platform::current()->databaseOpenFile(String(fileName), desiredFlags);
+ fd = Platform::current()->databaseOpenFile(String(fileName), desiredFlags);
if ((fd < 0) && (desiredFlags & SQLITE_OPEN_READWRITE)) {
int newFlags = (desiredFlags & ~(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)) | SQLITE_OPEN_READONLY;
- fd = blink::Platform::current()->databaseOpenFile(String(fileName), newFlags);
+ fd = Platform::current()->databaseOpenFile(String(fileName), newFlags);
}
}
if (fd < 0) {
// should be synched after the file is deleted.
int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
{
- return blink::Platform::current()->databaseDeleteFile(String(fileName), syncDir);
+ return Platform::current()->databaseDeleteFile(String(fileName), syncDir);
}
// Check the existance and status of the given file.
// res - the result.
int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
{
- int attr = static_cast<int>(blink::Platform::current()->databaseGetFileAttributes(String(fileName)));
+ int attr = static_cast<int>(Platform::current()->databaseGetFileAttributes(String(fileName)));
if (attr < 0) {
*res = 0;
return SQLITE_OK;
} // namespace
-namespace WebCore {
-
void SQLiteFileSystem::registerSQLiteVFS()
{
sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix");
sqlite3_vfs_register(&chromium_vfs, 0);
}
-} // namespace WebCore
+} // namespace blink