[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 12:28:06 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 38053eaadd19a417eb83e8f84cc4a4f38e2a908e
Author: andreip at google.com <andreip at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 24 09:05:38 2010 +0000

    2010-08-24  Andrei Popescu  <andreip at dhcp-172-16-14-12.lon.corp.google.com>
    
            Reviewed by Jeremy Orlow.
    
            Implement IDBTransaction::objectStore
    
            [IndexedDB] IDBTransaction is missing the implementation for objectStore method
            https://bugs.webkit.org/show_bug.cgi?id=44446
    
            * storage/indexeddb/script-tests/transaction-basics.js:
            (test):
            (openSuccess):
            (createSuccess):
            (abortCallback):
            * storage/indexeddb/transaction-basics-expected.txt:
    2010-08-24  Andrei Popescu  <andreip at dhcp-172-16-14-12.lon.corp.google.com>
    
            Reviewed by Jeremy Orlow.
    
            [IndexedDB] IDBTransaction is missing the implementation for objectStore method
            https://bugs.webkit.org/show_bug.cgi?id=44446
    
            * storage/IDBDatabaseBackendImpl.cpp:
            (WebCore::IDBDatabaseBackendImpl::transaction):
            * storage/IDBTransactionBackendImpl.cpp:
            (WebCore::IDBTransactionBackendImpl::create):
            (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
            (WebCore::IDBTransactionBackendImpl::objectStore):
            * storage/IDBTransactionBackendImpl.h:
            * storage/IDBTransactionCoordinator.cpp:
            (WebCore::IDBTransactionCoordinator::createTransaction):
            * storage/IDBTransactionCoordinator.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5e2fbfb..c5340d0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-24  Andrei Popescu  <andreip at dhcp-172-16-14-12.lon.corp.google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Implement IDBTransaction::objectStore
+
+        [IndexedDB] IDBTransaction is missing the implementation for objectStore method
+        https://bugs.webkit.org/show_bug.cgi?id=44446
+
+        * storage/indexeddb/script-tests/transaction-basics.js:
+        (test):
+        (openSuccess):
+        (createSuccess):
+        (abortCallback):
+        * storage/indexeddb/transaction-basics-expected.txt:
+
 2010-08-24  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Tor Arne Vestbø.
diff --git a/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js b/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js
index 3b295ea..58ac2a7 100644
--- a/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js
+++ b/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js
@@ -2,30 +2,46 @@ description("Test IndexedDB transaction basics.");
 if (window.layoutTestController)
     layoutTestController.waitUntilDone();
 
-function abortCallback()
+function test()
 {
-    verifyAbortEvent(event);
-    done();
+    shouldBeTrue("'indexedDB' in window");
+    shouldBeFalse("indexedDB == null");
+
+    result = evalAndLog("indexedDB.open('name', 'description')");
+    verifyResult(result);
+    result.onsuccess = openSuccess;
+    result.onerror = unexpectedErrorCallback;
 }
 
-function createTransactionCallback()
+function openSuccess()
 {
+    debug("createObjectStoreCallback():");
     verifySuccessEvent(event);
-    transaction = evalAndLog("event.result.transaction()");
-    transaction.onabort = abortCallback;
-}
+    db = evalAndLog("db = event.result");
 
-function test()
-{
-    shouldBeTrue("'indexedDB' in window");
-    shouldBeFalse("indexedDB == null");
+    deleteAllObjectStores(db);
 
-    result = evalAndLog("indexedDB.open('name', 'description')");
+    result = evalAndLog("db.createObjectStore('storeName', null)");
     verifyResult(result);
-    result.onsuccess = createTransactionCallback;
+    result.onsuccess = createSuccess;
     result.onerror = unexpectedErrorCallback;
 }
 
+function createSuccess()
+{
+    verifySuccessEvent(event);
+    transaction = evalAndLog("db.transaction()");
+    transaction.onabort = abortCallback;
+    var store = evalAndLog("store = transaction.objectStore('storeName')");
+    shouldBeEqualToString("store.name", "storeName");
+}
+
+function abortCallback()
+{
+    verifyAbortEvent(event);
+    done();
+}
+
 test();
 
 var successfullyParsed = true;
diff --git a/LayoutTests/storage/indexeddb/transaction-basics-expected.txt b/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
index 3608374..25d0694 100644
--- a/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
@@ -12,6 +12,7 @@ PASS 'abort' in result is true
 PASS 'readyState' in result is true
 An event should fire shortly...
 
+createObjectStoreCallback():
 Success event fired:
 PASS 'result' in event is true
 PASS 'code' in event is false
@@ -24,7 +25,29 @@ PASS 'abort' in event.target is true
 PASS 'readyState' in event.target is true
 PASS event.target.readyState is event.target.DONE
 
-event.result.transaction()
+db = event.result
+db.createObjectStore('storeName', null)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db.transaction()
+store = transaction.objectStore('storeName')
+PASS store.name is "storeName"
 Abort event fired:
 PASS event.type is "abort"
 PASS successfullyParsed is true
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2ac93c3..7fe9fcb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-24  Andrei Popescu  <andreip at dhcp-172-16-14-12.lon.corp.google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        [IndexedDB] IDBTransaction is missing the implementation for objectStore method
+        https://bugs.webkit.org/show_bug.cgi?id=44446
+
+        * storage/IDBDatabaseBackendImpl.cpp:
+        (WebCore::IDBDatabaseBackendImpl::transaction):
+        * storage/IDBTransactionBackendImpl.cpp:
+        (WebCore::IDBTransactionBackendImpl::create):
+        (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
+        (WebCore::IDBTransactionBackendImpl::objectStore):
+        * storage/IDBTransactionBackendImpl.h:
+        * storage/IDBTransactionCoordinator.cpp:
+        (WebCore::IDBTransactionCoordinator::createTransaction):
+        * storage/IDBTransactionCoordinator.h:
+
 2010-08-24  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Tor Arne Vestbø.
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index 9095039..a912c29 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -174,7 +174,7 @@ void IDBDatabaseBackendImpl::removeObjectStore(const String& name, PassRefPtr<ID
 
 PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::transaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout)
 {
-    return m_transactionCoordinator->createTransaction(objectStores, mode, timeout);
+    return m_transactionCoordinator->createTransaction(objectStores, mode, timeout, this);
 }
 
 void IDBDatabaseBackendImpl::loadObjectStores()
diff --git a/WebCore/storage/IDBTransactionBackendImpl.cpp b/WebCore/storage/IDBTransactionBackendImpl.cpp
index 6ec954b..51b33b2 100755
--- a/WebCore/storage/IDBTransactionBackendImpl.cpp
+++ b/WebCore/storage/IDBTransactionBackendImpl.cpp
@@ -1,29 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "config.h"
 #include "IDBTransactionBackendImpl.h"
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBDatabaseBackendImpl.h"
+#include "SQLiteDatabase.h"
+
 namespace WebCore {
 
-PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendImpl::create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id)
+PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendImpl::create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl* database)
 {
-    return adoptRef(new IDBTransactionBackendImpl(objectStores, mode, timeout, id));
+    return adoptRef(new IDBTransactionBackendImpl(objectStores, mode, timeout, id, database));
 }
 
-IDBTransactionBackendImpl::IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id)
+IDBTransactionBackendImpl::IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl* database)
     : m_objectStoreNames(objectStores)
     , m_mode(mode)
     , m_timeout(timeout)
     , m_id(id)
     , m_aborted(false)
+    , m_database(database)
 {
 }
 
 PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendImpl::objectStore(const String& name)
 {
-    // FIXME: implement.
-    ASSERT_NOT_REACHED();
-    return 0;
+    return m_database->objectStore(name, 0); // FIXME: remove mode param.
 }
 
 void IDBTransactionBackendImpl::scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>)
diff --git a/WebCore/storage/IDBTransactionBackendImpl.h b/WebCore/storage/IDBTransactionBackendImpl.h
index 30b2416..fb57401 100755
--- a/WebCore/storage/IDBTransactionBackendImpl.h
+++ b/WebCore/storage/IDBTransactionBackendImpl.h
@@ -35,9 +35,11 @@
 
 namespace WebCore {
 
+class IDBDatabaseBackendImpl;
+
 class IDBTransactionBackendImpl : public IDBTransactionBackendInterface {
 public:
-    static PassRefPtr<IDBTransactionBackendInterface> create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id);
+    static PassRefPtr<IDBTransactionBackendInterface> create(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl*);
     virtual ~IDBTransactionBackendImpl() { }
 
     virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name);
@@ -48,7 +50,7 @@ public:
     virtual void setCallbacks(IDBTransactionCallbacks* callbacks) { m_callbacks = callbacks; }
 
 private:
-    IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id);
+    IDBTransactionBackendImpl(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, int id, IDBDatabaseBackendImpl*);
 
     RefPtr<DOMStringList> m_objectStoreNames;
     unsigned short m_mode;
@@ -56,6 +58,7 @@ private:
     int m_id;
     bool m_aborted;
     RefPtr<IDBTransactionCallbacks> m_callbacks;
+    RefPtr<IDBDatabaseBackendImpl> m_database;
 };
 
 } // namespace WebCore
diff --git a/WebCore/storage/IDBTransactionCoordinator.cpp b/WebCore/storage/IDBTransactionCoordinator.cpp
index 8e4d256..9790c1f 100644
--- a/WebCore/storage/IDBTransactionCoordinator.cpp
+++ b/WebCore/storage/IDBTransactionCoordinator.cpp
@@ -28,9 +28,10 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "IDBObjectStore.h"
+#include "IDBDatabaseBackendImpl.h"
 #include "IDBObjectStoreBackendInterface.h"
 #include "IDBTransactionBackendImpl.h"
+#include "SQLiteDatabase.h"
 #include "ScriptExecutionContext.h"
 
 namespace WebCore {
@@ -44,9 +45,9 @@ IDBTransactionCoordinator::~IDBTransactionCoordinator()
 {
 }
 
-PassRefPtr<IDBTransactionBackendInterface> IDBTransactionCoordinator::createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout)
+PassRefPtr<IDBTransactionBackendInterface> IDBTransactionCoordinator::createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, IDBDatabaseBackendImpl* database)
 {
-    RefPtr<IDBTransactionBackendInterface> transaction = IDBTransactionBackendImpl::create(objectStores, mode, timeout, ++m_nextID);
+    RefPtr<IDBTransactionBackendInterface> transaction = IDBTransactionBackendImpl::create(objectStores, mode, timeout, ++m_nextID, database);
     m_transactionQueue.add(transaction.get());
     m_idMap.add(m_nextID, transaction);
     return transaction.release();
diff --git a/WebCore/storage/IDBTransactionCoordinator.h b/WebCore/storage/IDBTransactionCoordinator.h
index 9856ad7..104a956 100644
--- a/WebCore/storage/IDBTransactionCoordinator.h
+++ b/WebCore/storage/IDBTransactionCoordinator.h
@@ -36,6 +36,7 @@
 namespace WebCore {
 
 class IDBTransactionCallbacks;
+class IDBDatabaseBackendImpl;
 
 // This class manages transactions as follows. Requests for new transactions are
 // always satisfied and the new transaction is placed in a queue.
@@ -47,12 +48,13 @@ class IDBTransactionCallbacks;
 // The Coordinator maintains a pool of threads. If there are no threads available
 // the next transaction in the queue will have to wait until a thread becomes
 // available.
+// Transactions are executed in the order the were created.
 class IDBTransactionCoordinator : public RefCounted<IDBTransactionCoordinator> {
 public:
     static PassRefPtr<IDBTransactionCoordinator> create() { return adoptRef(new IDBTransactionCoordinator()); }
     virtual ~IDBTransactionCoordinator();
 
-    PassRefPtr<IDBTransactionBackendInterface> createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout);
+    PassRefPtr<IDBTransactionBackendInterface> createTransaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout, IDBDatabaseBackendImpl*);
     void abort(int transactionId);
 
 private:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list