[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreip at google.com
andreip at google.com
Wed Dec 22 14:43:29 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4ceda9ab1c76125c744e9656492111fe7c08f24a
Author: andreip at google.com <andreip at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 18 18:04:52 2010 +0000
2010-10-18 Andrei Popescu <andreip at google.com>
Reviewed by Jeremy Orlow.
The description parameter of IDBFactory::open() should be mandatory.
https://bugs.webkit.org/show_bug.cgi?id=47835
* storage/indexeddb/basics-expected.txt:
* storage/indexeddb/basics.html:
2010-10-18 Andrei Popescu <andreip at google.com>
Reviewed by Jeremy Orlow.
The description parameter of IDBFactory::open() should be mandatory.
https://bugs.webkit.org/show_bug.cgi?id=47835
Makes the description parameter mandatory, as per the IndexedDatabase specification.
Modified existing tests to cover this change.
* storage/IDBDatabaseBackendImpl.cpp:
(WebCore::extractMetaData):
(WebCore::setMetaData):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
* storage/IDBFactory.cpp:
(WebCore::IDBFactory::open):
* storage/IDBFactory.h:
* storage/IDBFactory.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 72ffbfd..2b315be 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-18 Andrei Popescu <andreip at google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ The description parameter of IDBFactory::open() should be mandatory.
+ https://bugs.webkit.org/show_bug.cgi?id=47835
+
+ * storage/indexeddb/basics-expected.txt:
+ * storage/indexeddb/basics.html:
+
2010-10-18 Alejandro G. Castro <alex at igalia.com>
Unreviewed, skip test failing in the bots, bug opened to check the
diff --git a/LayoutTests/storage/indexeddb/basics-expected.txt b/LayoutTests/storage/indexeddb/basics-expected.txt
index f7c8e3f..b7b8b94 100644
--- a/LayoutTests/storage/indexeddb/basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/basics-expected.txt
@@ -22,6 +22,12 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
+webkitIndexedDB.open('name');
+PASS Exception thrown.
+webkitIndexedDB.open('name', null);
+PASS Exception thrown.
+webkitIndexedDB.open('name', undefined);
+PASS Exception thrown.
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/basics.html b/LayoutTests/storage/indexeddb/basics.html
index 905662f..2e382b2 100644
--- a/LayoutTests/storage/indexeddb/basics.html
+++ b/LayoutTests/storage/indexeddb/basics.html
@@ -14,12 +14,6 @@ description("Test IndexedDB's basics.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
-function openCallback()
-{
- verifySuccessEvent(event);
- done();
-}
-
function test()
{
shouldBeTrue("'webkitIndexedDB' in window");
@@ -30,9 +24,37 @@ function test()
result = evalAndLog("webkitIndexedDB.open('name', 'description')");
verifyResult(result);
result.onsuccess = openCallback;
- result.onerror = unexpectedErrorCallback;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openCallback()
+{
+ verifySuccessEvent(event);
+ try {
+ debug("webkitIndexedDB.open('name');");
+ webkitIndexedDB.open('name');
+ testFailed("Calling IDBFactory::open without a description should have thrown.");
+ } catch (err) {
+ testPassed("Exception thrown.");
+ }
+ try {
+ debug("webkitIndexedDB.open('name', null);");
+ webkitIndexedDB.open('name', null);
+ testFailed("Calling IDBFactory::open with a null description should have thrown.");
+ } catch (err) {
+ testPassed("Exception thrown.");
+ }
+ try {
+ debug("webkitIndexedDB.open('name', undefined);");
+ webkitIndexedDB.open('name', undefined);
+ testFailed("Calling IDBFactory::open with an undefined description should have thrown.");
+ } catch (err) {
+ testPassed("Exception thrown.");
+ }
+ done();
}
+
test();
var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 04a974e..7985fcb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-18 Andrei Popescu <andreip at google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ The description parameter of IDBFactory::open() should be mandatory.
+ https://bugs.webkit.org/show_bug.cgi?id=47835
+
+ Makes the description parameter mandatory, as per the IndexedDatabase specification.
+ Modified existing tests to cover this change.
+
+ * storage/IDBDatabaseBackendImpl.cpp:
+ (WebCore::extractMetaData):
+ (WebCore::setMetaData):
+ (WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
+ * storage/IDBFactory.cpp:
+ (WebCore::IDBFactory::open):
+ * storage/IDBFactory.h:
+ * storage/IDBFactory.idl:
+
2010-10-18 Xiaomei Ji <xji at chromium.org>
Reviewed by David Levin.
diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp
index 86637f0..dc61e22 100644
--- a/WebCore/storage/IDBDatabaseBackendImpl.cpp
+++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp
@@ -40,9 +40,9 @@
namespace WebCore {
-static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expectedName, String& foundDescription, String& foundVersion)
+static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expectedName, String& foundVersion)
{
- SQLiteStatement metaDataQuery(*sqliteDatabase, "SELECT name, description, version FROM MetaData");
+ SQLiteStatement metaDataQuery(*sqliteDatabase, "SELECT name, version FROM MetaData");
if (metaDataQuery.prepare() != SQLResultOk || metaDataQuery.step() != SQLResultRow)
return false;
@@ -50,8 +50,7 @@ static bool extractMetaData(SQLiteDatabase* sqliteDatabase, const String& expect
LOG_ERROR("Name in MetaData (%s) doesn't match expected (%s) for IndexedDB", metaDataQuery.getColumnText(0).utf8().data(), expectedName.utf8().data());
ASSERT_NOT_REACHED();
}
- foundDescription = metaDataQuery.getColumnText(1);
- foundVersion = metaDataQuery.getColumnText(2);
+ foundVersion = metaDataQuery.getColumnText(1);
if (metaDataQuery.step() == SQLResultRow) {
LOG_ERROR("More than one row found in MetaData table");
@@ -82,26 +81,21 @@ static bool setMetaData(SQLiteDatabase* sqliteDatabase, const String& name, cons
return false;
}
- // FIXME: Should we assert there's only one row?
-
return true;
}
IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> sqliteDatabase, IDBTransactionCoordinator* coordinator)
: m_sqliteDatabase(sqliteDatabase)
, m_name(name)
+ , m_description(description)
, m_version("")
, m_transactionCoordinator(coordinator)
{
ASSERT(!m_name.isNull());
+ ASSERT(!m_description.isNull());
- // FIXME: The spec is in flux about how to handle description. Sync it up once a final decision is made.
- String foundDescription = "";
- bool result = extractMetaData(m_sqliteDatabase.get(), m_name, foundDescription, m_version);
- m_description = description.isNull() ? foundDescription : description;
-
- if (!result || m_description != foundDescription)
- setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
+ extractMetaData(m_sqliteDatabase.get(), m_name, m_version);
+ setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version);
loadObjectStores();
}
diff --git a/WebCore/storage/IDBFactory.cpp b/WebCore/storage/IDBFactory.cpp
index a9ec429..649eb37 100644
--- a/WebCore/storage/IDBFactory.cpp
+++ b/WebCore/storage/IDBFactory.cpp
@@ -37,6 +37,7 @@
#include "Frame.h"
#include "GroupSettings.h"
#include "IDBDatabase.h"
+#include "IDBDatabaseException.h"
#include "IDBFactoryBackendInterface.h"
#include "IDBKeyRange.h"
#include "IDBRequest.h"
@@ -70,6 +71,11 @@ PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const S
// FIXME: Raise a NON_TRANSIENT_ERR if the name is invalid.
+ if (description.isNull()) {
+ ec = IDBDatabaseException::NON_TRANSIENT_ERR;
+ return 0;
+ }
+
RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this), 0);
GroupSettings* groupSettings = document->page()->group().groupSettings();
m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame(), groupSettings->indexedDBDatabasePath(), groupSettings->indexedDBQuotaBytes());
diff --git a/WebCore/storage/IDBFactory.h b/WebCore/storage/IDBFactory.h
index cbdda93..8953245 100644
--- a/WebCore/storage/IDBFactory.h
+++ b/WebCore/storage/IDBFactory.h
@@ -54,9 +54,6 @@ public:
}
~IDBFactory();
- // FIXME: Try to modify the code generator so this is unneeded.
- PassRefPtr<IDBRequest> open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec) { return open(context, name, String(), ec); }
-
PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description, ExceptionCode&);
private:
diff --git a/WebCore/storage/IDBFactory.idl b/WebCore/storage/IDBFactory.idl
index a5a9e53..646df41 100644
--- a/WebCore/storage/IDBFactory.idl
+++ b/WebCore/storage/IDBFactory.idl
@@ -28,7 +28,7 @@ module storage {
interface [
Conditional=INDEXED_DATABASE
] IDBFactory {
- [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in [Optional, ConvertUndefinedOrNullToNullString] DOMString description)
+ [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in [ConvertUndefinedOrNullToNullString] DOMString description)
raises (IDBDatabaseException);
};
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list