Changeset 125568 in webkit


Ignore:
Timestamp:
Aug 14, 2012 9:06:43 AM (12 years ago)
Author:
jsbell@chromium.org
Message:

IndexedDB: Pass cursor continue results back in callback
https://bugs.webkit.org/show_bug.cgi?id=92278

Reviewed by Tony Chang.

Supply the updated cursor key/primaryKey/value in the success callback,
rather than forcing the callee to make three calls into the back end to
fetch them. Callbacks onSuccess(cursor) and onSuccessWithContinuation()
are given the three new payload parameters (and the latter is renamed.)

Source/WebCore:

No new tests - no behavioral changes.

  • Modules/indexeddb/IDBCallbacks.h: Updated callbacks.

(IDBCallbacks):

  • Modules/indexeddb/IDBCursor.cpp:

(WebCore::IDBCursor::setValueReady): Takes values rather than fetching them.

  • Modules/indexeddb/IDBCursor.h:

(IDBCursor):

  • Modules/indexeddb/IDBCursorBackendImpl.cpp: Delete accessors.

(WebCore::IDBCursorBackendImpl::advanceInternal): Pass along updated cursor state.
(WebCore::IDBCursorBackendImpl::continueFunctionInternal): Ditto.

  • Modules/indexeddb/IDBCursorBackendImpl.h:

(IDBCursorBackendImpl): Delete accessors from interface...
(WebCore::IDBCursorBackendImpl::key): ...but keep them for use within back-end.
(WebCore::IDBCursorBackendImpl::primaryKey):
(WebCore::IDBCursorBackendImpl::value):

  • Modules/indexeddb/IDBCursorBackendInterface.h: Delete accessors.
  • Modules/indexeddb/IDBIndexBackendImpl.cpp:

(WebCore::IDBIndexBackendImpl::openCursorInternal): Pass along new cursor state.

  • Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:

(WebCore::IDBObjectStoreBackendImpl::openCursorInternal): Ditto.

  • Modules/indexeddb/IDBRequest.cpp:

(WebCore::IDBRequest::setResultCursor): Stash updated cursor state until dispatch.
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::dispatchEvent): Update cursor with new state.

  • Modules/indexeddb/IDBRequest.h:

(IDBRequest):

  • inspector/InspectorIndexedDBAgent.cpp: Update iteration code to use new callbacks.

(WebCore):

Source/WebKit/chromium:

  • public/WebIDBCallbacks.h:

(WebIDBCallbacks):
(WebKit::WebIDBCallbacks::onSuccess): Replace with no-op stub.
(WebKit::WebIDBCallbacks::onSuccessWithContinuation): Ditto.

  • public/WebIDBCursor.h:

(WebIDBCursor): Methods can be removed once Chromium is cleaned up.

  • src/IDBCallbacksProxy.cpp: Updated callbacks.

(WebKit::IDBCallbacksProxy::onSuccess):
(WebKit):

  • src/IDBCallbacksProxy.h: Updated callbacks.

(IDBCallbacksProxy):

  • src/IDBCursorBackendProxy.cpp: Remove back end accessors.
  • src/IDBCursorBackendProxy.h:

(IDBCursorBackendProxy):

  • src/WebIDBCallbacksImpl.cpp: Updated callbacks.

(WebKit::WebIDBCallbacksImpl::onSuccess):

  • src/WebIDBCallbacksImpl.h: Updated callbacks.

(WebIDBCallbacksImpl):

  • src/WebIDBCursorImpl.cpp: Remove back end accessors.
  • src/WebIDBCursorImpl.h: Remove back end accessors.

(WebIDBCursorImpl):

  • tests/IDBAbortOnCorruptTest.cpp: Update test stubs.

(WebCore::MockIDBCallbacks::onSuccess):

  • tests/IDBDatabaseBackendTest.cpp: Ditto.
  • tests/IDBRequestTest.cpp: Ditto.
Location:
trunk/Source
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r125563 r125568  
     12012-08-14  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Pass cursor continue results back in callback
     4        https://bugs.webkit.org/show_bug.cgi?id=92278
     5
     6        Reviewed by Tony Chang.
     7
     8        Supply the updated cursor key/primaryKey/value in the success callback,
     9        rather than forcing the callee to make three calls into the back end to
     10        fetch them. Callbacks onSuccess(cursor) and onSuccessWithContinuation()
     11        are given the three new payload parameters (and the latter is renamed.)
     12
     13        No new tests - no behavioral changes.
     14
     15        * Modules/indexeddb/IDBCallbacks.h: Updated callbacks.
     16        (IDBCallbacks):
     17        * Modules/indexeddb/IDBCursor.cpp:
     18        (WebCore::IDBCursor::setValueReady): Takes values rather than fetching them.
     19        * Modules/indexeddb/IDBCursor.h:
     20        (IDBCursor):
     21        * Modules/indexeddb/IDBCursorBackendImpl.cpp: Delete accessors.
     22        (WebCore::IDBCursorBackendImpl::advanceInternal): Pass along updated cursor state.
     23        (WebCore::IDBCursorBackendImpl::continueFunctionInternal): Ditto.
     24        * Modules/indexeddb/IDBCursorBackendImpl.h:
     25        (IDBCursorBackendImpl): Delete accessors from interface...
     26        (WebCore::IDBCursorBackendImpl::key): ...but keep them for use within back-end.
     27        (WebCore::IDBCursorBackendImpl::primaryKey):
     28        (WebCore::IDBCursorBackendImpl::value):
     29        * Modules/indexeddb/IDBCursorBackendInterface.h: Delete accessors.
     30        * Modules/indexeddb/IDBIndexBackendImpl.cpp:
     31        (WebCore::IDBIndexBackendImpl::openCursorInternal): Pass along new cursor state.
     32        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
     33        (WebCore::IDBObjectStoreBackendImpl::openCursorInternal): Ditto.
     34        * Modules/indexeddb/IDBRequest.cpp:
     35        (WebCore::IDBRequest::setResultCursor): Stash updated cursor state until dispatch.
     36        (WebCore::IDBRequest::onSuccess):
     37        (WebCore::IDBRequest::dispatchEvent): Update cursor with new state.
     38        * Modules/indexeddb/IDBRequest.h:
     39        (IDBRequest):
     40        * inspector/InspectorIndexedDBAgent.cpp: Update iteration code to use new callbacks.
     41        (WebCore):
     42
    1432012-08-14  Arvid Nilsson  <anilsson@rim.com>
    244
  • trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h

    r124675 r125568  
    5151
    5252    virtual void onError(PassRefPtr<IDBDatabaseError>) = 0;
     53    // From IDBFactory.webkitGetDatabaseNames()
    5354    virtual void onSuccess(PassRefPtr<DOMStringList>) = 0;
    54     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) = 0;
     55    // From IDBObjectStore/IDBIndex.openCursor(), IDBIndex.openKeyCursor()
     56    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
     57    // From IDBFactory.open()
    5558    virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) = 0;
     59    // From IDBObjectStore.add()/put(), IDBIndex.getKey()
    5660    virtual void onSuccess(PassRefPtr<IDBKey>) = 0;
     61    // From IDBDatabase.setVersion()
    5762    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) = 0;
     63    // From IDBObjectStore/IDBIndex.get()/count(), and various methods that yield null/undefined.
    5864    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) = 0;
     65    // From IDBObjectStore/IDBIndex.get() (with key injection)
    5966    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) = 0;
    60     virtual void onSuccessWithContinuation() = 0;
     67    // From IDBCursor.advance()/continue()
     68    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
     69    // From IDBCursor.advance()/continue()
    6170    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values) = 0;
    6271    virtual void onBlocked() { ASSERT_NOT_REACHED(); }
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp

    r124842 r125568  
    266266}
    267267
    268 void IDBCursor::setValueReady()
    269 {
    270     m_currentKey = m_backend->key();
    271     m_currentPrimaryKey = m_backend->primaryKey();
    272 
    273     RefPtr<SerializedScriptValue> value = m_backend->value();
     268void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> prpValue)
     269{
     270    m_currentKey = key;
     271    m_currentPrimaryKey = primaryKey;
     272
     273    RefPtr<SerializedScriptValue> value = prpValue;
    274274    if (!isKeyCursor()) {
    275275        RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h

    r121612 r125568  
    8383    void postSuccessHandlerCallback();
    8484    void close();
    85     void setValueReady();
     85    void setValueReady(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
    8686
    8787    // The spec requires that the script object that wraps the value
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp

    r124361 r125568  
    6363}
    6464
    65 PassRefPtr<IDBKey> IDBCursorBackendImpl::key() const
    66 {
    67     IDB_TRACE("IDBCursorBackendImpl::key");
    68     return m_cursor->key();
    69 }
    70 
    71 PassRefPtr<IDBKey> IDBCursorBackendImpl::primaryKey() const
    72 {
    73     IDB_TRACE("IDBCursorBackendImpl::primaryKey");
    74     return m_cursor->primaryKey();
    75 }
    76 
    77 PassRefPtr<SerializedScriptValue> IDBCursorBackendImpl::value() const
    78 {
    79     IDB_TRACE("IDBCursorBackendImpl::value");
    80     if (m_cursorType == IndexKeyCursor)
    81       return SerializedScriptValue::nullValue();
    82     return SerializedScriptValue::createFromWire(m_cursor->value());
    83 }
    84 
    8565void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
    8666{
     
    11090    }
    11191
    112     callbacks->onSuccessWithContinuation();
     92    callbacks->onSuccess(cursor->key(), cursor->primaryKey(), cursor->value());
    11393}
    11494
     
    125105    }
    126106
    127     callbacks->onSuccessWithContinuation();
     107    callbacks->onSuccess(cursor->key(), cursor->primaryKey(), cursor->value());
    128108}
    129109
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h

    r124361 r125568  
    5555
    5656    // IDBCursorBackendInterface
    57     virtual PassRefPtr<IDBKey> key() const;
    58     virtual PassRefPtr<IDBKey> primaryKey() const;
    59     virtual PassRefPtr<SerializedScriptValue> value() const;
    6057    virtual void advance(unsigned long, PassRefPtr<IDBCallbacks>, ExceptionCode&);
    6158    virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&);
     
    6562    virtual void postSuccessHandlerCallback() { ASSERT_NOT_REACHED(); }
    6663
     64    PassRefPtr<IDBKey> key() const { return m_cursor->key(); }
     65    PassRefPtr<IDBKey> primaryKey() const { return m_cursor->primaryKey(); }
     66    PassRefPtr<SerializedScriptValue> value() const { return (m_cursorType == IndexKeyCursor) ? SerializedScriptValue::nullValue() : SerializedScriptValue::createFromWire(m_cursor->value()); }
    6767    void close();
    6868
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursorBackendInterface.h

    r123843 r125568  
    5454    };
    5555
    56     virtual PassRefPtr<IDBKey> key() const = 0;
    57     virtual PassRefPtr<IDBKey> primaryKey() const = 0;
    58     virtual PassRefPtr<SerializedScriptValue> value() const = 0;
    59 
    6056    virtual void advance(unsigned long count, PassRefPtr<IDBCallbacks>, ExceptionCode&) = 0;
    6157    virtual void continueFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, ExceptionCode&) = 0;
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndexBackendImpl.cpp

    r124361 r125568  
    100100    }
    101101
    102     RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), cursorType, transaction.get(), index->m_objectStoreBackend);
    103     callbacks->onSuccess(cursor.release());
     102    RefPtr<IDBCursorBackendImpl> cursor = IDBCursorBackendImpl::create(backingStoreCursor.get(), cursorType, transaction.get(), index->m_objectStoreBackend);
     103    callbacks->onSuccess(cursor, cursor->key(), cursor->primaryKey(), cursor->value());
    104104}
    105105
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp

    r124361 r125568  
    540540    }
    541541
    542     RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(backingStoreCursor.release(), IDBCursorBackendInterface::ObjectStoreCursor, transaction.get(), objectStore.get());
    543     callbacks->onSuccess(cursor.release());
     542    RefPtr<IDBCursorBackendImpl> cursor = IDBCursorBackendImpl::create(backingStoreCursor.release(), IDBCursorBackendInterface::ObjectStoreCursor, transaction.get(), objectStore.get());
     543    callbacks->onSuccess(cursor, cursor->key(), cursor->primaryKey(), cursor->value());
    544544}
    545545
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp

    r124974 r125568  
    200200}
    201201
    202 void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> prpCursor)
     202void IDBRequest::setResultCursor(PassRefPtr<IDBCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    203203{
    204204    ASSERT(m_readyState == PENDING);
     205    m_cursorKey = key;
     206    m_cursorPrimaryKey = primaryKey;
     207    m_cursorValue = value;
     208
    205209    if (m_cursorType == IDBCursorBackendInterface::IndexKeyCursor) {
    206         m_result = IDBAny::create(prpCursor);
    207         return;
    208     }
    209 
    210     m_result = IDBAny::create(IDBCursorWithValue::fromCursor(prpCursor));
     210        m_result = IDBAny::create(cursor);
     211        return;
     212    }
     213
     214    m_result = IDBAny::create(IDBCursorWithValue::fromCursor(cursor));
    211215}
    212216
     
    251255}
    252256
    253 void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend)
     257void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    254258{
    255259    IDB_TRACE("IDBRequest::onSuccess(IDBCursor)");
     
    263267    else
    264268        cursor = IDBCursorWithValue::create(backend, m_cursorDirection, this, m_source.get(), m_transaction.get());
    265     setResultCursor(cursor);
     269    setResultCursor(cursor, key, primaryKey, value);
    266270
    267271    enqueueEvent(createSuccessEvent());
     
    370374}
    371375
    372 void IDBRequest::onSuccessWithContinuation()
    373 {
    374     IDB_TRACE("IDBRequest::onSuccessWithContinuation");
     376void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
     377{
     378    IDB_TRACE("IDBRequest::onSuccess(key, primaryKey, value)");
    375379    if (!shouldEnqueueEvent())
    376380        return;
    377381
    378382    ASSERT(m_pendingCursor);
    379     setResultCursor(m_pendingCursor.release());
     383    setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
    380384    enqueueEvent(createSuccessEvent());
    381385}
     
    449453        cursorToNotify = getResultCursor();
    450454        if (cursorToNotify)
    451             cursorToNotify->setValueReady();
     455            cursorToNotify->setValueReady(m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue.release());
    452456    }
    453457
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h

    r125231 r125568  
    8383    virtual void onSuccess(PassRefPtr<DOMStringList>);
    8484    virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>);
    85     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>);
     85    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
    8686    virtual void onSuccess(PassRefPtr<IDBKey>);
    8787    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>);
    8888    virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
    8989    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&);
    90     virtual void onSuccessWithContinuation();
     90    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
    9191    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { ASSERT_NOT_REACHED(); } // Not implemented. Callback should not reach the renderer side.
    9292    virtual void onBlocked();
     
    124124
    125125    PassRefPtr<IDBCursor> getResultCursor();
    126     void setResultCursor(PassRefPtr<IDBCursor>);
     126    void setResultCursor(PassRefPtr<IDBCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
    127127
    128128    RefPtr<IDBAny> m_source;
     
    138138    IDBCursor::Direction m_cursorDirection;
    139139    RefPtr<IDBCursor> m_pendingCursor;
     140    RefPtr<IDBKey> m_cursorKey;
     141    RefPtr<IDBKey> m_cursorPrimaryKey;
     142    RefPtr<SerializedScriptValue> m_cursorValue;
    140143
    141144    EventTargetData m_eventTargetData;
  • trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp

    r123569 r125568  
    109109    virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { }
    110110    virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { }
    111     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { }
     111    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
    112112    virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE { }
    113113    virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { }
     
    115115    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
    116116    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) OVERRIDE { }
    117     virtual void onSuccessWithContinuation() OVERRIDE { }
     117    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
    118118    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { }
    119119    virtual void onBlocked() OVERRIDE { }
     
    491491    }
    492492
    493     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursor)
     493    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    494494    {
    495495        m_idbCursor = idbCursor;
    496         onSuccessWithContinuation();
    497     }
    498 
    499     virtual void onSuccessWithContinuation()
     496        onSuccess(key, primaryKey, value);
     497    }
     498
     499    virtual void onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    500500    {
    501501        if (m_skipCount) {
     
    510510        }
    511511
    512         RefPtr<IDBKey> key = m_idbCursor->key();
    513         RefPtr<IDBKey> primaryKey = m_idbCursor->primaryKey();
    514         RefPtr<SerializedScriptValue> value = m_idbCursor->value();
    515512        RefPtr<TypeBuilder::Runtime::RemoteObject> wrappedValue = m_injectedScript.wrapSerializedObject(value.get(), String());
    516513        RefPtr<DataEntry> dataEntry = DataEntry::create()
  • trunk/Source/WebKit/chromium/ChangeLog

    r125561 r125568  
     12012-08-14  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Pass cursor continue results back in callback
     4        https://bugs.webkit.org/show_bug.cgi?id=92278
     5
     6        Reviewed by Tony Chang.
     7
     8        Supply the updated cursor key/primaryKey/value in the success callback,
     9        rather than forcing the callee to make three calls into the back end to
     10        fetch them. Callbacks onSuccess(cursor) and onSuccessWithContinuation()
     11        are given the three new payload parameters (and the latter is renamed.)
     12
     13        * public/WebIDBCallbacks.h:
     14        (WebIDBCallbacks):
     15        (WebKit::WebIDBCallbacks::onSuccess): Replace with no-op stub.
     16        (WebKit::WebIDBCallbacks::onSuccessWithContinuation): Ditto.
     17        * public/WebIDBCursor.h:
     18        (WebIDBCursor): Methods can be removed once Chromium is cleaned up.
     19        * src/IDBCallbacksProxy.cpp: Updated callbacks.
     20        (WebKit::IDBCallbacksProxy::onSuccess):
     21        (WebKit):
     22        * src/IDBCallbacksProxy.h: Updated callbacks.
     23        (IDBCallbacksProxy):
     24        * src/IDBCursorBackendProxy.cpp: Remove back end accessors.
     25        * src/IDBCursorBackendProxy.h:
     26        (IDBCursorBackendProxy):
     27        * src/WebIDBCallbacksImpl.cpp: Updated callbacks.
     28        (WebKit::WebIDBCallbacksImpl::onSuccess):
     29        * src/WebIDBCallbacksImpl.h: Updated callbacks.
     30        (WebIDBCallbacksImpl):
     31        * src/WebIDBCursorImpl.cpp: Remove back end accessors.
     32        * src/WebIDBCursorImpl.h: Remove back end accessors.
     33        (WebIDBCursorImpl):
     34        * tests/IDBAbortOnCorruptTest.cpp: Update test stubs.
     35        (WebCore::MockIDBCallbacks::onSuccess):
     36        * tests/IDBDatabaseBackendTest.cpp: Ditto.
     37        * tests/IDBRequestTest.cpp: Ditto.
     38
    1392012-08-14  Peter Beverloo  <peter@chromium.org>
    240
  • trunk/Source/WebKit/chromium/public/WebIDBCallbacks.h

    r124382 r125568  
    5151    virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); }
    5252    virtual void onSuccess(const WebDOMStringList&) { WEBKIT_ASSERT_NOT_REACHED(); }
    53     virtual void onSuccess(WebIDBCursor*) { WEBKIT_ASSERT_NOT_REACHED(); }
    54     // FIXME: Temporary no-op method to allow callers to update before WK92278 lands.
    55     virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { }
     53    // FIXME: Remove this no-op method when callers are updated.
     54    virtual void onSuccess(WebIDBCursor*) { }
     55    virtual void onSuccess(WebIDBCursor*, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
    5656    virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
    5757    virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); }
     
    5959    virtual void onSuccess(const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
    6060    virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&) { WEBKIT_ASSERT_NOT_REACHED(); }
    61     virtual void onSuccessWithContinuation() { WEBKIT_ASSERT_NOT_REACHED(); }
    62     // FIXME: Temporary no-op method to allow callers to update before WK92278 lands.
    63     virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { }
     61    // FIXME: Remove this no-op method when callers are updated.
     62    virtual void onSuccessWithContinuation() { }
     63    virtual void onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); }
    6464    virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); }
    6565    virtual void onBlocked(long long oldVersion) { WEBKIT_ASSERT_NOT_REACHED(); }
  • trunk/Source/WebKit/chromium/public/WebIDBCursor.h

    r125084 r125568  
    4848    };
    4949
     50    // FIXME: Remove these methods when callers are updated.
    5051    virtual WebIDBKey key() const
    5152    {
  • trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp

    r123569 r125568  
    6969}
    7070
    71 void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend)
     71void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    7272{
    73     m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend));
     73    m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend), key, primaryKey, value);
    7474}
    7575
     
    103103    m_callbacks->onSuccess(serializedScriptValue, key, keyPath);
    104104}
    105 void IDBCallbacksProxy::onSuccessWithContinuation()
     105
     106void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue> value)
    106107{
    107     m_callbacks->onSuccessWithContinuation();
     108    m_callbacks->onSuccess(key, primaryKey, value);
    108109}
    109110
  • trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.h

    r121185 r125568  
    4848    virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>);
    4949    virtual void onSuccess(PassRefPtr<WebCore::DOMStringList>);
    50     virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>);
     50    virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>, PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCore::SerializedScriptValue>);
    5151    virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
    5252    virtual void onSuccess(PassRefPtr<WebCore::IDBKey>);
     
    5454    virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>);
    5555    virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, const WebCore::IDBKeyPath&);
    56     virtual void onSuccessWithContinuation();
     56    virtual void onSuccess(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCore::SerializedScriptValue>);
    5757    virtual void onSuccessWithPrefetch(const Vector<RefPtr<WebCore::IDBKey> >& keys, const Vector<RefPtr<WebCore::IDBKey> >& primaryKeys, const Vector<RefPtr<WebCore::SerializedScriptValue> >& values);
    5858    virtual void onBlocked();
  • trunk/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp

    r123843 r125568  
    5555}
    5656
    57 PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const
    58 {
    59     return m_idbCursor->key();
    60 }
    61 
    62 PassRefPtr<IDBKey> IDBCursorBackendProxy::primaryKey() const
    63 {
    64     return m_idbCursor->primaryKey();
    65 }
    66 
    67 PassRefPtr<SerializedScriptValue> IDBCursorBackendProxy::value() const
    68 {
    69     return m_idbCursor->value();
    70 }
    71 
    7257void IDBCursorBackendProxy::advance(unsigned long count, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec)
    7358{
  • trunk/Source/WebKit/chromium/src/IDBCursorBackendProxy.h

    r123843 r125568  
    4343    virtual ~IDBCursorBackendProxy();
    4444
    45     virtual PassRefPtr<WebCore::IDBKey> key() const;
    46     virtual PassRefPtr<WebCore::IDBKey> primaryKey() const;
    47     virtual PassRefPtr<WebCore::SerializedScriptValue> value() const;
    4845    virtual void advance(unsigned long, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
    4946    virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&);
  • trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp

    r121477 r125568  
    6666}
    6767
    68 void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor)
     68void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue& value)
    6969{
    70     m_callbacks->onSuccess(IDBCursorBackendProxy::create(adoptPtr(cursor)));
     70    m_callbacks->onSuccess(IDBCursorBackendProxy::create(adoptPtr(cursor)), key, primaryKey, value);
    7171}
    7272
     
    9696}
    9797
    98 void WebIDBCallbacksImpl::onSuccessWithContinuation()
     98void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebSerializedScriptValue& value)
    9999{
    100     m_callbacks->onSuccessWithContinuation();
     100    m_callbacks->onSuccess(key, primaryKey, value);
    101101}
    102102
  • trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h

    r121185 r125568  
    4444    virtual void onError(const WebIDBDatabaseError&);
    4545    virtual void onSuccess(const WebDOMStringList&);
    46     virtual void onSuccess(WebIDBCursor*);
     46    virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);
    4747    virtual void onSuccess(WebIDBDatabase*);
    4848    virtual void onSuccess(const WebIDBKey&);
     
    5050    virtual void onSuccess(const WebSerializedScriptValue&);
    5151    virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&);
    52     virtual void onSuccessWithContinuation();
     52    virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);
    5353    virtual void onBlocked();
    5454
  • trunk/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp

    r123843 r125568  
    4848}
    4949
    50 WebIDBKey WebIDBCursorImpl::key() const
    51 {
    52     return m_idbCursorBackend->key();
    53 }
    54 
    55 WebIDBKey WebIDBCursorImpl::primaryKey() const
    56 {
    57     return m_idbCursorBackend->primaryKey();
    58 }
    59 
    60 WebSerializedScriptValue WebIDBCursorImpl::value() const
    61 {
    62     return m_idbCursorBackend->value();
    63 }
    64 
    6550void WebIDBCursorImpl::advance(unsigned long count, WebIDBCallbacks* callbacks, WebExceptionCode& ec)
    6651{
  • trunk/Source/WebKit/chromium/src/WebIDBCursorImpl.h

    r123843 r125568  
    4545    virtual ~WebIDBCursorImpl();
    4646
    47     virtual WebIDBKey key() const;
    48     virtual WebIDBKey primaryKey() const;
    49     virtual WebSerializedScriptValue value() const;
    5047    virtual void advance(unsigned long, WebIDBCallbacks*, WebExceptionCode&);
    5148    virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*, WebExceptionCode&);
  • trunk/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp

    r124675 r125568  
    5252    }
    5353    virtual void onSuccess(PassRefPtr<DOMStringList>) { }
    54     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) { }
     54    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) { }
    5555    virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>)
    5656    {
     
    6161    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) { }
    6262    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) { }
    63     virtual void onSuccessWithContinuation() { }
     63    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) { };
    6464    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) { }
    6565    virtual void onBlocked() { }
  • trunk/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp

    r123585 r125568  
    7878    virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { }
    7979    virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { }
    80     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { }
     80    virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { }
    8181    virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE
    8282    {
     
    8787    virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
    8888    virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) OVERRIDE { };
    89     virtual void onSuccessWithContinuation() OVERRIDE { }
     89    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>) OVERRIDE { };
    9090    virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { }
    9191    virtual void onBlocked() OVERRIDE { }
  • trunk/Source/WebKit/chromium/tests/IDBRequestTest.cpp

    r124974 r125568  
    5252    request->onSuccess(DOMStringList::create());
    5353    request->onSuccess(PassRefPtr<IDBDatabaseBackendInterface>());
    54     request->onSuccess(PassRefPtr<IDBCursorBackendInterface>());
     54    request->onSuccess(PassRefPtr<IDBCursorBackendInterface>(), IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
    5555    request->onSuccess(IDBKey::createInvalid());
    5656    request->onSuccess(PassRefPtr<IDBTransactionBackendInterface>());
    5757    request->onSuccess(SerializedScriptValue::nullValue());
    5858    request->onSuccess(SerializedScriptValue::nullValue(), IDBKey::createInvalid(), IDBKeyPath());
    59     request->onSuccessWithContinuation();
     59    request->onSuccess(IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
    6060}
    6161
Note: See TracChangeset for help on using the changeset viewer.