[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jorlow at chromium.org
jorlow at chromium.org
Wed Dec 22 12:42:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 35cbabdc82e42c261e166153a04b4773ed117913
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Aug 27 13:32:26 2010 +0000
2010-08-25 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Steve Block.
Add setVersion to IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=44630
* storage/indexeddb/database-basics-expected.txt:
* storage/indexeddb/script-tests/database-basics.js:
(openSuccess):
(setVersionAgain):
(checkVersion):
* storage/indexeddb/script-tests/open-cursor.js:
(openEmptyCursor):
(openCursor):
2010-08-25 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Steve Block.
Add setVersion to IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=44630
* storage/IDBDatabase.cpp:
(WebCore::IDBDatabase::setVersion):
* storage/IDBDatabase.h:
* storage/IDBDatabase.idl:
* storage/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::removeObjectStore):
(WebCore::IDBDatabaseBackendImpl::setVersion):
* storage/IDBDatabaseBackendImpl.h:
* storage/IDBDatabaseBackendInterface.h:
2010-08-25 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Steve Block.
Add setVersion to IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=44630
* public/WebIDBDatabase.h:
(WebKit::WebIDBDatabase::createObjectStore):
(WebKit::WebIDBDatabase::removeObjectStore):
(WebKit::WebIDBDatabase::setVersion):
* src/IDBDatabaseProxy.cpp:
(WebCore::IDBDatabaseProxy::setVersion):
* src/IDBDatabaseProxy.h:
* src/WebIDBDatabaseImpl.cpp:
(WebKit::WebIDBDatabaseImpl::setVersion):
* src/WebIDBDatabaseImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1c9b720..daa9714 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-25 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add setVersion to IndexedDB
+ https://bugs.webkit.org/show_bug.cgi?id=44630
+
+ * storage/indexeddb/database-basics-expected.txt:
+ * storage/indexeddb/script-tests/database-basics.js:
+ (openSuccess):
+ (setVersionAgain):
+ (checkVersion):
+ * storage/indexeddb/script-tests/open-cursor.js:
+ (openEmptyCursor):
+ (openCursor):
+
2010-08-27 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/LayoutTests/storage/indexeddb/database-basics-expected.txt b/LayoutTests/storage/indexeddb/database-basics-expected.txt
index 75c276d..1321f4d 100644
--- a/LayoutTests/storage/indexeddb/database-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-basics-expected.txt
@@ -24,10 +24,26 @@ PASS event.target.readyState is event.target.DONE
db = event.result
PASS db.name is "name"
-PASS db.version is ""
PASS db.objectStores is []
PASS db.objectStores.length is 0
PASS db.objectStores.contains('') is false
+
+Testing setVersion.
+db.setVersion("version a")
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+db.setVersion("version b")
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+PASS db.version is "version b"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/script-tests/database-basics.js b/LayoutTests/storage/indexeddb/script-tests/database-basics.js
index a07c684..04ebbd3 100644
--- a/LayoutTests/storage/indexeddb/script-tests/database-basics.js
+++ b/LayoutTests/storage/indexeddb/script-tests/database-basics.js
@@ -8,7 +8,6 @@ function openSuccess()
var db = evalAndLog("db = event.result");
shouldBeEqualToString("db.name", "name");
- shouldBeEqualToString("db.version", "");
shouldBe("db.objectStores", "[]");
shouldBe("db.objectStores.length", "0");
shouldBe("db.objectStores.contains('')", "false");
@@ -16,6 +15,26 @@ function openSuccess()
// FIXME: Test the other properties of IDBDatabase as they're written.
+ debug("");
+ debug("Testing setVersion.");
+ result = evalAndLog('db.setVersion("version a")');
+ verifyResult(result);
+ result.onsuccess = setVersionAgain;
+ result.onError = unexpectedErrorCallback;
+}
+
+function setVersionAgain()
+{
+ result = evalAndLog('db.setVersion("version b")');
+ verifyResult(result);
+ result.onsuccess = checkVersion;
+ result.onError = unexpectedErrorCallback;
+}
+
+function checkVersion()
+{
+ shouldBeEqualToString("db.version", "version b");
+
done();
}
diff --git a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js
index ff0b711..2fbed5f 100644
--- a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js
+++ b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js
@@ -18,6 +18,7 @@ function openEmptyCursor()
result = evalAndLog("objectStore.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = emptyCursorSuccess;
+ result.onerror = unexpectedErrorCallback;
}
function cursorSuccess()
@@ -39,6 +40,7 @@ function openCursor()
result = evalAndLog("objectStore.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = cursorSuccess;
+ result.onerror = unexpectedErrorCallback;
}
function populateObjectStore(objectStore)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cb17cf4..c7a404d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-25 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add setVersion to IndexedDB
+ https://bugs.webkit.org/show_bug.cgi?id=44630
+
+ * storage/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::setVersion):
+ * storage/IDBDatabase.h:
+ * storage/IDBDatabase.idl:
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::removeObjectStore):
+ (WebCore::IDBDatabaseBackendImpl::setVersion):
+ * storage/IDBDatabaseBackendImpl.h:
+ * storage/IDBDatabaseBackendInterface.h:
+
2010-08-26 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
index 78a6646..81950d6 100644
--- a/WebCore/storage/IDBDatabase.cpp
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -69,6 +69,13 @@ PassRefPtr<IDBRequest> IDBDatabase::removeObjectStore(ScriptExecutionContext* co
return request;
}
+PassRefPtr<IDBRequest> IDBDatabase::setVersion(ScriptExecutionContext* context, const String& version)
+{
+ RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this));
+ m_backend->setVersion(version, request);
+ return request;
+}
+
PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, DOMStringList* storeNames, unsigned short mode, unsigned long timeout)
{
// We need to create a new transaction synchronously. Locks are acquired asynchronously. Operations
diff --git a/WebCore/storage/IDBDatabase.h b/WebCore/storage/IDBDatabase.h
index 0e83288..dc70114 100644
--- a/WebCore/storage/IDBDatabase.h
+++ b/WebCore/storage/IDBDatabase.h
@@ -58,8 +58,10 @@ public:
PassRefPtr<IDBRequest> createObjectStore(ScriptExecutionContext*, const String& name, const String& keyPath = String(), bool autoIncrement = false);
PassRefPtr<IDBObjectStore> objectStore(const String& name, unsigned short mode = IDBTransaction::READ_ONLY);
PassRefPtr<IDBRequest> removeObjectStore(ScriptExecutionContext*, const String& name);
+ PassRefPtr<IDBRequest> setVersion(ScriptExecutionContext*, const String& version);
PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, DOMStringList* storeNames = 0, unsigned short mode = IDBTransaction::READ_ONLY,
unsigned long timeout = 0); // FIXME: what should the default timeout be?
+
private:
IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface>);
diff --git a/WebCore/storage/IDBDatabase.idl b/WebCore/storage/IDBDatabase.idl
index 51bbafb..347b3a7 100644
--- a/WebCore/storage/IDBDatabase.idl
+++ b/WebCore/storage/IDBDatabase.idl
@@ -32,13 +32,14 @@ module storage {
readonly attribute DOMString version;
readonly attribute DOMStringList objectStores;
- // FIXME: Add setVersion.
[CallWith=ScriptExecutionContext] IDBRequest createObjectStore(in DOMString name, in [Optional, ConvertNullToNullString] DOMString keyPath, in [Optional] boolean autoIncrement);
// FIXME: objectStore needs to be able to raise an IDBDatabaseException.
IDBObjectStore objectStore(in DOMString name, in [Optional] unsigned short mode);
[CallWith=ScriptExecutionContext] IDBRequest removeObjectStore(in DOMString name);
+ [CallWith=ScriptExecutionContext] IDBRequest setVersion(in DOMString version);
[CallWith=ScriptExecutionContext] IDBTransaction transaction (in [Optional] DOMStringList storeNames, in [Optional] unsigned short mode, in [Optional] unsigned long timeout);
+ // FIXME: Add close.
};
}
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index 23bc44e..f4f2934 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -185,6 +185,13 @@ void IDBDatabaseBackendImpl::removeObjectStore(const String& name, PassRefPtr<ID
callbacks->onSuccess();
}
+void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_version = version;
+ setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
+ callbacks->onSuccess();
+}
+
PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::transaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout)
{
return m_transactionCoordinator->createTransaction(objectStores, mode, timeout, this);
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h
index 3540b21..ab055f8 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.h
+++ b/WebCore/storage/IDBDatabaseBackendImpl.h
@@ -59,7 +59,9 @@ public:
virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode);
virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>);
+ virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout);
+
private:
IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator*);
diff --git a/WebCore/storage/IDBDatabaseBackendInterface.h b/WebCore/storage/IDBDatabaseBackendInterface.h
index 9e35369..a2e042a 100644
--- a/WebCore/storage/IDBDatabaseBackendInterface.h
+++ b/WebCore/storage/IDBDatabaseBackendInterface.h
@@ -54,12 +54,12 @@ public:
virtual String version() const = 0;
virtual PassRefPtr<DOMStringList> objectStores() const = 0;
- // FIXME: Add transaction and setVersion.
-
virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>) = 0;
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode) = 0;
virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>) = 0;
+ virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>) = 0;
virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout) = 0;
+ // FIXME: Add close.
};
} // namespace WebCore
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 8558a33..b893777 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-25 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Steve Block.
+
+ Add setVersion to IndexedDB
+ https://bugs.webkit.org/show_bug.cgi?id=44630
+
+ * public/WebIDBDatabase.h:
+ (WebKit::WebIDBDatabase::createObjectStore):
+ (WebKit::WebIDBDatabase::removeObjectStore):
+ (WebKit::WebIDBDatabase::setVersion):
+ * src/IDBDatabaseProxy.cpp:
+ (WebCore::IDBDatabaseProxy::setVersion):
+ * src/IDBDatabaseProxy.h:
+ * src/WebIDBDatabaseImpl.cpp:
+ (WebKit::WebIDBDatabaseImpl::setVersion):
+ * src/WebIDBDatabaseImpl.h:
+
2010-08-27 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h
index 6e494ce..4e5cdcb 100644
--- a/WebKit/chromium/public/WebIDBDatabase.h
+++ b/WebKit/chromium/public/WebIDBDatabase.h
@@ -61,20 +61,15 @@ public:
WEBKIT_ASSERT_NOT_REACHED();
return WebDOMStringList();
}
- virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks*)
- {
- WEBKIT_ASSERT_NOT_REACHED();
- }
+ virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
// Transfers ownership of the WebIDBObjectStore to the caller.
virtual WebIDBObjectStore* objectStore(const WebString& name, unsigned short mode)
{
WEBKIT_ASSERT_NOT_REACHED();
return 0;
}
- virtual void removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks)
- {
- WEBKIT_ASSERT_NOT_REACHED();
- }
+ virtual void removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks) { WEBKIT_ASSERT_NOT_REACHED(); }
+ virtual void setVersion(const WebString& version, WebIDBCallbacks* callbacks) { WEBKIT_ASSERT_NOT_REACHED(); }
// Transfers ownership of the WebIDBTransaction to the caller.
virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout)
{
diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp
index 9aa2977..ce5e0a6 100644
--- a/WebKit/chromium/src/IDBDatabaseProxy.cpp
+++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp
@@ -94,6 +94,11 @@ void IDBDatabaseProxy::removeObjectStore(const String& name, PassRefPtr<IDBCallb
m_webIDBDatabase->removeObjectStore(name, new WebIDBCallbacksImpl(callbacks));
}
+void IDBDatabaseProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks)
+{
+ m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks));
+}
+
PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout)
{
WebKit::WebDOMStringList names(storeNames);
diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h
index ed2016a..42a7d7e 100644
--- a/WebKit/chromium/src/IDBDatabaseProxy.h
+++ b/WebKit/chromium/src/IDBDatabaseProxy.h
@@ -52,6 +52,7 @@ public:
virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode);
virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>);
+ virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>);
virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout);
private:
diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index bd3600f..8870ff9 100644
--- a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -87,6 +87,11 @@ void WebIDBDatabaseImpl::removeObjectStore(const WebString& name, WebIDBCallback
m_databaseBackend->removeObjectStore(name, IDBCallbacksProxy::create(callbacks));
}
+void WebIDBDatabaseImpl::setVersion(const WebString& version, WebIDBCallbacks* callbacks)
+{
+ m_databaseBackend->setVersion(version, IDBCallbacksProxy::create(callbacks));
+}
+
WebIDBTransaction* WebIDBDatabaseImpl::transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout)
{
RefPtr<DOMStringList> nameList = PassRefPtr<DOMStringList>(names);
diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h
index 9ae74e0..e0eaaa5 100644
--- a/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -52,6 +52,7 @@ public:
virtual void createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks* callbacks);
virtual WebIDBObjectStore* objectStore(const WebString& name, unsigned short mode);
virtual void removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks);
+ virtual void setVersion(const WebString& version, WebIDBCallbacks* callbacks);
virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, unsigned long timeout);
private:
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list