Changeset 85238 in webkit


Ignore:
Timestamp:
Apr 28, 2011 2:12:45 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-28 Mark Pilgrim <pilgrim@chromium.org>

Reviewed by Tony Chang.

IndexedDB createIndex should fail if name arg is null
https://bugs.webkit.org/show_bug.cgi?id=58365

  • storage/indexeddb/mozilla/create-index-null-name-expected.txt: Added.
  • storage/indexeddb/mozilla/create-index-null-name.html: Added.

2011-04-28 Mark Pilgrim <pilgrim@chromium.org>

Reviewed by Tony Chang.

IndexedDB createIndex should fail if name arg is null
https://bugs.webkit.org/show_bug.cgi?id=58365

Test: storage/indexeddb/mozilla/create-index-null-name.html

  • storage/IDBObjectStore.idl:
  • storage/IDBObjectStoreBackendImpl.cpp: (WebCore::IDBObjectStoreBackendImpl::createIndex):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85234 r85238  
     12011-04-28  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        IndexedDB createIndex should fail if name arg is null
     6        https://bugs.webkit.org/show_bug.cgi?id=58365
     7
     8        * storage/indexeddb/mozilla/create-index-null-name-expected.txt: Added.
     9        * storage/indexeddb/mozilla/create-index-null-name.html: Added.
     10
    1112011-04-28  Mark Pilgrim  <pilgrim@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r85234 r85238  
     12011-04-28  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        IndexedDB createIndex should fail if name arg is null
     6        https://bugs.webkit.org/show_bug.cgi?id=58365
     7
     8        Test: storage/indexeddb/mozilla/create-index-null-name.html
     9
     10        * storage/IDBObjectStore.idl:
     11        * storage/IDBObjectStoreBackendImpl.cpp:
     12        (WebCore::IDBObjectStoreBackendImpl::createIndex):
     13
    1142011-04-28  Mark Pilgrim  <pilgrim@chromium.org>
    215
  • trunk/Source/WebCore/storage/IDBObjectStore.idl

    r78416 r85238  
    2929        Conditional=INDEXED_DATABASE
    3030    ] IDBObjectStore {
    31         readonly attribute DOMString name;
     31        readonly attribute [ConvertNullStringTo=Null] DOMString name;
    3232        readonly attribute [ConvertNullStringTo=Null] DOMString keyPath;
    3333        readonly attribute DOMStringList indexNames;
     
    4545        [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction)
    4646            raises (IDBDatabaseException);
    47         IDBIndex createIndex(in DOMString name, in [ConvertNullToNullString] DOMString keyPath, in [Optional] OptionsObject options)
     47        IDBIndex createIndex(in [ConvertNullToNullString] DOMString name, in [ConvertNullToNullString] DOMString keyPath, in [Optional] OptionsObject options)
    4848            raises (IDBDatabaseException);
    4949        IDBIndex index(in DOMString name)
  • trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp

    r85234 r85238  
    376376PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendImpl::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
    377377{
     378    if (name.isNull()) {
     379        ec = IDBDatabaseException::NON_TRANSIENT_ERR;
     380        return 0;
     381    }
    378382    if (m_indexes.contains(name)) {
    379383        ec = IDBDatabaseException::CONSTRAINT_ERR;
Note: See TracChangeset for help on using the changeset viewer.