summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/jni/WebSettings.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp
index 05c92e5..d293942 100644
--- a/WebKit/android/jni/WebSettings.cpp
+++ b/WebKit/android/jni/WebSettings.cpp
@@ -462,8 +462,18 @@ public:
if (flag) {
// If the user has set the database path, sync it to the DatabaseTracker.
str = (jstring)env->GetObjectField(obj, gFieldIds->mDatabasePath);
- if (str)
- WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(jstringToWtfString(env, str));
+ if (str) {
+ String path = jstringToWtfString(env, str);
+ DatabaseTracker::tracker().setDatabaseDirectoryPath(path);
+ // This database is created when the first HTML5 Database object is
+ // instantiated. If the file doesn't exist, we create it and set its
+ // permissions. The filename must match that in
+ // DatabaseTracker.cpp.
+ String filename = SQLiteFileSystem::appendDatabaseFileNameToPath(path, "Databases.db");
+ int fd = open(filename.utf8().data(), O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+ if (fd >= 0)
+ close(fd);
+ }
}
#endif
#if ENABLE(DOM_STORAGE)