[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreip at google.com
andreip at google.com
Wed Dec 22 11:30:20 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 758523bdff7d65ef568b836b852b1d8fac255d2f
Author: andreip at google.com <andreip at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 27 18:04:20 2010 +0000
2010-07-27 Andrei Popescu <andreip at google.com>
Reviewed by Jeremy Orlow.
[IndexedDB] Key range methods belong to the IDBKeyRange interface
https://bugs.webkit.org/show_bug.cgi?id=43052
* storage/indexeddb/script-tests/keyrange.js:
(checkSingleKeyRange):
(checkLeftBoundKeyRange):
():
2010-07-27 Andrei Popescu <andreip at google.com>
Reviewed by Jeremy Orlow.
[IndexedDB] Key range methods belong to the IDBKeyRange interface
https://bugs.webkit.org/show_bug.cgi?id=43052
Move the key range methods from the IndexedDatabaseRequest interface
to the IDBKeyRange interface. Also add a global IDBKeyRange object
that can be used to access the IDBKeyRange constants and factory methods.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clear):
(WebCore::DOMWindow::iDBKeyRange):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* storage/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::leftBound):
(WebCore::IDBKeyRange::rightBound):
(WebCore::IDBKeyRange::bound):
* storage/IDBKeyRange.h:
* storage/IDBKeyRange.idl:
* storage/IndexedDatabaseRequest.cpp:
* storage/IndexedDatabaseRequest.h:
* storage/IndexedDatabaseRequest.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e5d9025..d4f455f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-27 Andrei Popescu <andreip at google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [IndexedDB] Key range methods belong to the IDBKeyRange interface
+ https://bugs.webkit.org/show_bug.cgi?id=43052
+
+ * storage/indexeddb/script-tests/keyrange.js:
+ (checkSingleKeyRange):
+ (checkLeftBoundKeyRange):
+ ():
+
2010-07-27 Martin Robinson <mrobinson at igalia.com>
Unreviewed.
diff --git a/LayoutTests/storage/indexeddb/script-tests/keyrange.js b/LayoutTests/storage/indexeddb/script-tests/keyrange.js
index 2c2cdde..26d283f 100644
--- a/LayoutTests/storage/indexeddb/script-tests/keyrange.js
+++ b/LayoutTests/storage/indexeddb/script-tests/keyrange.js
@@ -4,7 +4,7 @@ if (window.layoutTestController)
function checkSingleKeyRange(value)
{
- keyRange = evalAndLog("indexedDB.makeSingleKeyRange(" + value + ")");
+ keyRange = evalAndLog("IDBKeyRange.only(" + value + ")");
shouldBe("keyRange.left", "" + value);
shouldBe("keyRange.right", "" + value);
shouldBe("keyRange.flags", "keyRange.SINGLE");
@@ -12,7 +12,7 @@ function checkSingleKeyRange(value)
function checkLeftBoundKeyRange(value, open)
{
- keyRange = evalAndLog("indexedDB.makeLeftBoundKeyRange(" + value + "," + open + ")");
+ keyRange = evalAndLog("IDBKeyRange.leftBound(" + value + "," + open + ")");
shouldBe("keyRange.left", "" + value);
shouldBeNull("keyRange.right");
shouldBe("keyRange.flags", open ? "keyRange.LEFT_OPEN" : "keyRange.LEFT_BOUND");
@@ -20,7 +20,7 @@ function checkLeftBoundKeyRange(value, open)
function checkRightBoundKeyRange(value, open)
{
- keyRange = evalAndLog("indexedDB.makeRightBoundKeyRange(" + value + "," + open + ")");
+ keyRange = evalAndLog("IDBKeyRange.rightBound(" + value + "," + open + ")");
shouldBe("keyRange.right", "" + value);
shouldBeNull("keyRange.left");
shouldBe("keyRange.flags", open ? "keyRange.RIGHT_OPEN" : "keyRange.RIGHT_BOUND");
@@ -28,7 +28,7 @@ function checkRightBoundKeyRange(value, open)
function checkBoundKeyRange(left, right, openLeft, openRight)
{
- keyRange = evalAndLog("indexedDB.makeBoundKeyRange(" + left + "," + right + "," + openLeft + "," + openRight + ")");
+ keyRange = evalAndLog("IDBKeyRange.bound(" + left + "," + right + "," + openLeft + "," + openRight + ")");
shouldBe("keyRange.left", "" + left);
shouldBe("keyRange.right", "" + right);
leftFlags = keyRange.flags & (keyRange.LEFT_OPEN | keyRange.LEFT_BOUND);
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fc9d9e5..6aec3d5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-07-27 Andrei Popescu <andreip at google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ [IndexedDB] Key range methods belong to the IDBKeyRange interface
+ https://bugs.webkit.org/show_bug.cgi?id=43052
+
+ Move the key range methods from the IndexedDatabaseRequest interface
+ to the IDBKeyRange interface. Also add a global IDBKeyRange object
+ that can be used to access the IDBKeyRange constants and factory methods.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::clear):
+ (WebCore::DOMWindow::iDBKeyRange):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * storage/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::only):
+ (WebCore::IDBKeyRange::leftBound):
+ (WebCore::IDBKeyRange::rightBound):
+ (WebCore::IDBKeyRange::bound):
+ * storage/IDBKeyRange.h:
+ * storage/IDBKeyRange.idl:
+ * storage/IndexedDatabaseRequest.cpp:
+ * storage/IndexedDatabaseRequest.h:
+ * storage/IndexedDatabaseRequest.idl:
+
2010-07-27 Chris Fleizach <cfleizach at apple.com>
Reviewed by Darin Adler.
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index ad635a6..e6d8d04 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -56,6 +56,7 @@
#include "FrameView.h"
#include "HTMLFrameOwnerElement.h"
#include "History.h"
+#include "IDBKeyRange.h"
#include "IndexedDatabase.h"
#include "IndexedDatabaseRequest.h"
#include "InspectorController.h"
@@ -483,6 +484,7 @@ void DOMWindow::clear()
#endif
#if ENABLE(INDEXED_DATABASE)
+ m_idb_key_range = 0;
m_indexedDatabaseRequest = 0;
#endif
}
@@ -705,6 +707,14 @@ IndexedDatabaseRequest* DOMWindow::indexedDB() const
m_indexedDatabaseRequest = IndexedDatabaseRequest::create(page->group().indexedDatabase());
return m_indexedDatabaseRequest.get();
}
+
+IDBKeyRange* DOMWindow::iDBKeyRange() const
+{
+ if (!m_idb_key_range)
+ m_idb_key_range = IDBKeyRange::create(0, 0, 0);
+
+ return m_idb_key_range.get();
+}
#endif
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index 69d7428..7a13651 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -53,6 +53,7 @@ namespace WebCore {
class FloatRect;
class Frame;
class History;
+ class IDBKeyRange;
class IndexedDatabaseRequest;
class InspectorTimelineAgent;
class Location;
@@ -231,6 +232,7 @@ namespace WebCore {
void pageDestroyed();
#if ENABLE(INDEXED_DATABASE)
+ IDBKeyRange* iDBKeyRange() const;
IndexedDatabaseRequest* indexedDB() const;
#endif
@@ -422,6 +424,7 @@ namespace WebCore {
mutable RefPtr<NotificationCenter> m_notifications;
#endif
#if ENABLE(INDEXED_DATABASE)
+ mutable RefPtr<IDBKeyRange> m_idb_key_range;
mutable RefPtr<IndexedDatabaseRequest> m_indexedDatabaseRequest;
#endif
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 82521ba..e4ccd6b 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -174,6 +174,7 @@ module window {
#endif
#if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
readonly attribute [EnabledAtRuntime] IndexedDatabaseRequest indexedDB;
+ readonly attribute IDBKeyRange IDBKeyRange;
#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp
index 0b629bd..dfcae19 100644
--- a/WebCore/storage/IDBKeyRange.cpp
+++ b/WebCore/storage/IDBKeyRange.cpp
@@ -39,6 +39,29 @@ IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, unsi
{
}
+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 65f6996..9ce07af 100644
--- a/WebCore/storage/IDBKeyRange.h
+++ b/WebCore/storage/IDBKeyRange.h
@@ -56,6 +56,10 @@ public:
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<IDBKey> left, PassRefPtr<IDBKey> right, unsigned short flags);
diff --git a/WebCore/storage/IDBKeyRange.idl b/WebCore/storage/IDBKeyRange.idl
index d018fed..6daaec1 100644
--- a/WebCore/storage/IDBKeyRange.idl
+++ b/WebCore/storage/IDBKeyRange.idl
@@ -38,6 +38,11 @@ module storage {
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 7f3ab5a..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<IDBKey> prpValue)
-{
- RefPtr<IDBKey> value = prpValue;
- return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeLeftBoundKeyRange(PassRefPtr<IDBKey> bound, bool open)
-{
- return IDBKeyRange::create(bound, IDBKey::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeRightBoundKeyRange(PassRefPtr<IDBKey> bound, bool open)
-{
- return IDBKeyRange::create(IDBKey::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
-}
-
-PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeBoundKeyRange(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/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
index de01b35..57f8a78 100644
--- a/WebCore/storage/IndexedDatabaseRequest.h
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -54,10 +54,6 @@ public:
~IndexedDatabaseRequest();
PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
- PassRefPtr<IDBKeyRange> makeSingleKeyRange(PassRefPtr<IDBKey> value);
- PassRefPtr<IDBKeyRange> makeLeftBoundKeyRange(PassRefPtr<IDBKey> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeRightBoundKeyRange(PassRefPtr<IDBKey> bound, bool open = false);
- PassRefPtr<IDBKeyRange> makeBoundKeyRange(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft = false, bool openRight = false);
private:
IndexedDatabaseRequest(IndexedDatabase*);
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
index a3249c0..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 IDBKey value);
- IDBKeyRange makeLeftBoundKeyRange(in IDBKey bound, in [Optional] boolean open);
- IDBKeyRange makeRightBoundKeyRange(in IDBKey bound, in [Optional] boolean open);
- IDBKeyRange makeBoundKeyRange(in IDBKey left, in IDBKey right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
};
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list