Diff
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog 2018-09-17 12:02:58 UTC (rev 236056)
@@ -1,3 +1,43 @@
+2018-08-26 Youenn Fablet <[email protected]>
+
+ IDBCursor does not need to be an ActiveDOMObject
+ https://bugs.webkit.org/show_bug.cgi?id=188937
+
+ Reviewed by Alex Christensen.
+
+ Remove ActiveDOMObject from IDBCursor IDL.
+ Update constructors and call sites accordingly.
+ This allows removing m_outstandingRequestCount and related code in IDBRequest.
+
+ Covered by existing tests.
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::create):
+ (WebCore::IDBCursor::IDBCursor):
+ (WebCore::IDBCursor::update):
+ (WebCore::IDBCursor::uncheckedIterateCursor):
+ (WebCore::IDBCursor::deleteFunction):
+ (WebCore::IDBCursor::activeDOMObjectName const): Deleted.
+ (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted.
+ (WebCore::IDBCursor::hasPendingActivity const): Deleted.
+ (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted.
+ * Modules/indexeddb/IDBCursor.h:
+ * Modules/indexeddb/IDBCursor.idl:
+ * Modules/indexeddb/IDBCursorWithValue.cpp:
+ (WebCore::IDBCursorWithValue::create):
+ (WebCore::IDBCursorWithValue::IDBCursorWithValue):
+ * Modules/indexeddb/IDBCursorWithValue.h:
+ * Modules/indexeddb/IDBCursorWithValue.idl:
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::setSource):
+ (WebCore::IDBRequest::dispatchEvent):
+ (WebCore::IDBRequest::willIterateCursor):
+ (WebCore::IDBRequest::didOpenOrIterateCursor):
+ * Modules/indexeddb/IDBRequest.h:
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::requestOpenCursor):
+ * WebCore.xcodeproj/project.pbxproj:
+
2018-08-24 Ryosuke Niwa <[email protected]>
Add getModifierState to MouseEvent
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.cpp 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.cpp 2018-09-17 12:02:58 UTC (rev 236056)
@@ -45,34 +45,28 @@
namespace WebCore {
using namespace JSC;
-Ref<IDBCursor> IDBCursor::create(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
+Ref<IDBCursor> IDBCursor::create(IDBObjectStore& objectStore, const IDBCursorInfo& info)
{
- return adoptRef(*new IDBCursor(transaction, objectStore, info));
+ return adoptRef(*new IDBCursor(objectStore, info));
}
-Ref<IDBCursor> IDBCursor::create(IDBTransaction& transaction, IDBIndex& index, const IDBCursorInfo& info)
+Ref<IDBCursor> IDBCursor::create(IDBIndex& index, const IDBCursorInfo& info)
{
- return adoptRef(*new IDBCursor(transaction, index, info));
+ return adoptRef(*new IDBCursor(index, info));
}
-IDBCursor::IDBCursor(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
- : ActiveDOMObject(transaction.scriptExecutionContext())
- , m_info(info)
+IDBCursor::IDBCursor(IDBObjectStore& objectStore, const IDBCursorInfo& info)
+ : m_info(info)
, m_source(&objectStore)
{
ASSERT(&effectiveObjectStore().transaction().database().originThread() == &Thread::current());
-
- suspendIfNeeded();
}
-IDBCursor::IDBCursor(IDBTransaction& transaction, IDBIndex& index, const IDBCursorInfo& info)
- : ActiveDOMObject(transaction.scriptExecutionContext())
- , m_info(info)
+IDBCursor::IDBCursor(IDBIndex& index, const IDBCursorInfo& info)
+ : m_info(info)
, m_source(&index)
{
ASSERT(&effectiveObjectStore().transaction().database().originThread() == &Thread::current());
-
- suspendIfNeeded();
}
IDBCursor::~IDBCursor()
@@ -140,7 +134,6 @@
auto request = putResult.releaseReturnValue();
request->setSource(*this);
- ++m_outstandingRequestCount;
return WTFMove(request);
}
@@ -269,8 +262,6 @@
{
ASSERT(&effectiveObjectStore().transaction().database().originThread() == &Thread::current());
- ++m_outstandingRequestCount;
-
m_request->willIterateCursor(*this);
transaction().iterateCursor(*this, { key, { }, count });
}
@@ -279,8 +270,6 @@
{
ASSERT(&effectiveObjectStore().transaction().database().originThread() == &Thread::current());
- ++m_outstandingRequestCount;
-
m_request->willIterateCursor(*this);
transaction().iterateCursor(*this, { key, primaryKey, 0 });
}
@@ -311,7 +300,6 @@
auto request = result.releaseReturnValue();
request->setSource(*this);
- ++m_outstandingRequestCount;
return WTFMove(request);
}
@@ -357,27 +345,6 @@
m_gotValue = true;
}
-const char* IDBCursor::activeDOMObjectName() const
-{
- return "IDBCursor";
-}
-
-bool IDBCursor::canSuspendForDocumentSuspension() const
-{
- return false;
-}
-
-bool IDBCursor::hasPendingActivity() const
-{
- return m_outstandingRequestCount;
-}
-
-void IDBCursor::decrementOutstandingRequestCount()
-{
- ASSERT(m_outstandingRequestCount);
- --m_outstandingRequestCount;
-}
-
} // namespace WebCore
#endif // ENABLE(INDEXED_DATABASE)
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.h (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.h 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.h 2018-09-17 12:02:58 UTC (rev 236056)
@@ -27,7 +27,6 @@
#if ENABLE(INDEXED_DATABASE)
-#include "ActiveDOMObject.h"
#include "ExceptionOr.h"
#include "IDBCursorDirection.h"
#include "IDBCursorInfo.h"
@@ -41,10 +40,10 @@
class IDBObjectStore;
class IDBTransaction;
-class IDBCursor : public ScriptWrappable, public RefCounted<IDBCursor>, public ActiveDOMObject {
+class IDBCursor : public ScriptWrappable, public RefCounted<IDBCursor> {
public:
- static Ref<IDBCursor> create(IDBTransaction&, IDBObjectStore&, const IDBCursorInfo&);
- static Ref<IDBCursor> create(IDBTransaction&, IDBIndex&, const IDBCursorInfo&);
+ static Ref<IDBCursor> create(IDBObjectStore&, const IDBCursorInfo&);
+ static Ref<IDBCursor> create(IDBIndex&, const IDBCursorInfo&);
virtual ~IDBCursor();
@@ -74,18 +73,11 @@
virtual bool isKeyCursorWithValue() const { return false; }
- void decrementOutstandingRequestCount();
-
- bool hasPendingActivity() const final;
-
protected:
- IDBCursor(IDBTransaction&, IDBObjectStore&, const IDBCursorInfo&);
- IDBCursor(IDBTransaction&, IDBIndex&, const IDBCursorInfo&);
+ IDBCursor(IDBObjectStore&, const IDBCursorInfo&);
+ IDBCursor(IDBIndex&, const IDBCursorInfo&);
private:
- const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
-
bool sourcesDeleted() const;
IDBObjectStore& effectiveObjectStore() const;
IDBTransaction& transaction() const;
@@ -93,9 +85,6 @@
void uncheckedIterateCursor(const IDBKeyData&, unsigned count);
void uncheckedIterateCursor(const IDBKeyData&, const IDBKeyData&);
- // Cursors are created with an outstanding iteration request.
- unsigned m_outstandingRequestCount { 1 };
-
IDBCursorInfo m_info;
Source m_source;
IDBRequest* m_request { nullptr };
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.idl (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.idl 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursor.idl 2018-09-17 12:02:58 UTC (rev 236056)
@@ -24,7 +24,6 @@
*/
[
- ActiveDOMObject,
Conditional=INDEXED_DATABASE,
CustomToJSObject,
JSCustomMarkFunction,
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp 2018-09-17 12:02:58 UTC (rev 236056)
@@ -32,23 +32,23 @@
namespace WebCore {
-Ref<IDBCursorWithValue> IDBCursorWithValue::create(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
+Ref<IDBCursorWithValue> IDBCursorWithValue::create(IDBObjectStore& objectStore, const IDBCursorInfo& info)
{
- return adoptRef(*new IDBCursorWithValue(transaction, objectStore, info));
+ return adoptRef(*new IDBCursorWithValue(objectStore, info));
}
-Ref<IDBCursorWithValue> IDBCursorWithValue::create(IDBTransaction& transaction, IDBIndex& index, const IDBCursorInfo& info)
+Ref<IDBCursorWithValue> IDBCursorWithValue::create(IDBIndex& index, const IDBCursorInfo& info)
{
- return adoptRef(*new IDBCursorWithValue(transaction, index, info));
+ return adoptRef(*new IDBCursorWithValue(index, info));
}
-IDBCursorWithValue::IDBCursorWithValue(IDBTransaction& transaction, IDBObjectStore& objectStore, const IDBCursorInfo& info)
- : IDBCursor(transaction, objectStore, info)
+IDBCursorWithValue::IDBCursorWithValue(IDBObjectStore& objectStore, const IDBCursorInfo& info)
+ : IDBCursor(objectStore, info)
{
}
-IDBCursorWithValue::IDBCursorWithValue(IDBTransaction& transaction, IDBIndex& index, const IDBCursorInfo& info)
- : IDBCursor(transaction, index, info)
+IDBCursorWithValue::IDBCursorWithValue(IDBIndex& index, const IDBCursorInfo& info)
+ : IDBCursor(index, info)
{
}
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h 2018-09-17 12:02:58 UTC (rev 236056)
@@ -34,8 +34,8 @@
class IDBCursorWithValue final : public IDBCursor {
public:
- static Ref<IDBCursorWithValue> create(IDBTransaction&, IDBObjectStore&, const IDBCursorInfo&);
- static Ref<IDBCursorWithValue> create(IDBTransaction&, IDBIndex&, const IDBCursorInfo&);
+ static Ref<IDBCursorWithValue> create(IDBObjectStore&, const IDBCursorInfo&);
+ static Ref<IDBCursorWithValue> create(IDBIndex&, const IDBCursorInfo&);
virtual ~IDBCursorWithValue();
@@ -42,8 +42,8 @@
bool isKeyCursorWithValue() const override { return true; }
private:
- IDBCursorWithValue(IDBTransaction&, IDBObjectStore&, const IDBCursorInfo&);
- IDBCursorWithValue(IDBTransaction&, IDBIndex&, const IDBCursorInfo&);
+ IDBCursorWithValue(IDBObjectStore&, const IDBCursorInfo&);
+ IDBCursorWithValue(IDBIndex&, const IDBCursorInfo&);
};
} // namespace WebCore
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.idl 2018-09-17 12:02:58 UTC (rev 236056)
@@ -25,7 +25,6 @@
[
Conditional=INDEXED_DATABASE,
- ActiveDOMObject,
SkipVTableValidation,
JSCustomMarkFunction,
] interface IDBCursorWithValue : IDBCursor {
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2018-09-17 12:02:58 UTC (rev 236056)
@@ -174,13 +174,8 @@
void IDBRequest::setSource(IDBCursor& cursor)
{
ASSERT(&originThread() == &Thread::current());
- ASSERT(!m_cursorRequestNotifier);
m_source = Source { &cursor };
- m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() {
- ASSERT(WTF::holds_alternative<RefPtr<IDBCursor>>(m_source.value()));
- WTF::get<RefPtr<IDBCursor>>(m_source.value())->decrementOutstandingRequestCount();
- });
}
void IDBRequest::setVersionChangeTransaction(IDBTransaction& transaction)
@@ -318,8 +313,6 @@
m_hasPendingActivity = false;
- m_cursorRequestNotifier = nullptr;
-
{
TransactionActivator activator(m_transaction.get());
EventDispatcher::dispatchEvent(targets, event);
@@ -474,7 +467,6 @@
ASSERT(m_transaction);
ASSERT(!m_pendingCursor);
ASSERT(&cursor == resultCursor());
- ASSERT(!m_cursorRequestNotifier);
m_pendingCursor = &cursor;
m_hasPendingActivity = true;
@@ -482,10 +474,6 @@
m_readyState = ReadyState::Pending;
m_domError = nullptr;
m_idbError = IDBError { };
-
- m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() {
- m_pendingCursor->decrementOutstandingRequestCount();
- });
}
void IDBRequest::didOpenOrIterateCursor(const IDBResultData& resultData)
@@ -501,7 +489,6 @@
m_result = Result { m_pendingCursor };
}
- m_cursorRequestNotifier = nullptr;
m_pendingCursor = nullptr;
completeRequestAndDispatchEvent(resultData);
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.h (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.h 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBRequest.h 2018-09-17 12:02:58 UTC (rev 236056)
@@ -173,8 +173,6 @@
RefPtr<IDBCursor> m_pendingCursor;
- std::unique_ptr<WTF::ScopeExit<WTF::Function<void()>>> m_cursorRequestNotifier;
-
Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
};
Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (236055 => 236056)
--- releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2018-09-17 12:02:48 UTC (rev 236055)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2018-09-17 12:02:58 UTC (rev 236056)
@@ -800,9 +800,9 @@
ASSERT(&m_database->originThread() == &Thread::current());
if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
- return doRequestOpenCursor(state, IDBCursor::create(*this, objectStore, info));
+ return doRequestOpenCursor(state, IDBCursor::create(objectStore, info));
- return doRequestOpenCursor(state, IDBCursorWithValue::create(*this, objectStore, info));
+ return doRequestOpenCursor(state, IDBCursorWithValue::create(objectStore, info));
}
Ref<IDBRequest> IDBTransaction::requestOpenCursor(ExecState& state, IDBIndex& index, const IDBCursorInfo& info)
@@ -811,9 +811,9 @@
ASSERT(&m_database->originThread() == &Thread::current());
if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
- return doRequestOpenCursor(state, IDBCursor::create(*this, index, info));
+ return doRequestOpenCursor(state, IDBCursor::create(index, info));
- return doRequestOpenCursor(state, IDBCursorWithValue::create(*this, index, info));
+ return doRequestOpenCursor(state, IDBCursorWithValue::create(index, info));
}
Ref<IDBRequest> IDBTransaction::doRequestOpenCursor(ExecState& state, Ref<IDBCursor>&& cursor)