Skip to content
Permalink
Browse files
2011-01-27 Hans Wennborg <hans@chromium.org>
        Reviewed by Jeremy Orlow.

        IndexedDB: Remove IDBCallbacks::onSuccess() used for null values.
        https://bugs.webkit.org/show_bug.cgi?id=53178

        Remove the IDBCallbacks::onSuccess() function that was used for
        null values, and replace such calls with calls to
        IDBCallBacks::onSuccess(SerializedScriptValue::nullValue())
        instead.

        No new functionality, so no new tests.

        * storage/IDBCallbacks.h:
        * storage/IDBCursorBackendImpl.cpp:
        (WebCore::IDBCursorBackendImpl::updateInternal):
        (WebCore::IDBCursorBackendImpl::continueFunctionInternal):
        * storage/IDBIndexBackendImpl.cpp:
        (WebCore::IDBIndexBackendImpl::openCursorInternal):
        * storage/IDBObjectStoreBackendImpl.cpp:
        (WebCore::IDBObjectStoreBackendImpl::deleteInternal):
        (WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
        * storage/IDBRequest.cpp:
        * storage/IDBRequest.h:
2011-01-27  Hans Wennborg  <hans@chromium.org>

        Reviewed by Jeremy Orlow.

        IndexedDB: Remove IDBCallbacks::onSuccess() used for null values.
        https://bugs.webkit.org/show_bug.cgi?id=53178

        Remove the IDBCallbacks::onSuccess() function that was used for
        null values, and replace such calls with calls to
        IDBCallBacks::onSuccess(SerializedScriptValue::nullValue())
        instead.

        * public/WebIDBCallbacks.h:
        (WebKit::WebIDBCallbacks::onSuccess):
        * src/IDBCallbacksProxy.cpp:
        * src/IDBCallbacksProxy.h:
        * src/WebIDBCallbacksImpl.cpp:
        * src/WebIDBCallbacksImpl.h:

Canonical link: https://commits.webkit.org/67002@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
zmodem committed Jan 27, 2011
1 parent e323fab commit d37592a71db2610e196e88d0c058a9b543ef657f
Showing 13 changed files with 51 additions and 26 deletions.
@@ -1,3 +1,29 @@
2011-01-27 Hans Wennborg <hans@chromium.org>

Reviewed by Jeremy Orlow.

IndexedDB: Remove IDBCallbacks::onSuccess() used for null values.
https://bugs.webkit.org/show_bug.cgi?id=53178

Remove the IDBCallbacks::onSuccess() function that was used for
null values, and replace such calls with calls to
IDBCallBacks::onSuccess(SerializedScriptValue::nullValue())
instead.

No new functionality, so no new tests.

* storage/IDBCallbacks.h:
* storage/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::updateInternal):
(WebCore::IDBCursorBackendImpl::continueFunctionInternal):
* storage/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::openCursorInternal):
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
(WebCore::IDBObjectStoreBackendImpl::openCursorInternal):
* storage/IDBRequest.cpp:
* storage/IDBRequest.h:

2011-01-27 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r76773.
@@ -49,7 +49,6 @@ class IDBCallbacks : public ThreadSafeShared<IDBCallbacks> {
virtual ~IDBCallbacks() { }

virtual void onError(PassRefPtr<IDBDatabaseError>) = 0;
virtual void onSuccess() = 0; // For "null".
virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) = 0;
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) = 0;
virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>) = 0;
@@ -115,7 +115,7 @@ void IDBCursorBackendImpl::updateInternal(ScriptExecutionContext*, PassRefPtr<ID

if (cursor->m_isSerializedScriptValueCursor)
cursor->m_currentSerializedScriptValue = value.release();
callbacks->onSuccess();
callbacks->onSuccess(SerializedScriptValue::nullValue());
}

void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
@@ -138,7 +138,7 @@ void IDBCursorBackendImpl::continueFunctionInternal(ScriptExecutionContext*, Pas
cursor->m_currentKey = 0;
cursor->m_currentSerializedScriptValue = 0;
cursor->m_currentIDBKeyValue = 0;
callbacks->onSuccess();
callbacks->onSuccess(SerializedScriptValue::nullValue());
return;
}

@@ -100,7 +100,7 @@ void IDBIndexBackendImpl::openCursorInternal(ScriptExecutionContext*, PassRefPtr
query->bindInt64(indexColumn, index->id());

if (query->step() != SQLResultRow) {
callbacks->onSuccess();
callbacks->onSuccess(SerializedScriptValue::nullValue());
return;
}

@@ -342,7 +342,7 @@ void IDBObjectStoreBackendImpl::deleteInternal(ScriptExecutionContext*, PassRefP
ok = indexQuery.step() == SQLResultDone;
ASSERT_UNUSED(ok, ok);

callbacks->onSuccess();
callbacks->onSuccess(SerializedScriptValue::nullValue());
}

PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
@@ -483,7 +483,7 @@ void IDBObjectStoreBackendImpl::openCursorInternal(ScriptExecutionContext*, Pass
query->bindInt64(currentColumn, objectStore->id());

if (query->step() != SQLResultRow) {
callbacks->onSuccess();
callbacks->onSuccess(SerializedScriptValue::nullValue());
return;
}

@@ -76,11 +76,6 @@ void IDBRequest::onError(PassRefPtr<IDBDatabaseError> error)
scheduleEvent(0, error);
}

void IDBRequest::onSuccess()
{
scheduleEvent(IDBAny::createNull(), 0);
}

void IDBRequest::onSuccess(PassRefPtr<IDBCursorBackendInterface> backend)
{
scheduleEvent(IDBAny::create(IDBCursor::create(backend, this, m_transaction.get())), 0);
@@ -62,7 +62,6 @@ class IDBRequest : public IDBCallbacks, public EventTarget, public ActiveDOMObje

// IDBCallbacks
virtual void onError(PassRefPtr<IDBDatabaseError>);
virtual void onSuccess(); // For "null".
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>);
virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>);
virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>);
@@ -1,3 +1,22 @@
2011-01-27 Hans Wennborg <hans@chromium.org>

Reviewed by Jeremy Orlow.

IndexedDB: Remove IDBCallbacks::onSuccess() used for null values.
https://bugs.webkit.org/show_bug.cgi?id=53178

Remove the IDBCallbacks::onSuccess() function that was used for
null values, and replace such calls with calls to
IDBCallBacks::onSuccess(SerializedScriptValue::nullValue())
instead.

* public/WebIDBCallbacks.h:
(WebKit::WebIDBCallbacks::onSuccess):
* src/IDBCallbacksProxy.cpp:
* src/IDBCallbacksProxy.h:
* src/WebIDBCallbacksImpl.cpp:
* src/WebIDBCallbacksImpl.h:

2011-01-26 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.
@@ -46,7 +46,7 @@ class WebIDBCallbacks {
// For classes that follow the PImpl pattern, pass a const reference.
// For the rest, pass ownership to the callee via a pointer.
virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } // For "null".
void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } // FIXME: Remove once Chromium stops referring to it.
virtual void onSuccess(WebIDBCursor*) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); }
@@ -65,12 +65,6 @@ void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError)
m_callbacks.clear();
}

void IDBCallbacksProxy::onSuccess()
{
m_callbacks->onSuccess();
m_callbacks.clear();
}

void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend)
{
m_callbacks->onSuccess(new WebKit::WebIDBCursorImpl(idbCursorBackend));
@@ -48,7 +48,6 @@ class IDBCallbacksProxy : public IDBCallbacks {
virtual ~IDBCallbacksProxy();

virtual void onError(PassRefPtr<IDBDatabaseError>);
virtual void onSuccess(); // For "null".
virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>);
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>);
virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>);
@@ -61,11 +61,6 @@ void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error)
m_callbacks->onError(error);
}

void WebIDBCallbacksImpl::onSuccess()
{
m_callbacks->onSuccess();
}

void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBCursor* cursor)
{
m_callbacks->onSuccess(IDBCursorBackendProxy::create(cursor));
@@ -42,7 +42,6 @@ class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks {
virtual ~WebIDBCallbacksImpl();

virtual void onError(const WebKit::WebIDBDatabaseError&);
virtual void onSuccess(); // For "null".
virtual void onSuccess(WebKit::WebIDBCursor*);
virtual void onSuccess(WebKit::WebIDBDatabase*);
virtual void onSuccess(const WebKit::WebIDBKey&);

0 comments on commit d37592a

Please sign in to comment.