Title: [135904] trunk
Revision
135904
Author
[email protected]
Date
2012-11-27 12:45:42 -0800 (Tue, 27 Nov 2012)

Log Message

IndexedDB: Remove IDBDatabase.setVersion API
https://bugs.webkit.org/show_bug.cgi?id=94972

Reviewed by Tony Chang.

Source/WebCore:

This has been out of the spec for over a year. No other browser has
implemented it for close to a year.

Tests - removed.html

* Modules/indexeddb/IDBCallbacks.h:
(IDBCallbacks):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::IDBDatabase):
* Modules/indexeddb/IDBDatabase.h:
(IDBDatabase):
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseBackendInterface.h:
(IDBDatabaseBackendInterface):
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:

Source/WebKit/chromium:

* src/IDBCallbacksProxy.cpp:
* src/IDBCallbacksProxy.h:
(IDBCallbacksProxy):
* src/IDBDatabaseBackendProxy.cpp:
* src/IDBDatabaseBackendProxy.h:
(IDBDatabaseBackendProxy):
* src/WebIDBCallbacksImpl.cpp:
* src/WebIDBCallbacksImpl.h:
(WebIDBCallbacksImpl):
* src/WebIDBDatabaseImpl.cpp:
* src/WebIDBDatabaseImpl.h:
(WebIDBDatabaseImpl):

LayoutTests:

* storage/indexeddb/removed-expected.txt:
* storage/indexeddb/resources/removed.js:
(test):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135903 => 135904)


--- trunk/LayoutTests/ChangeLog	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/LayoutTests/ChangeLog	2012-11-27 20:45:42 UTC (rev 135904)
@@ -1,3 +1,14 @@
+2012-11-27  David Grogan  <[email protected]>
+
+        IndexedDB: Remove IDBDatabase.setVersion API
+        https://bugs.webkit.org/show_bug.cgi?id=94972
+
+        Reviewed by Tony Chang.
+
+        * storage/indexeddb/removed-expected.txt:
+        * storage/indexeddb/resources/removed.js:
+        (test):
+
 2012-11-27  Mike West  <[email protected]>
 
         Log to console when autofocus is blocked by sandbox attribute.

Modified: trunk/LayoutTests/storage/indexeddb/removed-expected.txt (135903 => 135904)


--- trunk/LayoutTests/storage/indexeddb/removed-expected.txt	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/LayoutTests/storage/indexeddb/removed-expected.txt	2012-11-27 20:45:42 UTC (rev 135904)
@@ -9,6 +9,7 @@
 PASS self.webkitIDBDatabaseError is undefined.
 PASS 'IDBDatabaseException' in self is false
 PASS 'errorCode' in indexedDB.open(dbname) is false
+PASS 'setVersion' in IDBDatabase.prototype is false
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/resources/removed.js (135903 => 135904)


--- trunk/LayoutTests/storage/indexeddb/resources/removed.js	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/LayoutTests/storage/indexeddb/resources/removed.js	2012-11-27 20:45:42 UTC (rev 135904)
@@ -13,6 +13,7 @@
     shouldBeUndefined("self.webkitIDBDatabaseError");
     shouldBeFalse("'IDBDatabaseException' in self");
     shouldBeFalse("'errorCode' in indexedDB.open(dbname)");
+    shouldBeFalse("'setVersion' in IDBDatabase.prototype");
 
     finishJSTest();
 }

Modified: trunk/Source/WebCore/ChangeLog (135903 => 135904)


--- trunk/Source/WebCore/ChangeLog	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/ChangeLog	2012-11-27 20:45:42 UTC (rev 135904)
@@ -1,3 +1,31 @@
+2012-11-27  David Grogan  <[email protected]>
+
+        IndexedDB: Remove IDBDatabase.setVersion API
+        https://bugs.webkit.org/show_bug.cgi?id=94972
+
+        Reviewed by Tony Chang.
+
+        This has been out of the spec for over a year. No other browser has
+        implemented it for close to a year.
+
+        Tests - removed.html
+
+        * Modules/indexeddb/IDBCallbacks.h:
+        (IDBCallbacks):
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::IDBDatabase):
+        * Modules/indexeddb/IDBDatabase.h:
+        (IDBDatabase):
+        * Modules/indexeddb/IDBDatabase.idl:
+        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+        (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
+        * Modules/indexeddb/IDBDatabaseBackendImpl.h:
+        (IDBDatabaseBackendImpl):
+        * Modules/indexeddb/IDBDatabaseBackendInterface.h:
+        (IDBDatabaseBackendInterface):
+        * Modules/indexeddb/IDBRequest.cpp:
+        * Modules/indexeddb/IDBRequest.h:
+
 2012-11-27  Mike West  <[email protected]>
 
         Log to console when autofocus is blocked by sandbox attribute.

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCallbacks.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -56,8 +56,6 @@
     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
     // From IDBObjectStore.add()/put(), IDBIndex.getKey()
     virtual void onSuccess(PassRefPtr<IDBKey>) = 0;
-    // From IDBDatabase.setVersion()
-    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) = 0;
     // From IDBObjectStore/IDBIndex.get()/count(), and various methods that yield null/undefined.
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>) = 0;
     // From IDBObjectStore/IDBIndex.get() (with key injection)
@@ -72,7 +70,7 @@
     virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>) = 0;
     // From IDBCursor.advance()/continue()
     virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >& keys, const Vector<RefPtr<IDBKey> >& primaryKeys, const Vector<RefPtr<SerializedScriptValue> >& values) = 0;
-    // From IDBFactory.open()/deleteDatabase(), IDBDatabase.setVersion()
+    // From IDBFactory.open()/deleteDatabase()
     virtual void onBlocked() { ASSERT_NOT_REACHED(); }
     virtual void onBlocked(int64_t existingVersion) { ASSERT_NOT_REACHED(); }
     // From IDBFactory.open()

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -63,7 +63,6 @@
     , m_closePending(false)
     , m_contextStopped(false)
     , m_databaseCallbacks(callbacks)
-    , m_didSpamConsole(false)
 {
     // We pass a reference of this object before it can be adopted.
     relaxAdoptionRequirement();
@@ -201,30 +200,6 @@
     }
 }
 
-PassRefPtr<IDBVersionChangeRequest> IDBDatabase::setVersion(ScriptExecutionContext* context, const String& version, ExceptionCode& ec)
-{
-    if (!m_didSpamConsole) {
-        String consoleMessage = ASCIILiteral("The setVersion() method is non-standard and will be removed. Use the \"upgradeneeded\" event instead.");
-        context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
-        m_didSpamConsole = true;
-    }
-
-    if (version.isNull()) {
-        ec = TypeError;
-        return 0;
-    }
-
-    if (m_versionChangeTransaction) {
-        ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
-        return 0;
-    }
-
-    RefPtr<IDBVersionChangeRequest> request = IDBVersionChangeRequest::create(context, IDBAny::create(this), version);
-    ASSERT(m_backend);
-    m_backend->setVersion(version, request, m_databaseCallbacks, ec);
-    return request;
-}
-
 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const Vector<String>& scope, const String& modeString, ExceptionCode& ec)
 {
     if (!scope.size()) {

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -68,7 +68,6 @@
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCode&);
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&);
     void deleteObjectStore(const String& name, ExceptionCode&);
-    PassRefPtr<IDBVersionChangeRequest> setVersion(ScriptExecutionContext*, const String& version, ExceptionCode&);
     void close();
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
@@ -129,8 +128,6 @@
     Vector<RefPtr<Event> > m_enqueuedEvents;
 
     RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-
-    bool m_didSpamConsole;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl	2012-11-27 20:45:42 UTC (rev 135904)
@@ -42,8 +42,6 @@
         raises (DOMException);
     void deleteObjectStore(in DOMString name)
         raises (DOMException);
-    [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version)
-        raises (DOMException);
     [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode)
         raises (DOMException);
     [CallWith=ScriptExecutionContext] IDBTransaction transaction(in sequence<String> storeNames, in [Optional=DefaultIsNullString] DOMString mode)

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -96,28 +96,6 @@
     RefPtr<IDBCallbacks> m_callbacks;
 };
 
-class IDBDatabaseBackendImpl::PendingSetVersionCall {
-public:
-    static PassOwnPtr<PendingSetVersionCall> create(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
-    {
-        return adoptPtr(new PendingSetVersionCall(version, callbacks, databaseCallbacks));
-    }
-    String version() { return m_version; }
-    PassRefPtr<IDBCallbacks> callbacks() { return m_callbacks; }
-    PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks() { return m_databaseCallbacks; }
-
-private:
-    PendingSetVersionCall(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
-        : m_version(version)
-        , m_callbacks(callbacks)
-        , m_databaseCallbacks(databaseCallbacks)
-    {
-    }
-    String m_version;
-    RefPtr<IDBCallbacks> m_callbacks;
-    RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-};
-
 PassRefPtr<IDBDatabaseBackendImpl> IDBDatabaseBackendImpl::create(const String& name, IDBBackingStore* database, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
 {
     RefPtr<IDBDatabaseBackendImpl> backend = adoptRef(new IDBDatabaseBackendImpl(name, database, factory, uniqueIdentifier));
@@ -235,64 +213,6 @@
     transaction->didCompleteTaskEvents();
 }
 
-void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, ExceptionCode& ec)
-{
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
-    if (!m_databaseCallbacksSet.contains(databaseCallbacks)) {
-        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Connection was closed before set version transaction was created"));
-        return;
-    }
-    for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
-        // Front end ensures the event is not fired at connections that have closePending set.
-        if (*it != databaseCallbacks)
-            (*it)->onVersionChange(version);
-    }
-    // FIXME: Only fire onBlocked if there are open connections after the
-    // VersionChangeEvents are received, not just set up to fire.
-    // https://bugs.webkit.org/show_bug.cgi?id=71130
-    if (connectionCount() > 1) {
-        callbacks->onBlocked();
-        OwnPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
-        m_pendingSetVersionCalls.append(pendingSetVersionCall.release());
-        return;
-    }
-    if (m_runningVersionChangeTransaction) {
-        OwnPtr<PendingSetVersionCall> pendingSetVersionCall = PendingSetVersionCall::create(version, callbacks, databaseCallbacks);
-        m_pendingSetVersionCalls.append(pendingSetVersionCall.release());
-        return;
-    }
-
-    Vector<int64_t> objectStoreIds;
-    RefPtr<IDBTransactionBackendInterface> transactionInterface = this->transaction(objectStoreIds, IDBTransaction::VERSION_CHANGE);
-    RefPtr<IDBTransactionBackendImpl> transaction = IDBTransactionBackendImpl::from(transactionInterface.get());
-    ASSERT(!ec);
-
-    RefPtr<IDBDatabaseBackendImpl> database = this;
-    if (!transaction->scheduleTask(
-            createCallbackTask(&IDBDatabaseBackendImpl::setVersionInternal, database, version, callbacks, transaction),
-            createCallbackTask(&IDBDatabaseBackendImpl::resetVersion, database, m_metadata.version, m_metadata.intVersion))) {
-        // FIXME: Remove one of the following lines.
-        ASSERT_NOT_REACHED();
-        ec = IDBDatabaseException::TRANSACTION_INACTIVE_ERR;
-    }
-}
-
-void IDBDatabaseBackendImpl::setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendImpl> prpTransaction)
-{
-    RefPtr<IDBTransactionBackendImpl> transaction = prpTransaction;
-    int64_t databaseId = database->id();
-    database->m_metadata.version = version;
-    database->m_metadata.intVersion = IDBDatabaseMetadata::NoIntVersion;
-    if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_metadata.version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_metadata.intVersion)) {
-        RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
-        callbacks->onError(error);
-        transaction->abort(error);
-        return;
-    }
-    callbacks->onSuccess(PassRefPtr<IDBTransactionBackendInterface>(transaction));
-}
-
 void IDBDatabaseBackendImpl::setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl> database, int64_t version, PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, PassRefPtr<IDBTransactionBackendImpl> transaction)
 {
     RefPtr<IDBCallbacks> callbacks(prpCallbacks);
@@ -369,28 +289,10 @@
         // Fall through when complete, as pending deletes may be (partially) unblocked.
     }
 
-    // Pending calls may be requeued or aborted
-    Deque<OwnPtr<PendingSetVersionCall> > pendingSetVersionCalls;
-    m_pendingSetVersionCalls.swap(pendingSetVersionCalls);
-    while (!pendingSetVersionCalls.isEmpty()) {
-        ExceptionCode ec = 0;
-        OwnPtr<PendingSetVersionCall> pendingSetVersionCall = pendingSetVersionCalls.takeFirst();
-        setVersion(pendingSetVersionCall->version(), pendingSetVersionCall->callbacks(), pendingSetVersionCall->databaseCallbacks(), ec);
-        ASSERT(!ec);
-    }
-
-    // If there were any pending set version calls, we better have started one.
-    ASSERT(m_pendingSetVersionCalls.isEmpty() || m_runningVersionChangeTransaction);
-
-    // m_pendingSetVersionCalls is non-empty in two cases:
-    // 1) When two versionchange transactions are requested while another
-    //    version change transaction is running.
-    // 2) When three versionchange transactions are requested in a row, before
-    //    any of their event handlers are run.
     // Note that this check is only an optimization to reduce queue-churn and
     // not necessary for correctness; deleteDatabase and openConnection will
     // requeue their calls if this condition is true.
-    if (m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty())
+    if (m_runningVersionChangeTransaction)
         return;
 
     // Pending calls may be requeued.
@@ -402,7 +304,7 @@
     }
 
     // This check is also not really needed, openConnection would just requeue its calls.
-    if (m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty() || !m_pendingDeleteCalls.isEmpty())
+    if (m_runningVersionChangeTransaction || !m_pendingDeleteCalls.isEmpty())
         return;
 
     Deque<OwnPtr<PendingOpenWithVersionCall> > pendingOpenWithVersionCalls;
@@ -438,7 +340,7 @@
 void IDBDatabaseBackendImpl::openConnection(PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
 {
     ASSERT(m_backingStore.get());
-    if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty()) {
+    if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction) {
         m_pendingOpenCalls.append(PendingOpenCall::create(callbacks, databaseCallbacks));
         return;
     }
@@ -500,7 +402,7 @@
 {
     RefPtr<IDBCallbacks> callbacks = prpCallbacks;
     RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
-    if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty()) {
+    if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction) {
         m_pendingOpenWithVersionCalls.append(PendingOpenWithVersionCall::create(callbacks, databaseCallbacks, version));
         return;
     }
@@ -527,7 +429,7 @@
 
 void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallbacks)
 {
-    if (m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty()) {
+    if (m_runningVersionChangeTransaction) {
         m_pendingDeleteCalls.append(PendingDeleteCall::create(prpCallbacks));
         return;
     }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -63,7 +63,6 @@
     virtual IDBDatabaseMetadata metadata() const;
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t id, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&);
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&);
-    virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&);
     // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
     virtual PassRefPtr<IDBTransactionBackendInterface> transaction(const Vector<int64_t>&, unsigned short);
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, unsigned short mode);
@@ -87,7 +86,6 @@
 
     static void createObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
     static void deleteObjectStoreInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBTransactionBackendImpl>);
-    static void setVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
     static void setIntVersionInternal(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackendImpl>, int64_t version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, PassRefPtr<IDBTransactionBackendImpl>);
 
     // These are used as setVersion transaction abort tasks.
@@ -111,9 +109,6 @@
     typedef HashSet<IDBTransactionBackendImpl*> TransactionSet;
     TransactionSet m_transactions;
 
-    class PendingSetVersionCall;
-    Deque<OwnPtr<PendingSetVersionCall> > m_pendingSetVersionCalls;
-
     class PendingOpenCall;
     Deque<OwnPtr<PendingOpenCall> > m_pendingOpenCalls;
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendInterface.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -55,7 +55,6 @@
 
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
-    virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&) = 0;
     // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
     virtual PassRefPtr<IDBTransactionBackendInterface> transaction(const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t transactionId, const Vector<int64_t>& objectStoreIds, unsigned short mode) = 0;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -311,31 +311,6 @@
     enqueueEvent(createSuccessEvent());
 }
 
-void IDBRequest::onSuccess(PassRefPtr<IDBTransactionBackendInterface> prpBackend)
-{
-    IDB_TRACE("IDBRequest::onSuccess(IDBTransaction)");
-    RefPtr<IDBTransactionBackendInterface> backend = prpBackend;
-
-    if (m_contextStopped || !scriptExecutionContext()) {
-        // Should only be null in tests.
-        if (backend.get())
-            backend->abort();
-        return;
-    }
-    if (!shouldEnqueueEvent())
-        return;
-
-    RefPtr<IDBTransaction> frontend = IDBTransaction::create(scriptExecutionContext(), backend, Vector<String>(), IDBTransaction::VERSION_CHANGE, m_source->idbDatabase().get());
-    backend->setCallbacks(frontend.get());
-    m_transaction = frontend;
-
-    ASSERT(m_source->type() == IDBAny::IDBDatabaseType);
-    ASSERT(m_transaction->isVersionChange());
-
-    m_result = IDBAny::create(frontend.release());
-    enqueueEvent(createSuccessEvent());
-}
-
 void IDBRequest::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue)
 {
     IDB_TRACE("IDBRequest::onSuccess(SerializedScriptValue)");

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (135903 => 135904)


--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -91,7 +91,6 @@
     virtual void onSuccess(PassRefPtr<DOMStringList>);
     virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SerializedScriptValue>);
     virtual void onSuccess(PassRefPtr<IDBKey>);
-    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>);
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>);
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&);
     virtual void onSuccess(int64_t);

Modified: trunk/Source/WebKit/chromium/ChangeLog (135903 => 135904)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-27 20:45:42 UTC (rev 135904)
@@ -1,3 +1,23 @@
+2012-11-27  David Grogan  <[email protected]>
+
+        IndexedDB: Remove IDBDatabase.setVersion API
+        https://bugs.webkit.org/show_bug.cgi?id=94972
+
+        Reviewed by Tony Chang.
+
+        * src/IDBCallbacksProxy.cpp:
+        * src/IDBCallbacksProxy.h:
+        (IDBCallbacksProxy):
+        * src/IDBDatabaseBackendProxy.cpp:
+        * src/IDBDatabaseBackendProxy.h:
+        (IDBDatabaseBackendProxy):
+        * src/WebIDBCallbacksImpl.cpp:
+        * src/WebIDBCallbacksImpl.h:
+        (WebIDBCallbacksImpl):
+        * src/WebIDBDatabaseImpl.cpp:
+        * src/WebIDBDatabaseImpl.h:
+        (WebIDBDatabaseImpl):
+
 2012-11-27  Eberhard Graether  <[email protected]>
 
         Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.

Modified: trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -87,11 +87,6 @@
     m_callbacks->onSuccess(WebIDBKey(idbKey));
 }
 
-void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBTransactionBackendInterface> backend)
-{
-    m_callbacks->onSuccess(new WebIDBTransactionImpl(backend));
-}
-
 void IDBCallbacksProxy::onSuccess(PassRefPtr<DOMStringList> domStringList)
 {
     m_callbacks->onSuccess(WebDOMStringList(domStringList));

Modified: trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.h (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/IDBCallbacksProxy.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -51,7 +51,6 @@
     virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>, PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBKey> primaryKey, PassRefPtr<WebCore::SerializedScriptValue>);
     virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
     virtual void onSuccess(PassRefPtr<WebCore::IDBKey>);
-    virtual void onSuccess(PassRefPtr<WebCore::IDBTransactionBackendInterface>);
     virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>);
     virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, const WebCore::IDBKeyPath&);
     virtual void onSuccess(int64_t);

Modified: trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -85,12 +85,6 @@
     m_webIDBDatabase->deleteObjectStore(objectStoreId, *transactionProxy->getWebIDBTransaction(), ec);
 }
 
-void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec)
-{
-    ASSERT(m_webIDBDatabase);
-    m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec);
-}
-
 // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
 PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(const Vector<int64_t>& objectStoreIds, unsigned short mode)
 {

Modified: trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -46,7 +46,6 @@
 
     virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
     virtual void deleteObjectStore(int64_t, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
-    virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&);
     // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
     virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(const Vector<int64_t>&, unsigned short mode);
     virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, unsigned short mode);

Modified: trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -86,11 +86,6 @@
     m_callbacks->onSuccess(key);
 }
 
-void WebIDBCallbacksImpl::onSuccess(WebIDBTransaction* webKitInstance)
-{
-    m_callbacks->onSuccess(IDBTransactionBackendProxy::create(adoptPtr(webKitInstance)));
-}
-
 void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue)
 {
     m_callbacks->onSuccess(serializedScriptValue);

Modified: trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -46,7 +46,6 @@
     virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);
     virtual void onSuccess(WebIDBDatabase*);
     virtual void onSuccess(const WebIDBKey&);
-    virtual void onSuccess(WebIDBTransaction*);
     virtual void onSuccess(const WebSerializedScriptValue&);
     virtual void onSuccess(const WebSerializedScriptValue&, const WebIDBKey&, const WebIDBKeyPath&);
     virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebSerializedScriptValue&);

Modified: trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -75,11 +75,6 @@
     m_databaseBackend->deleteObjectStore(objectStoreId, transaction.getIDBTransactionBackendInterface(), ec);
 }
 
-void WebIDBDatabaseImpl::setVersion(const WebString& version, WebIDBCallbacks* callbacks, WebExceptionCode& ec)
-{
-    m_databaseBackend->setVersion(version, IDBCallbacksProxy::create(adoptPtr(callbacks)), m_databaseCallbacks, ec);
-}
-
 WebIDBTransaction* WebIDBDatabaseImpl::createTransaction(long long id, const WebVector<long long>& objectStoreIds, unsigned short mode)
 {
     Vector<int64_t> objectStoreIdList(objectStoreIds.size());

Modified: trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h (135903 => 135904)


--- trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h	2012-11-27 20:45:42 UTC (rev 135904)
@@ -54,7 +54,6 @@
 
     virtual WebIDBObjectStore* createObjectStore(long long, const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&);
     virtual void deleteObjectStore(long long objectStoreId, const WebIDBTransaction&, WebExceptionCode&);
-    virtual void setVersion(const WebString& version, WebIDBCallbacks*, WebExceptionCode&);
     // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
     virtual WebIDBTransaction* transaction(const WebVector<long long>& names, unsigned short mode);
     virtual WebIDBTransaction* createTransaction(long long id, const WebVector<long long>&, unsigned short mode);

Modified: trunk/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -88,7 +88,6 @@
         m_wasSuccessDBCalled = true;
     }
     virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { }
-    virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { }
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { }
     virtual void onSuccess(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, const IDBKeyPath&) OVERRIDE { };
     virtual void onSuccess(int64_t) OVERRIDE { }
@@ -153,7 +152,6 @@
     virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) { return 0; }
     virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&) { }
     virtual void deleteObjectStore(int64_t, IDBTransactionBackendInterface*, ExceptionCode&) { }
-    virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&) { }
     // FIXME: Remove this as part of https://bugs.webkit.org/show_bug.cgi?id=102733.
     virtual PassRefPtr<IDBTransactionBackendInterface> transaction(const Vector<int64_t>&, unsigned short mode) { return 0; }
     virtual PassRefPtr<IDBTransactionBackendInterface> createTransaction(int64_t, const Vector<int64_t>&, unsigned short mode) { return 0; }

Modified: trunk/Source/WebKit/chromium/tests/IDBRequestTest.cpp (135903 => 135904)


--- trunk/Source/WebKit/chromium/tests/IDBRequestTest.cpp	2012-11-27 20:44:03 UTC (rev 135903)
+++ trunk/Source/WebKit/chromium/tests/IDBRequestTest.cpp	2012-11-27 20:45:42 UTC (rev 135904)
@@ -94,7 +94,6 @@
     request->onSuccess(DOMStringList::create());
     request->onSuccess(PassRefPtr<IDBCursorBackendInterface>(), IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
     request->onSuccess(IDBKey::createInvalid());
-    request->onSuccess(PassRefPtr<IDBTransactionBackendInterface>());
     request->onSuccess(SerializedScriptValue::nullValue());
     request->onSuccess(SerializedScriptValue::nullValue(), IDBKey::createInvalid(), IDBKeyPath());
     request->onSuccess(IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to