Changeset 117512 in webkit


Ignore:
Timestamp:
May 17, 2012 4:20:26 PM (12 years ago)
Author:
jsbell@chromium.org
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):

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117509 r117512  
     12012-05-17  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Remove IDBIndex.storeName
     4        https://bugs.webkit.org/show_bug.cgi?id=86676
     5
     6        Reviewed by Tony Chang.
     7
     8        Older versions of the IDB spec exposed IDBIndex.storeName. While it's been removed
     9        from the IDL, the additional storage/plumbing are unnecessary clutter. Nuke it!
     10
     11        No new tests - no functional changes.
     12
     13        * Modules/indexeddb/IDBIndexBackendImpl.cpp:
     14        (WebCore::IDBIndexBackendImpl::IDBIndexBackendImpl): Remove storeName parameter, and
     15        const declaration on object store param. The former was used to get a non-const pointer
     16        via indirection in openCursorInternal.
     17        (WebCore::IDBIndexBackendImpl::openCursorInternal): Use store pointer directly, don't
     18        look it up by name in the transaction.
     19        * Modules/indexeddb/IDBIndexBackendImpl.h:
     20        (WebCore::IDBIndexBackendImpl::create): Remove storeName parameters.
     21        (IDBIndexBackendImpl): Remove storeName() method.
     22        * Modules/indexeddb/IDBIndexBackendInterface.h:
     23        (IDBIndexBackendInterface): Remove storeName parameter.
     24        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
     25        (WebCore::IDBObjectStoreBackendImpl::createIndex): Remove storeName parameter.
     26        (WebCore::IDBObjectStoreBackendImpl::loadIndexes): Remove storeName parameter.
     27
    1282012-05-17  Joshua Bell  <jsbell@chromium.org>
    229
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp

    r117334 r117512  
    4242namespace WebCore {
    4343
    44 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)
     44IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry)
    4545    : m_backingStore(backingStore)
    4646    , m_databaseId(databaseId)
     
    4848    , m_id(id)
    4949    , m_name(name)
    50     , m_storeName(storeName)
    5150    , m_keyPath(keyPath)
    5251    , m_unique(unique)
     
    5554}
    5655
    57 IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, const IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry)
     56IDBIndexBackendImpl::IDBIndexBackendImpl(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& keyPath, bool unique, bool multiEntry)
    5857    : m_backingStore(backingStore)
    5958    , m_databaseId(databaseId)
     
    6160    , m_id(InvalidId)
    6261    , m_name(name)
    63     , m_storeName(storeName)
    6462    , m_keyPath(keyPath)
    6563    , m_unique(unique)
     
    9795    }
    9896
    99     ExceptionCode ec = 0;
    100     RefPtr<IDBObjectStoreBackendInterface> objectStore = transaction->objectStore(index->m_storeName, ec);
    101     ASSERT(objectStore && !ec);
    102 
    103     RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), direction, cursorType, transaction.get(), objectStore.get());
     97    RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), direction, cursorType, transaction.get(), index->m_objectStoreBackend);
    10498    callbacks->onSuccess(cursor.release());
    10599}
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.h

    r117334 r117512  
    4141class IDBIndexBackendImpl : public IDBIndexBackendInterface {
    4242public:
    43     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)
     43    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry)
    4444    {
    45         return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, id, name, storeName, keyPath, unique, multiEntry));
     45        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, id, name, keyPath, unique, multiEntry));
    4646    }
    47     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)
     47    static PassRefPtr<IDBIndexBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, IDBObjectStoreBackendImpl* objectStoreBackend, const String& name, const String& keyPath, bool unique, bool multiEntry)
    4848    {
    49         return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, name, storeName, keyPath, unique, multiEntry));
     49        return adoptRef(new IDBIndexBackendImpl(backingStore, databaseId, objectStoreBackend, name, keyPath, unique, multiEntry));
    5050    }
    5151    virtual ~IDBIndexBackendImpl();
     
    6363    // Implements IDBIndexBackendInterface.
    6464    virtual String name() { return m_name; }
    65     virtual String storeName() { return m_storeName; }
    6665    virtual String keyPath() { return m_keyPath; }
    6766    virtual bool unique() { return m_unique; }
     
    7776
    7877private:
    79     IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
    80     IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, const IDBObjectStoreBackendImpl*, const String& name, const String& storeName, const String& keyPath, bool unique, bool multiEntry);
     78    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, IDBObjectStoreBackendImpl*, int64_t id, const String& name, const String& keyPath, bool unique, bool multiEntry);
     79    IDBIndexBackendImpl(IDBBackingStore*, int64_t databaseId, IDBObjectStoreBackendImpl*, const String& name, const String& keyPath, bool unique, bool multiEntry);
    8180
    8281    static void openCursorInternal(ScriptExecutionContext*, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBKeyRange>, unsigned short direction, IDBCursorBackendInterface::CursorType, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
     
    9594
    9695    int64_t m_databaseId;
    97     const IDBObjectStoreBackendImpl* m_objectStoreBackend;
     96    IDBObjectStoreBackendImpl* m_objectStoreBackend;
    9897    int64_t m_id;
    9998    String m_name;
    100     String m_storeName;
    10199    String m_keyPath;
    102100    bool m_unique;
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendInterface.h

    r114981 r117512  
    4747
    4848    virtual String name() = 0;
    49     virtual String storeName() = 0;
    5049    virtual String keyPath() = 0;
    5150    virtual bool unique() = 0;
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp

    r117338 r117512  
    519519    }
    520520
    521     RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, name, m_name, keyPath, unique, multiEntry);
     521    RefPtr<IDBIndexBackendImpl> index = IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, name, keyPath, unique, multiEntry);
    522522    ASSERT(index->name() == name);
    523523
     
    666666
    667667    for (size_t i = 0; i < ids.size(); i++)
    668         m_indexes.set(names[i], IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, ids[i], names[i], m_name, keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
     668        m_indexes.set(names[i], IDBIndexBackendImpl::create(backingStore().get(), databaseId(), this, ids[i], names[i], keyPaths[i], uniqueFlags[i], multiEntryFlags[i]));
    669669}
    670670
  • trunk/Source/WebKit/chromium/ChangeLog

    r117509 r117512  
     12012-05-17  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Remove IDBIndex.storeName
     4        https://bugs.webkit.org/show_bug.cgi?id=86676
     5
     6        Reviewed by Tony Chang.
     7
     8        * public/WebIDBIndex.h:
     9        (WebIDBIndex): Can't remove from here until Chromium is updated
     10        * src/IDBIndexBackendProxy.cpp: Removed storeName()
     11        * src/IDBIndexBackendProxy.h: Removed storeName()
     12        (IDBIndexBackendProxy):
     13        * src/WebIDBIndexImpl.cpp: Removed storeName()
     14        * src/WebIDBIndexImpl.h: Removed storeName()
     15        (WebIDBIndexImpl):
     16
    1172012-05-17  Joshua Bell  <jsbell@chromium.org>
    218
  • trunk/Source/WebKit/chromium/public/WebIDBIndex.h

    r115339 r117512  
    4848        return WebString();
    4949    }
     50    // FIXME: Remove method once callers are updated.
    5051    virtual WebString storeName() const
    5152    {
  • trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp

    r115339 r117512  
    6161}
    6262
    63 String IDBIndexBackendProxy::storeName()
    64 {
    65     return m_webIDBIndex->storeName();
    66 }
    67 
    6863String IDBIndexBackendProxy::keyPath()
    6964{
  • trunk/Source/WebKit/chromium/src/IDBIndexBackendProxy.h

    r114981 r117512  
    4343
    4444    virtual String name();
    45     virtual String storeName();
    4645    virtual String keyPath();
    4746    virtual bool unique();
  • trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp

    r115339 r117512  
    5454}
    5555
    56 WebString WebIDBIndexImpl::storeName() const
    57 {
    58     return m_backend->storeName();
    59 }
    60 
    6156WebIDBKeyPath WebIDBIndexImpl::keyPath() const
    6257{
  • trunk/Source/WebKit/chromium/src/WebIDBIndexImpl.h

    r115339 r117512  
    4545
    4646    virtual WebString name() const;
    47     virtual WebString storeName() const;
    4847    virtual WebIDBKeyPath keyPath() const;
    4948    // FIXME: Remove this method once callers are updated.
Note: See TracChangeset for help on using the changeset viewer.