Title: [99011] trunk/Source/WebCore
Revision
99011
Author
[email protected]
Date
2011-11-01 16:33:04 -0700 (Tue, 01 Nov 2011)

Log Message

IndexedDB: get EventQueue from ScriptExecutionContext instead of Document
https://bugs.webkit.org/show_bug.cgi?id=71147

When IDB is used from a worker thread ScriptExecutionContext will
be a WorkerContext, not a Document.  This was the impetus behind
moving EventQueue into ScriptExecutionContext in r98656.

Reviewed by Nate Chapin.

No new tests. No new functionality yet.

* storage/IDBDatabase.cpp:
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::enqueueEvent):
* storage/IDBRequest.cpp:
(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::enqueueEvent):
* storage/IDBTransaction.cpp:
(WebCore::IDBTransaction::enqueueEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99010 => 99011)


--- trunk/Source/WebCore/ChangeLog	2011-11-01 23:31:23 UTC (rev 99010)
+++ trunk/Source/WebCore/ChangeLog	2011-11-01 23:33:04 UTC (rev 99011)
@@ -1,3 +1,25 @@
+2011-11-01  David Grogan  <[email protected]>
+
+        IndexedDB: get EventQueue from ScriptExecutionContext instead of Document
+        https://bugs.webkit.org/show_bug.cgi?id=71147
+
+        When IDB is used from a worker thread ScriptExecutionContext will
+        be a WorkerContext, not a Document.  This was the impetus behind
+        moving EventQueue into ScriptExecutionContext in r98656.
+
+        Reviewed by Nate Chapin.
+
+        No new tests. No new functionality yet.
+
+        * storage/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::close):
+        (WebCore::IDBDatabase::enqueueEvent):
+        * storage/IDBRequest.cpp:
+        (WebCore::IDBRequest::abort):
+        (WebCore::IDBRequest::enqueueEvent):
+        * storage/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::enqueueEvent):
+
 2011-11-01  Andreas Kling  <[email protected]>
 
         CSS: Remove unused virtual parseString() in style and keyframe rules.

Modified: trunk/Source/WebCore/storage/IDBDatabase.cpp (99010 => 99011)


--- trunk/Source/WebCore/storage/IDBDatabase.cpp	2011-11-01 23:31:23 UTC (rev 99010)
+++ trunk/Source/WebCore/storage/IDBDatabase.cpp	2011-11-01 23:33:04 UTC (rev 99011)
@@ -26,8 +26,7 @@
 #include "config.h"
 #include "IDBDatabase.h"
 
-#include "Document.h"
-#include "DocumentEventQueue.h"
+#include "EventQueue.h"
 #include "ExceptionCode.h"
 #include "EventQueue.h"
 #include "IDBAny.h"
@@ -167,8 +166,7 @@
     if (m_noNewTransactions)
         return;
 
-    ASSERT(scriptExecutionContext()->isDocument());
-    EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
+    EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
     // Remove any pending versionchange events scheduled to fire on this
     // connection. They would have been scheduled by the backend when another
     // connection called setVersion, but the frontend connection is being
@@ -204,8 +202,7 @@
 
 void IDBDatabase::enqueueEvent(PassRefPtr<Event> event)
 {
-    ASSERT(scriptExecutionContext()->isDocument());
-    EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
+    EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
     event->setTarget(this);
     eventQueue->enqueueEvent(event.get());
     m_enqueuedEvents.append(event);

Modified: trunk/Source/WebCore/storage/IDBRequest.cpp (99010 => 99011)


--- trunk/Source/WebCore/storage/IDBRequest.cpp	2011-11-01 23:31:23 UTC (rev 99010)
+++ trunk/Source/WebCore/storage/IDBRequest.cpp	2011-11-01 23:33:04 UTC (rev 99011)
@@ -31,11 +31,10 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "Document.h"
-#include "DocumentEventQueue.h"
 #include "EventException.h"
 #include "EventListener.h"
 #include "EventNames.h"
+#include "EventQueue.h"
 #include "IDBCursorWithValue.h"
 #include "IDBDatabase.h"
 #include "IDBEventDispatcher.h"
@@ -149,12 +148,10 @@
         ASSERT(m_readyState == DONE);
         return;
     }
-    // FIXME: Remove isDocument check when
-    // https://bugs.webkit.org/show_bug.cgi?id=57789 is resolved.
-    if (!scriptExecutionContext() || !scriptExecutionContext()->isDocument())
+    if (!scriptExecutionContext())
         return;
 
-    EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
+    EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
     for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
         bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get());
         ASSERT_UNUSED(removed, removed);
@@ -327,8 +324,7 @@
     if (!scriptExecutionContext())
         return;
 
-    ASSERT(scriptExecutionContext()->isDocument());
-    EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
+    EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
     event->setTarget(this);
     eventQueue->enqueueEvent(event.get());
     m_enqueuedEvents.append(event);

Modified: trunk/Source/WebCore/storage/IDBTransaction.cpp (99010 => 99011)


--- trunk/Source/WebCore/storage/IDBTransaction.cpp	2011-11-01 23:31:23 UTC (rev 99010)
+++ trunk/Source/WebCore/storage/IDBTransaction.cpp	2011-11-01 23:33:04 UTC (rev 99011)
@@ -28,9 +28,8 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "Document.h"
-#include "DocumentEventQueue.h"
 #include "EventException.h"
+#include "EventQueue.h"
 #include "IDBDatabase.h"
 #include "IDBDatabaseException.h"
 #include "IDBEventDispatcher.h"
@@ -191,8 +190,7 @@
     if (!scriptExecutionContext())
         return;
 
-    ASSERT(scriptExecutionContext()->isDocument());
-    EventQueue* eventQueue = static_cast<Document*>(scriptExecutionContext())->eventQueue();
+    EventQueue* eventQueue = scriptExecutionContext()->eventQueue();
     event->setTarget(this);
     eventQueue->enqueueEvent(event);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to