summaryrefslogtreecommitdiffstats
path: root/WebCore/storage
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-07-30 10:46:49 +0100
committerKristian Monsen <kristianm@google.com>2010-08-04 13:01:34 +0100
commit0617145a89917ae7735fe1c9538688ab9a577df5 (patch)
tree56206078694427c37ed7bdf27eb5221398b833c0 /WebCore/storage
parentef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff)
downloadexternal_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz
external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebCore/storage')
-rw-r--r--WebCore/storage/DatabaseAuthorizer.cpp3
-rw-r--r--WebCore/storage/IDBDatabaseImpl.cpp2
-rw-r--r--WebCore/storage/IDBKeyRange.cpp28
-rw-r--r--WebCore/storage/IDBKeyRange.h19
-rw-r--r--WebCore/storage/IDBKeyRange.idl9
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.cpp23
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.h7
-rw-r--r--WebCore/storage/IndexedDatabaseRequest.idl4
-rw-r--r--WebCore/storage/SQLTransaction.cpp3
-rw-r--r--WebCore/storage/SQLTransactionSync.cpp2
-rw-r--r--WebCore/storage/chromium/DatabaseObserver.h4
-rw-r--r--WebCore/storage/chromium/DatabaseTrackerChromium.cpp4
-rw-r--r--WebCore/storage/chromium/QuotaTracker.cpp5
-rw-r--r--WebCore/storage/chromium/QuotaTracker.h6
-rw-r--r--WebCore/storage/chromium/SQLTransactionClientChromium.cpp4
15 files changed, 68 insertions, 55 deletions
diff --git a/WebCore/storage/DatabaseAuthorizer.cpp b/WebCore/storage/DatabaseAuthorizer.cpp
index 17abebd..79e47d4 100644
--- a/WebCore/storage/DatabaseAuthorizer.cpp
+++ b/WebCore/storage/DatabaseAuthorizer.cpp
@@ -29,7 +29,6 @@
#include "config.h"
#include "DatabaseAuthorizer.h"
-#if ENABLE(DATABASE)
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
@@ -420,5 +419,3 @@ int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName)
}
} // namespace WebCore
-
-#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/IDBDatabaseImpl.cpp b/WebCore/storage/IDBDatabaseImpl.cpp
index 712830a..162efab 100644
--- a/WebCore/storage/IDBDatabaseImpl.cpp
+++ b/WebCore/storage/IDBDatabaseImpl.cpp
@@ -68,7 +68,7 @@ void IDBDatabaseImpl::createObjectStore(const String& name, const String& keyPat
PassRefPtr<IDBObjectStore> IDBDatabaseImpl::objectStore(const String& name, unsigned short mode)
{
// FIXME: If no transaction is running, this should implicitly start one.
- ASSERT(!mode); // FIXME: Handle non-standard modes.
+ ASSERT_UNUSED(mode, !mode); // FIXME: Handle non-standard modes.
return m_objectStores.get(name);
}
diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp
index 9f22fc8..dfcae19 100644
--- a/WebCore/storage/IDBKeyRange.cpp
+++ b/WebCore/storage/IDBKeyRange.cpp
@@ -26,20 +26,42 @@
#include "config.h"
#include "IDBKeyRange.h"
-#include "IDBAny.h"
-#include "SerializedScriptValue.h"
+#include "IDBKey.h"
#if ENABLE(INDEXED_DATABASE)
namespace WebCore {
-IDBKeyRange::IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
+IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags)
: m_left(left)
, m_right(right)
, m_flags(flags)
{
}
+PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpValue)
+{
+ RefPtr<IDBKey> value = prpValue;
+ return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::leftBound(PassRefPtr<IDBKey> bound, bool open)
+{
+ return IDBKeyRange::create(bound, IDBKey::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::rightBound(PassRefPtr<IDBKey> bound, bool open)
+{
+ return IDBKeyRange::create(IDBKey::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
+}
+
+PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft, bool openRight)
+{
+ unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND;
+ flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND;
+ return IDBKeyRange::create(left, right, flags);
+}
+
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IDBKeyRange.h b/WebCore/storage/IDBKeyRange.h
index 52239e4..9ce07af 100644
--- a/WebCore/storage/IDBKeyRange.h
+++ b/WebCore/storage/IDBKeyRange.h
@@ -28,8 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
-#include "IDBAny.h"
-#include "SerializedScriptValue.h"
+#include "IDBKey.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -46,22 +45,26 @@ public:
RIGHT_BOUND = 8,
};
- static PassRefPtr<IDBKeyRange> create(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
+ static PassRefPtr<IDBKeyRange> create(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags)
{
return adoptRef(new IDBKeyRange(left, right, flags));
}
~IDBKeyRange() { }
- PassRefPtr<IDBAny> left() const { return IDBAny::create(m_left.get()); }
- PassRefPtr<IDBAny> right() const { return IDBAny::create(m_right.get()); }
+ PassRefPtr<IDBKey> left() const { return m_left; }
+ PassRefPtr<IDBKey> right() const { return m_right; }
unsigned short flags() const { return m_flags; }
+ static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value);
+ static PassRefPtr<IDBKeyRange> leftBound(PassRefPtr<IDBKey> bound, bool open = false);
+ static PassRefPtr<IDBKeyRange> rightBound(PassRefPtr<IDBKey> bound, bool open = false);
+ static PassRefPtr<IDBKeyRange> bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft = false, bool openRight = false);
private:
- IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags);
+ IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags);
- RefPtr<SerializedScriptValue> m_left;
- RefPtr<SerializedScriptValue> m_right;
+ RefPtr<IDBKey> m_left;
+ RefPtr<IDBKey> m_right;
unsigned short m_flags;
};
diff --git a/WebCore/storage/IDBKeyRange.idl b/WebCore/storage/IDBKeyRange.idl
index 05f6505..6daaec1 100644
--- a/WebCore/storage/IDBKeyRange.idl
+++ b/WebCore/storage/IDBKeyRange.idl
@@ -35,9 +35,14 @@ module storage {
const unsigned short LEFT_BOUND = 4;
const unsigned short RIGHT_BOUND = 8;
- readonly attribute IDBAny left;
- readonly attribute IDBAny right;
+ readonly attribute IDBKey left;
+ readonly attribute IDBKey right;
readonly attribute unsigned short flags;
+
+ IDBKeyRange only(in IDBKey value);
+ IDBKeyRange leftBound(in IDBKey bound, in [Optional] boolean open);
+ IDBKeyRange rightBound(in IDBKey bound, in [Optional] boolean open);
+ IDBKeyRange bound(in IDBKey left, in IDBKey right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
};
}
diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp
index 45ae1bd..c1c5515 100644
--- a/WebCore/storage/IndexedDatabaseRequest.cpp
+++ b/WebCore/storage/IndexedDatabaseRequest.cpp
@@ -68,29 +68,6 @@ PassRefPtr<IDBRequest> IndexedDatabaseRequest::open(ScriptExecutionContext* cont
return request;
}
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeSingleKeyRange(PassRefPtr<SerializedScriptValue> prpValue)
-{
- RefPtr<SerializedScriptValue> value = prpValue;
- return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
-{
- return IDBKeyRange::create(bound, SerializedScriptValue::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
-{
- return IDBKeyRange::create(SerializedScriptValue::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft, bool openRight)
-{
- unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND;
- flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND;
- return IDBKeyRange::create(left, right, flags);
-}
-
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
index f505d9d..57f8a78 100644
--- a/WebCore/storage/IndexedDatabaseRequest.h
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -39,12 +39,11 @@
namespace WebCore {
-class IDBAny;
+class IDBKey;
class IDBKeyRange;
class IDBRequest;
class IndexedDatabase;
class ScriptExecutionContext;
-class SerializedScriptValue;
class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
public:
@@ -55,10 +54,6 @@ public:
~IndexedDatabaseRequest();
PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
- PassRefPtr<IDBKeyRange> makeSingleKeyRange(PassRefPtr<SerializedScriptValue> value);
- PassRefPtr<IDBKeyRange> makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft = false, bool openRight = false);
private:
IndexedDatabaseRequest(IndexedDatabase*);
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
index 502e804..e6ee446 100644
--- a/WebCore/storage/IndexedDatabaseRequest.idl
+++ b/WebCore/storage/IndexedDatabaseRequest.idl
@@ -29,10 +29,6 @@ module storage {
Conditional=INDEXED_DATABASE
] IndexedDatabaseRequest {
[CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
- IDBKeyRange makeSingleKeyRange(in SerializedScriptValue value);
- IDBKeyRange makeLeftBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
- IDBKeyRange makeRightBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
- IDBKeyRange makeBoundKeyRange(in SerializedScriptValue left, in SerializedScriptValue right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
};
}
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index decdf24..e43d844 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -292,8 +292,7 @@ void SQLTransaction::deliverTransactionCallback()
m_executeSqlAllowed = true;
shouldDeliverErrorCallback = !m_callback->handleEvent(m_database->scriptExecutionContext(), this);
m_executeSqlAllowed = false;
- } else
- shouldDeliverErrorCallback = true;
+ }
// Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback
if (shouldDeliverErrorCallback) {
diff --git a/WebCore/storage/SQLTransactionSync.cpp b/WebCore/storage/SQLTransactionSync.cpp
index af98f8f..883721c 100644
--- a/WebCore/storage/SQLTransactionSync.cpp
+++ b/WebCore/storage/SQLTransactionSync.cpp
@@ -150,7 +150,7 @@ ExceptionCode SQLTransactionSync::begin()
ExceptionCode SQLTransactionSync::execute()
{
ASSERT(m_database->scriptExecutionContext()->isContextThread());
- if (!m_database->opened() || !m_callback || !m_callback->handleEvent(m_database->scriptExecutionContext(), this)) {
+ if (!m_database->opened() || (m_callback && !m_callback->handleEvent(m_database->scriptExecutionContext(), this))) {
m_callback = 0;
return SQLException::UNKNOWN_ERR;
}
diff --git a/WebCore/storage/chromium/DatabaseObserver.h b/WebCore/storage/chromium/DatabaseObserver.h
index e2e5184..96b5972 100644
--- a/WebCore/storage/chromium/DatabaseObserver.h
+++ b/WebCore/storage/chromium/DatabaseObserver.h
@@ -31,6 +31,8 @@
#ifndef DatabaseObserver_h
#define DatabaseObserver_h
+#if ENABLE(DATABASE)
+
namespace WebCore {
class AbstractDatabase;
@@ -49,4 +51,6 @@ public:
}
+#endif // ENABLE(DATABASE)
+
#endif // DatabaseObserver_h
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index 7d9c4de..aad4ed9 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "DatabaseTracker.h"
+#if ENABLE(DATABASE)
+
#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
#include "QuotaTracker.h"
@@ -173,3 +175,5 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase
}
}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/chromium/QuotaTracker.cpp b/WebCore/storage/chromium/QuotaTracker.cpp
index 9e64942..3f48682 100644
--- a/WebCore/storage/chromium/QuotaTracker.cpp
+++ b/WebCore/storage/chromium/QuotaTracker.cpp
@@ -31,8 +31,9 @@
#include "config.h"
#include "QuotaTracker.h"
+#if ENABLE(DATABASE)
+
#include <wtf/StdLibExtras.h>
-#include <wtf/text/CString.h>
namespace WebCore {
@@ -67,3 +68,5 @@ void QuotaTracker::updateDatabaseSizeAndSpaceAvailableToOrigin(
}
}
+
+#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/chromium/QuotaTracker.h b/WebCore/storage/chromium/QuotaTracker.h
index 41c27fe..b913563 100644
--- a/WebCore/storage/chromium/QuotaTracker.h
+++ b/WebCore/storage/chromium/QuotaTracker.h
@@ -31,10 +31,12 @@
#ifndef QuotaTracker_h
#define QuotaTracker_h
+#if ENABLE(DATABASE)
+
+#include "PlatformString.h"
#include "SecurityOrigin.h"
#include "StringHash.h"
#include <wtf/HashMap.h>
-#include <wtf/text/CString.h>
namespace WebCore {
@@ -60,4 +62,6 @@ private:
}
+#endif // ENABLE(DATABASE)
+
#endif // QuotaTracker_h
diff --git a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
index 22d95e6..6a10821 100644
--- a/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
+++ b/WebCore/storage/chromium/SQLTransactionClientChromium.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "SQLTransactionClient.h"
+#if ENABLE(DATABASE)
+
#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
#include "ScriptExecutionContext.h"
@@ -83,3 +85,5 @@ bool SQLTransactionClient::didExceedQuota(AbstractDatabase* database)
}
}
+
+#endif // ENABLE(DATABASE)