Title: [117512] trunk/Source
Revision
117512
Author
jsb...@chromium.org
Date
2012-05-17 16:20:26 -0700 (Thu, 17 May 2012)

Log Message

IndexedDB: Remove IDBIndex.storeName
https://bugs.webkit.org/show_bug.cgi?id=86676

Reviewed by Tony Chang.

Source/WebCore:

Older versions of the IDB spec exposed IDBIndex.storeName. While it's been removed
from the IDL, the additional storage/plumbing are unnecessary clutter. Nuke it!

No new tests - no functional changes.

* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl): Remove storeName parameter, and
const declaration on object store param. The former was used to get a non-const pointer
via indirection in openCursorInternal.
(WebCore::IDBIndexBackendImpl::openCursorInternal): Use store pointer directly, don't
look it up by name in the transaction.
* Modules/indexeddb/IDBIndexBackendImpl.h:
(WebCore::IDBIndexBackendImpl::create): Remove storeName parameters.
(IDBIndexBackendImpl): Remove storeName() method.
* Modules/indexeddb/IDBIndexBackendInterface.h:
(IDBIndexBackendInterface): Remove storeName parameter.
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::createIndex): Remove storeName parameter.
(WebCore::IDBObjectStoreBackendImpl::loadIndexes): Remove storeName parameter.

Source/WebKit/chromium:

* public/WebIDBIndex.h:
(WebIDBIndex): Can't remove from here until Chromium is updated
* src/IDBIndexBackendProxy.cpp: Removed storeName()
* src/IDBIndexBackendProxy.h: Removed storeName()
(IDBIndexBackendProxy):
* src/WebIDBIndexImpl.cpp: Removed storeName()
* src/WebIDBIndexImpl.h: Removed storeName()
(WebIDBIndexImpl):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (117511 => 117512)


--- trunk/Source/WebCore/ChangeLog	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebCore/ChangeLog	2012-05-17 23:20:26 UTC (rev 117512)
@@ -1,5 +1,32 @@
 2012-05-17  Joshua Bell  <jsb...@chromium.org>
 
+        IndexedDB: Remove IDBIndex.storeName
+        https://bugs.webkit.org/show_bug.cgi?id=86676
+
+        Reviewed by Tony Chang.
+
+        Older versions of the IDB spec exposed IDBIndex.storeName. While it's been removed
+        from the IDL, the additional storage/plumbing are unnecessary clutter. Nuke it!
+
+        No new tests - no functional changes.
+
+        * Modules/indexeddb/IDBIndexBackendImpl.cpp:
+        (WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl): Remove storeName parameter, and
+        const declaration on object store param. The former was used to get a non-const pointer
+        via indirection in openCursorInternal.
+        (WebCore::IDBIndexBackendImpl::openCursorInternal): Use store pointer directly, don't
+        look it up by name in the transaction.
+        * Modules/indexeddb/IDBIndexBackendImpl.h:
+        (WebCore::IDBIndexBackendImpl::create): Remove storeName parameters.
+        (IDBIndexBackendImpl): Remove storeName() method.
+        * Modules/indexeddb/IDBIndexBackendInterface.h:
+        (IDBIndexBackendInterface): Remove storeName parameter.
+        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+        (WebCore::IDBObjectStoreBackendImpl::createIndex): Remove storeName parameter.
+        (WebCore::IDBObjectStoreBackendImpl::loadIndexes): Remove storeName parameter.
+
+2012-05-17  Joshua Bell  <jsb...@chromium.org>
+
         IndexedDB: Implement IDBObjectStore.autoIncrement
         https://bugs.webkit.org/show_bug.cgi?id=86662
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp (117511 => 117512)


--- trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp	2012-05-17 23:20:26 UTC (rev 117512)
@@ -41,26 +41,24 @@
 
 namespace WebCore {
 
-IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
+IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry)
     : m_backingStore(backingStore)
     , m_databaseId(databaseId)
     , m_objectStoreBackend(objectStoreBackend)
     , m_id(id)
     , m_name(name)
-    , m_storeName(storeName)
     , m_keyPath(keyPath)
     , m_unique(unique)
     , m_multiEntry(multiEntry)
 {
 }
 
-IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
+IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& keyPath, bool unique, bool multiEntry)
     : m_backingStore(backingStore)
     , m_databaseId(databaseId)
     , m_objectStoreBackend(objectStoreBackend)
     , m_id(InvalidId)
     , m_name(name)
-    , m_storeName(storeName)
     , m_keyPath(keyPath)
     , m_unique(unique)
     , m_multiEntry(multiEntry)
@@ -96,11 +94,7 @@
         return;
     }
 
-    ExceptionCode ec = 0;
-    RefPtr<IDBObjectStoreBackendInterface> objectStore = transaction->objectStore(index->m_storeName, ec);
-    ASSERT(objectStore && !ec);
-
-    RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), direction, cursorType, transaction.get(), objectStore.get());
+    RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), direction, cursorType, transaction.get(), index->m_objectStoreBackend);
     callbacks->onSuccess(cursor.release());
 }
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h (117511 => 117512)


--- trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h	2012-05-17 23:20:26 UTC (rev 117512)
@@ -40,13 +40,13 @@
 
 class IDBIndexBackendImpl : public IDBIndexBackendInterface {
 public:
-    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
+    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry)
     {
-        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, id, name, storeName, keyPath, unique, multiEntry));
+        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, id, name, keyPath, unique, multiEntry));
     }
-    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
+    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& keyPath, bool unique, bool multiEntry)
     {
-        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, name, storeName, keyPath, unique, multiEntry));
+        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, name, keyPath, unique, multiEntry));
     }
     virtual ~IDBIndexBackendImpl();
 
@@ -62,7 +62,6 @@
 
     // Implements IDBIndexBackendInterface.
     virtual String name() { return m_name; }
-    virtual String storeName() { return m_storeName; }
     virtual String keyPath() { return m_keyPath; }
     virtual bool unique() { return m_unique; }
     virtual bool multiEntry() { return m_multiEntry; }
@@ -76,8 +75,8 @@
     virtual void getKey(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
 
 private:
-    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
-    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
+    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry);
+    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, IDBObjectStoreBackendImpl*, const String& name, const String& keyPath, bool unique, bool multiEntry);
 
     static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, IDBCursorBackendInterface::CursorType, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
     static void countInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
@@ -94,10 +93,9 @@
     RefPtr<IDBBackingStore> m_backingStore;
 
     int64_t m_databaseId;
-    const IDBObjectStoreBackendImpl* m_objectStoreBackend;
+    IDBObjectStoreBackendImpl* m_objectStoreBackend;
     int64_t m_id;
     String m_name;
-    String m_storeName;
     String m_keyPath;
     bool m_unique;
     bool m_multiEntry;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h (117511 => 117512)


--- trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h	2012-05-17 23:20:26 UTC (rev 117512)
@@ -46,7 +46,6 @@
     virtual ~IDBIndexBackendInterface() { }
 
     virtual String name() = 0;
-    virtual String storeName() = 0;
     virtual String keyPath() = 0;
     virtual bool unique() = 0;
     virtual bool multiEntry() = 0;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp (117511 => 117512)


--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp	2012-05-17 23:20:26 UTC (rev 117512)
@@ -518,7 +518,7 @@
         return 0;
     }
 
-    RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, name, m_name, keyPath, unique, multiEntry);
+    RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, name, keyPath, unique, multiEntry);
     ASSERT(index->name() == name);
 
     RefPtr<IDBObjectStoreBackendImpl> objectStore = this;
@@ -665,7 +665,7 @@
     ASSERT(multiEntryFlags.size() == ids.size());
 
     for (size_t i = 0; i < ids.size(); i++)
-        m_indexes.set(names[i], IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, ids[i], names[i], m_name, keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
+        m_indexes.set(names[i], IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, ids[i], names[i], keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
 }
 
 void IDBObjectStoreBackendImpl::removeIndexFromMap(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBIndexBackendImpl> index)

Modified: trunk/Source/WebKit/chromium/ChangeLog (117511 => 117512)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-17 23:20:26 UTC (rev 117512)
@@ -1,5 +1,21 @@
 2012-05-17  Joshua Bell  <jsb...@chromium.org>
 
+        IndexedDB: Remove IDBIndex.storeName
+        https://bugs.webkit.org/show_bug.cgi?id=86676
+
+        Reviewed by Tony Chang.
+
+        * public/WebIDBIndex.h:
+        (WebIDBIndex): Can't remove from here until Chromium is updated
+        * src/IDBIndexBackendProxy.cpp: Removed storeName()
+        * src/IDBIndexBackendProxy.h: Removed storeName()
+        (IDBIndexBackendProxy):
+        * src/WebIDBIndexImpl.cpp: Removed storeName()
+        * src/WebIDBIndexImpl.h: Removed storeName()
+        (WebIDBIndexImpl):
+
+2012-05-17  Joshua Bell  <jsb...@chromium.org>
+
         IndexedDB: Implement IDBObjectStore.autoIncrement
         https://bugs.webkit.org/show_bug.cgi?id=86662
 

Modified: trunk/Source/WebKit/chromium/public/WebIDBIndex.h (117511 => 117512)


--- trunk/Source/WebKit/chromium/public/WebIDBIndex.h	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/public/WebIDBIndex.h	2012-05-17 23:20:26 UTC (rev 117512)
@@ -47,6 +47,7 @@
         WEBKIT_ASSERT_NOT_REACHED();
         return WebString();
     }
+    // FIXME: Remove method once callers are updated.
     virtual WebString storeName() const
     {
         WEBKIT_ASSERT_NOT_REACHED();

Modified: trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp (117511 => 117512)


--- trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp	2012-05-17 23:20:26 UTC (rev 117512)
@@ -60,11 +60,6 @@
     return m_webIDBIndex->name();
 }
 
-String IDBIndexBackendProxy::storeName()
-{
-    return m_webIDBIndex->storeName();
-}
-
 String IDBIndexBackendProxy::keyPath()
 {
     return m_webIDBIndex->keyPath().string();

Modified: trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.h (117511 => 117512)


--- trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.h	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.h	2012-05-17 23:20:26 UTC (rev 117512)
@@ -42,7 +42,6 @@
     virtual ~IDBIndexBackendProxy();
 
     virtual String name();
-    virtual String storeName();
     virtual String keyPath();
     virtual bool unique();
     virtual bool multiEntry();

Modified: trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp (117511 => 117512)


--- trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp	2012-05-17 23:20:26 UTC (rev 117512)
@@ -53,11 +53,6 @@
     return m_backend->name();
 }
 
-WebString WebIDBIndexImpl::storeName() const
-{
-    return m_backend->storeName();
-}
-
 WebIDBKeyPath WebIDBIndexImpl::keyPath() const
 {
     return WebIDBKeyPath(m_backend->keyPath());

Modified: trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.h (117511 => 117512)


--- trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.h	2012-05-17 23:19:04 UTC (rev 117511)
+++ trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.h	2012-05-17 23:20:26 UTC (rev 117512)
@@ -44,7 +44,6 @@
     virtual ~WebIDBIndexImpl();
 
     virtual WebString name() const;
-    virtual WebString storeName() const;
     virtual WebIDBKeyPath keyPath() const;
     // FIXME: Remove this method once callers are updated.
     // http://webkit.org/b/84207
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to