Review feedback followup for:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Dec 2015 21:29:51 +0000 (21:29 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Dec 2015 21:29:51 +0000 (21:29 +0000)
Modern IDB: Only fire blocked events after all open connections have handled their versionchange events.
https://bugs.webkit.org/show_bug.cgi?id=152593

Suggested by Andy Estes.

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::dispatchEvent): Use downcast instead of static_cast.

Add traits to support downcast<>:
* Modules/indexeddb/client/IDBVersionChangeEventImpl.h:
(isType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194468 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h

index 226efcc..54b632c 100644 (file)
@@ -1,3 +1,18 @@
+2015-12-31  Brady Eidson  <beidson@apple.com>
+
+        Review feedback followup for:
+        Modern IDB: Only fire blocked events after all open connections have handled their versionchange events.
+        https://bugs.webkit.org/show_bug.cgi?id=152593
+
+        Suggested by Andy Estes.
+
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+        (WebCore::IDBClient::IDBDatabase::dispatchEvent): Use downcast instead of static_cast.
+
+        Add traits to support downcast<>:
+        * Modules/indexeddb/client/IDBVersionChangeEventImpl.h:
+        (isType):
+
 2015-12-31  Zalan Bujtas  <zalan@apple.com>
 
         Move decoration context setup calls to InlineTextBox::paintDecoration.
index baf6386..50386c7 100644 (file)
@@ -379,7 +379,7 @@ bool IDBDatabase::dispatchEvent(Event& event)
     bool result = WebCore::IDBDatabase::dispatchEvent(event);
 
     if (event.isVersionChangeEvent() && event.type() == eventNames().versionchangeEvent)
-        serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, static_cast<IDBVersionChangeEvent&>(event).requestIdentifier());
+        serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, downcast<IDBVersionChangeEvent>(event).requestIdentifier());
 
     return result;
 }
index e9af5b8..67055ae 100644 (file)
@@ -65,5 +65,9 @@ private:
 } // namespace IDBClient
 } // namespace WebCore
 
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::IDBClient::IDBVersionChangeEvent)
+    static bool isType(const WebCore::Event& event) { return event.isVersionChangeEvent(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
 #endif // ENABLE(INDEXED_DATABASE)
 #endif // IDBVersionChangeEventImpl_h