Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / webdatabase / sqlite / SQLiteFileSystemPosix.cpp
index 498759e..9b85a6e 100644 (file)
@@ -38,8 +38,6 @@
 #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);
@@ -49,6 +47,8 @@ void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, in
 void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file);
 }
 
+namespace blink {
+
 // Chromium's Posix implementation of SQLite VFS
 namespace {
 
@@ -69,10 +69,10 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
         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) {
@@ -103,7 +103,7 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
 //           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.
@@ -114,7 +114,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
 // 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;
@@ -166,8 +166,6 @@ void* chromiumDlOpen(sqlite3_vfs*, const char*)
 
 } // namespace
 
-namespace WebCore {
-
 void SQLiteFileSystem::registerSQLiteVFS()
 {
     sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix");
@@ -194,4 +192,4 @@ void SQLiteFileSystem::registerSQLiteVFS()
     sqlite3_vfs_register(&chromium_vfs, 0);
 }
 
-} // namespace WebCore
+} // namespace blink