2011-01-11 Jeremy Orlow <jorlow@chromium.org>
authorjorlow@chromium.org <jorlow@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jan 2011 10:40:39 +0000 (10:40 +0000)
committerjorlow@chromium.org <jorlow@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jan 2011 10:40:39 +0000 (10:40 +0000)
commitc903c94d70357ba437e21a074a8431d2523bbe1e
tree69acad774d1c5a113339b13813fa43ce6d34b593
parente0fe9513b4892ea1d3b42392dac2cc1a04bcbff5
2011-01-11  Jeremy Orlow  <jorlow@chromium.org>

        Reviewed by Nate Chapin.

        Enforce READ_ONLY transactions in IndexedDB
        https://bugs.webkit.org/show_bug.cgi?id=52229

        Fix existing errors in tests + add a new test for
        this issue.

        * storage/indexeddb/cursor-delete-expected.txt:
        * storage/indexeddb/cursor-delete.html:
        * storage/indexeddb/cursor-index-delete-expected.txt:
        * storage/indexeddb/cursor-index-delete.html:
        * storage/indexeddb/database-quota-expected.txt:
        * storage/indexeddb/database-quota.html:
        * storage/indexeddb/objectstore-basics-expected.txt:
        * storage/indexeddb/objectstore-basics.html:
        * storage/indexeddb/objectstore-removeobjectstore-expected.txt:
        * storage/indexeddb/objectstore-removeobjectstore.html:
        * storage/indexeddb/transaction-basics-expected.txt:
        * storage/indexeddb/transaction-basics.html:
        * storage/indexeddb/transaction-crash-on-abort-expected.txt:
        * storage/indexeddb/transaction-crash-on-abort.html:
        * storage/indexeddb/transaction-read-only.html: Added.
2011-01-11  Jeremy Orlow  <jorlow@chromium.org>

        Reviewed by Nate Chapin.

        Enforce READ_ONLY transactions in IndexedDB
        https://bugs.webkit.org/show_bug.cgi?id=52229

        Add READ_ONLY_ERR and return it whenever delete or put
        are called.  Note that IDBCursor's delete and update
        are simply aliases for delete/put, which is why no
        extra code is required to handle those cases.

        Test: storage/indexeddb/transaction-read-only.html

        * dom/ExceptionCode.cpp:
        * storage/IDBCursorBackendImpl.cpp:
        (WebCore::IDBCursorBackendImpl::deleteFunction):
        * storage/IDBDatabase.idl:
        * storage/IDBDatabaseException.h:
        * storage/IDBDatabaseException.idl:
        * storage/IDBObjectStoreBackendImpl.cpp:
        (WebCore::IDBObjectStoreBackendImpl::put):
        (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
        (WebCore::IDBObjectStoreBackendImpl::deleteIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/cursor-delete-expected.txt
LayoutTests/storage/indexeddb/cursor-delete.html
LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
LayoutTests/storage/indexeddb/cursor-index-delete.html
LayoutTests/storage/indexeddb/database-quota-expected.txt
LayoutTests/storage/indexeddb/database-quota.html
LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics.html
LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
LayoutTests/storage/indexeddb/transaction-basics-expected.txt
LayoutTests/storage/indexeddb/transaction-basics.html
LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt
LayoutTests/storage/indexeddb/transaction-crash-on-abort.html
LayoutTests/storage/indexeddb/transaction-read-only.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/ExceptionCode.cpp
Source/WebCore/storage/IDBCursorBackendImpl.cpp
Source/WebCore/storage/IDBDatabase.idl
Source/WebCore/storage/IDBDatabaseException.h
Source/WebCore/storage/IDBDatabaseException.idl
Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp