Changeset 117509 in webkit


Ignore:
Timestamp:
May 17, 2012 4:03:05 PM (12 years ago)
Author:
jsbell@chromium.org
Message:

IndexedDB: Implement IDBObjectStore.autoIncrement
https://bugs.webkit.org/show_bug.cgi?id=86662

Reviewed by Dimitri Glazkov.

Source/WebCore:

Simple boolean accessor defined in the IDB spec, which reflects the
object store's internal autoIncrement flag.

Test: storage/indexeddb/objectstore-basics.html

  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::autoIncrement): Forward call to back end.
(WebCore):

  • Modules/indexeddb/IDBObjectStore.h: Expose attribute as method.

(IDBObjectStore):

  • Modules/indexeddb/IDBObjectStore.idl: Define the attribute.
  • Modules/indexeddb/IDBObjectStoreBackendInterface.h: Expose in interface.

(IDBObjectStoreBackendInterface):

Source/WebKit/chromium:

  • src/IDBObjectStoreBackendProxy.cpp:

(WebKit::IDBObjectStoreBackendProxy::autoIncrement):
(WebKit):

  • src/IDBObjectStoreBackendProxy.h:

(IDBObjectStoreBackendProxy):

  • src/WebIDBObjectStoreImpl.cpp:

(WebKit::WebIDBObjectStoreImpl::autoIncrement):
(WebKit):

  • src/WebIDBObjectStoreImpl.h:

(WebIDBObjectStoreImpl):

LayoutTests:

  • storage/indexeddb/objectstore-basics-expected.txt:
  • storage/indexeddb/objectstore-basics-workers-expected.txt:
  • storage/indexeddb/resources/objectstore-basics.js:

(setVersionSuccess):

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117505 r117509  
     12012-05-17  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Implement IDBObjectStore.autoIncrement
     4        https://bugs.webkit.org/show_bug.cgi?id=86662
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * storage/indexeddb/objectstore-basics-expected.txt:
     9        * storage/indexeddb/objectstore-basics-workers-expected.txt:
     10        * storage/indexeddb/resources/objectstore-basics.js:
     11        (setVersionSuccess):
     12
    1132012-05-17  Peter Kasting  <pkasting@google.com>
    214
  • trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt

    r116337 r117509  
    2121PASS 'indexNames' in store is true
    2222PASS 'transaction' in store is true
     23PASS 'autoIncrement' in store is true
    2324PASS 'put' in store is true
    2425PASS typeof store.put is "function"
     
    4344PASS store.name is "storeName"
    4445PASS store.keyPath is null
     46PASS store.autoIncrement is false
    4547PASS storeNames.contains('storeName') is true
    4648PASS storeNames.length is 1
     49PASS db.createObjectStore('storeWithKeyPath', {keyPath: 'path'}).keyPath is "path"
     50PASS db.createObjectStore('storeWithKeyGenerator', {autoIncrement: true}).autoIncrement is true
    4751Ask for an index that doesn't exist:
    4852index = store.index('asdf')
  • trunk/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt

    r116337 r117509  
    2222PASS [Worker] 'indexNames' in store is true
    2323PASS [Worker] 'transaction' in store is true
     24PASS [Worker] 'autoIncrement' in store is true
    2425PASS [Worker] 'put' in store is true
    2526PASS [Worker] typeof store.put is "function"
     
    4445PASS [Worker] store.name is "storeName"
    4546PASS [Worker] store.keyPath is null
     47PASS [Worker] store.autoIncrement is false
    4648PASS [Worker] storeNames.contains('storeName') is true
    4749PASS [Worker] storeNames.length is 1
     50PASS [Worker] db.createObjectStore('storeWithKeyPath', {keyPath: 'path'}).keyPath is "path"
     51PASS [Worker] db.createObjectStore('storeWithKeyGenerator', {autoIncrement: true}).autoIncrement is true
    4852[Worker] Ask for an index that doesn't exist:
    4953[Worker] index = store.index('asdf')
  • trunk/LayoutTests/storage/indexeddb/resources/objectstore-basics.js

    r116337 r117509  
    4343    shouldBeTrue("'indexNames' in store");
    4444    shouldBeTrue("'transaction' in store");
     45    shouldBeTrue("'autoIncrement' in store");
    4546    shouldBeTrue("'put' in store");
    4647    shouldBeEqualToString("typeof store.put", "function");
     
    6667    shouldBeEqualToString("store.name", "storeName");
    6768    shouldBeNull("store.keyPath");
     69    shouldBeFalse("store.autoIncrement");
    6870    shouldBe("storeNames.contains('storeName')", "true");
    6971    shouldBe("storeNames.length", "1");
     72
     73    shouldBeEqualToString("db.createObjectStore('storeWithKeyPath', {keyPath: 'path'}).keyPath", "path");
     74    shouldBeTrue("db.createObjectStore('storeWithKeyGenerator', {autoIncrement: true}).autoIncrement");
     75
    7076    // FIXME: test all of object store's methods.
    7177
  • trunk/Source/WebCore/ChangeLog

    r117507 r117509  
     12012-05-17  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Implement IDBObjectStore.autoIncrement
     4        https://bugs.webkit.org/show_bug.cgi?id=86662
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Simple boolean accessor defined in the IDB spec, which reflects the
     9        object store's internal autoIncrement flag.
     10
     11        Test: storage/indexeddb/objectstore-basics.html
     12
     13        * Modules/indexeddb/IDBObjectStore.cpp:
     14        (WebCore::IDBObjectStore::autoIncrement): Forward call to back end.
     15        (WebCore):
     16        * Modules/indexeddb/IDBObjectStore.h: Expose attribute as method.
     17        (IDBObjectStore):
     18        * Modules/indexeddb/IDBObjectStore.idl: Define the attribute.
     19        * Modules/indexeddb/IDBObjectStoreBackendInterface.h: Expose in interface.
     20        (IDBObjectStoreBackendInterface):
     21
    1222012-05-17  Kentaro Hara  <haraken@chromium.org>
    223
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp

    r117338 r117509  
    7979}
    8080
     81bool IDBObjectStore::autoIncrement() const
     82{
     83    IDB_TRACE("IDBObjectStore::autoIncrement");
     84    return m_backend->autoIncrement();
     85}
     86
    8187PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec)
    8288{
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h

    r116337 r117509  
    5656    ~IDBObjectStore() { }
    5757
     58    // Implement the IDBObjectStore IDL
    5859    String name() const;
    5960    String keyPath() const;
    6061    PassRefPtr<DOMStringList> indexNames() const;
    6162    IDBTransaction* transaction() const;
     63    bool autoIncrement() const;
    6264
    6365    // FIXME: Try to modify the code generator so this is unneeded.
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl

    r116337 r117509  
    3333        readonly attribute DOMStringList indexNames;
    3434        readonly attribute IDBTransaction transaction;
     35        readonly attribute boolean autoIncrement;
    3536
    3637        [CallWith=ScriptExecutionContext] IDBRequest put(in SerializedScriptValue value, in [Optional] IDBKey key)
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendInterface.h

    r114981 r117509  
    5151    virtual String keyPath() const = 0;
    5252    virtual PassRefPtr<DOMStringList> indexNames() const = 0;
     53    virtual bool autoIncrement() const = 0;
    5354
    5455    virtual void get(PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
  • trunk/Source/WebKit/chromium/ChangeLog

    r117481 r117509  
     12012-05-17  Joshua Bell  <jsbell@chromium.org>
     2
     3        IndexedDB: Implement IDBObjectStore.autoIncrement
     4        https://bugs.webkit.org/show_bug.cgi?id=86662
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * src/IDBObjectStoreBackendProxy.cpp:
     9        (WebKit::IDBObjectStoreBackendProxy::autoIncrement):
     10        (WebKit):
     11        * src/IDBObjectStoreBackendProxy.h:
     12        (IDBObjectStoreBackendProxy):
     13        * src/WebIDBObjectStoreImpl.cpp:
     14        (WebKit::WebIDBObjectStoreImpl::autoIncrement):
     15        (WebKit):
     16        * src/WebIDBObjectStoreImpl.h:
     17        (WebIDBObjectStoreImpl):
     18
    1192012-05-17  Mikhail Naganov  <mnaganov@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp

    r115339 r117509  
    7373{
    7474    return m_webIDBObjectStore->indexNames();
     75}
     76
     77bool IDBObjectStoreBackendProxy::autoIncrement() const
     78{
     79    return m_webIDBObjectStore->autoIncrement();
    7580}
    7681
  • trunk/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h

    r114981 r117509  
    4646    virtual String keyPath() const;
    4747    virtual PassRefPtr<WebCore::DOMStringList> indexNames() const;
     48    virtual bool autoIncrement() const;
    4849
    4950    virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
  • trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp

    r115339 r117509  
    7575}
    7676
     77bool WebIDBObjectStoreImpl::autoIncrement() const
     78{
     79    return m_objectStore->autoIncrement();
     80}
     81
    7782void WebIDBObjectStoreImpl::get(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
    7883{
  • trunk/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h

    r115339 r117509  
    5252    WebString keyPathString() const;
    5353    WebDOMStringList indexNames() const;
     54    bool autoIncrement() const;
    5455
    5556    void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
Note: See TracChangeset for help on using the changeset viewer.