summaryrefslogtreecommitdiffstats
path: root/WebCore/storage/Database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/storage/Database.cpp')
-rw-r--r--WebCore/storage/Database.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index 93d87a7..e59ddaf 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -29,6 +29,9 @@
#include "config.h"
#include "Database.h"
+#include <wtf/StdLibExtras.h>
+
+#if ENABLE(DATABASE)
#include "ChangeVersionWrapper.h"
#include "CString.h"
#include "DatabaseAuthorizer.h"
@@ -40,7 +43,6 @@
#include "FileSystem.h"
#include "Frame.h"
#include "InspectorController.h"
-#include "JSDOMWindow.h"
#include "Logging.h"
#include "NotImplemented.h"
#include "Page.h"
@@ -48,12 +50,24 @@
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SQLResultSet.h"
-#include <runtime/InitializeThreading.h>
#include <wtf/MainThread.h>
-#include <wtf/StdLibExtras.h>
+#endif
+
+#if USE(JSC)
+#include "JSDOMWindow.h"
+#include <runtime/InitializeThreading.h>
+#endif
namespace WebCore {
+const String& Database::databaseInfoTableName()
+{
+ DEFINE_STATIC_LOCAL(String, name, ("__WebKitDatabaseInfoTable__"));
+ return name;
+}
+
+#if ENABLE(DATABASE)
+
static Mutex& guidMutex()
{
// Note: We don't have to use AtomicallyInitializedStatic here because
@@ -77,12 +91,6 @@ static GuidDatabaseMap& guidToDatabaseMap()
return map;
}
-const String& Database::databaseInfoTableName()
-{
- DEFINE_STATIC_LOCAL(String, name, ("__WebKitDatabaseInfoTable__"));
- return name;
-}
-
static const String& databaseVersionKey()
{
DEFINE_STATIC_LOCAL(String, key, ("WebKitDatabaseVersionKey"));
@@ -111,7 +119,7 @@ PassRefPtr<Database> Database::openDatabase(Document* document, const String& na
document->setHasOpenDatabases();
if (Page* page = document->frame()->page())
- page->inspectorController()->didOpenDatabase(database.get(), document->domain(), name, expectedVersion);
+ page->inspectorController()->didOpenDatabase(database.get(), document->securityOrigin()->host(), name, expectedVersion);
return database;
}
@@ -131,9 +139,11 @@ Database::Database(Document* document, const String& name, const String& expecte
if (m_name.isNull())
m_name = "";
+#if USE(JSC)
JSC::initializeThreading();
// Database code violates the normal JSCore contract by calling jsUnprotect from a secondary thread, and thus needs additional locking.
JSDOMWindow::commonJSGlobalData()->heap.setGCProtectNeedsLocking();
+#endif
m_guid = guidForOriginAndName(m_securityOrigin->toString(), name);
@@ -594,4 +604,6 @@ String Database::stringIdentifier() const
return m_name.copy();
}
+#endif
+
}