Changeset 129385 in webkit


Ignore:
Timestamp:
Sep 24, 2012 10:17:22 AM (12 years ago)
Author:
dgrogan@chromium.org
Message:

Unprefix IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=96548

Reviewed by Adam Barth.

Source/WebCore:

We are largely compatible with the FF implementation and the w3c test
suite submitted by MS. The w3c test suite doesn't yet check
for lack of prefix; this is mostly to signal to devs that we think our
implementation is stable.

This patch uses the new FeatureObserver to get data about prefixed
vs unprefixed usage.

Tests: storage/indexeddb/unprefix-workers.html

storage/indexeddb/unprefix.html

  • Modules/indexeddb/DOMWindowIndexedDatabase.cpp:

(WebCore::DOMWindowIndexedDatabase::indexedDB):

  • Modules/indexeddb/DOMWindowIndexedDatabase.h:

(DOMWindowIndexedDatabase):

  • Modules/indexeddb/DOMWindowIndexedDatabase.idl:
  • Modules/indexeddb/WorkerContextIndexedDatabase.cpp:

(WebCore::WorkerContextIndexedDatabase::indexedDB):

  • Modules/indexeddb/WorkerContextIndexedDatabase.h:

(WorkerContextIndexedDatabase):

  • Modules/indexeddb/WorkerContextIndexedDatabase.idl:
  • bindings/generic/RuntimeEnabledFeatures.h:

Making the auxiliary objects RuntimeEnabled didn't make much sense as
they are useless without the factory, so always enable them.

(WebCore::RuntimeEnabledFeatures::indexedDBEnabled):

  • bindings/scripts/CodeGeneratorGObject.pm:

(SkipAttribute):

  • page/FeatureObserver.h:

LayoutTests:

  • storage/indexeddb/resources/unprefix.js: Added.

(test):

  • storage/indexeddb/unprefix-expected.txt: Added.
  • storage/indexeddb/unprefix-workers-expected.txt: Added.
  • storage/indexeddb/unprefix-workers.html: Added.
  • storage/indexeddb/unprefix.html: Added.
Location:
trunk
Files:
5 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r129384 r129385  
     12012-09-24  David Grogan  <dgrogan@chromium.org>
     2
     3        Unprefix IndexedDB
     4        https://bugs.webkit.org/show_bug.cgi?id=96548
     5
     6        Reviewed by Adam Barth.
     7
     8        * storage/indexeddb/resources/unprefix.js: Added.
     9        (test):
     10        * storage/indexeddb/unprefix-expected.txt: Added.
     11        * storage/indexeddb/unprefix-workers-expected.txt: Added.
     12        * storage/indexeddb/unprefix-workers.html: Added.
     13        * storage/indexeddb/unprefix.html: Added.
     14
    1152012-09-24  W. James MacLean  <wjmaclean@chromium.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r129383 r129385  
     12012-09-24  David Grogan  <dgrogan@chromium.org>
     2
     3        Unprefix IndexedDB
     4        https://bugs.webkit.org/show_bug.cgi?id=96548
     5
     6        Reviewed by Adam Barth.
     7
     8        We are largely compatible with the FF implementation and the w3c test
     9        suite submitted by MS. The w3c test suite doesn't yet check
     10        for lack of prefix; this is mostly to signal to devs that we think our
     11        implementation is stable.
     12
     13        This patch uses the new FeatureObserver to get data about prefixed
     14        vs unprefixed usage.
     15
     16        Tests: storage/indexeddb/unprefix-workers.html
     17               storage/indexeddb/unprefix.html
     18
     19        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
     20        (WebCore::DOMWindowIndexedDatabase::indexedDB):
     21        * Modules/indexeddb/DOMWindowIndexedDatabase.h:
     22        (DOMWindowIndexedDatabase):
     23        * Modules/indexeddb/DOMWindowIndexedDatabase.idl:
     24        * Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
     25        (WebCore::WorkerContextIndexedDatabase::indexedDB):
     26        * Modules/indexeddb/WorkerContextIndexedDatabase.h:
     27        (WorkerContextIndexedDatabase):
     28        * Modules/indexeddb/WorkerContextIndexedDatabase.idl:
     29        * bindings/generic/RuntimeEnabledFeatures.h:
     30        Making the auxiliary objects RuntimeEnabled didn't make much sense as
     31        they are useless without the factory, so always enable them.
     32
     33        (WebCore::RuntimeEnabledFeatures::indexedDBEnabled):
     34        * bindings/scripts/CodeGeneratorGObject.pm:
     35        (SkipAttribute):
     36        * page/FeatureObserver.h:
     37
    1382012-09-24  Andrey Adaikin  <aandrey@chromium.org>
    239
  • trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp

    r116595 r129385  
    8989}
    9090
    91 IDBFactory* DOMWindowIndexedDatabase::webkitIndexedDB(DOMWindow* window)
     91IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow* window)
    9292{
    93     return from(window)->webkitIndexedDB();
     93    return from(window)->indexedDB();
    9494}
    9595
    96 IDBFactory* DOMWindowIndexedDatabase::webkitIndexedDB()
     96IDBFactory* DOMWindowIndexedDatabase::indexedDB()
    9797{
    9898    Document* document = m_window->document();
  • trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h

    r116595 r129385  
    4242    static DOMWindowIndexedDatabase* from(DOMWindow*);
    4343
    44     static IDBFactory* webkitIndexedDB(DOMWindow*);
     44    static IDBFactory* indexedDB(DOMWindow*);
    4545
    4646    virtual void disconnectFrameForPageCache() OVERRIDE;
     
    5353    explicit DOMWindowIndexedDatabase(DOMWindow*);
    5454
    55     IDBFactory* webkitIndexedDB();
     55    IDBFactory* indexedDB();
    5656
    5757    DOMWindow* m_window;
  • trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl

    r128798 r129385  
    3131        Supplemental=DOMWindow
    3232    ] DOMWindowIndexedDatabase {
    33         readonly attribute [V8MeasureAs=PrefixedIndexedDB] IDBFactory webkitIndexedDB;
     33        readonly attribute [ImplementedAs=indexedDB,V8MeasureAs=PrefixedIndexedDB] IDBFactory webkitIndexedDB;
    3434
    3535        attribute IDBCursorConstructor webkitIDBCursor;
     
    4242        attribute IDBRequestConstructor webkitIDBRequest;
    4343        attribute IDBTransactionConstructor webkitIDBTransaction;
     44
     45        readonly attribute [V8MeasureAs=UnprefixedIndexedDB] IDBFactory indexedDB;
     46
     47        attribute IDBCursorConstructor IDBCursor;
     48        attribute IDBDatabaseConstructor IDBDatabase;
     49        attribute IDBDatabaseExceptionConstructor IDBDatabaseException;
     50        attribute IDBFactoryConstructor IDBFactory;
     51        attribute IDBIndexConstructor IDBIndex;
     52        attribute IDBKeyRangeConstructor IDBKeyRange;
     53        attribute IDBObjectStoreConstructor IDBObjectStore;
     54        attribute IDBRequestConstructor IDBRequest;
     55        attribute IDBTransactionConstructor IDBTransaction;
    4456    };
    4557
  • trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp

    r109556 r129385  
    5959}
    6060
    61 IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB(ScriptExecutionContext* context)
     61IDBFactory* WorkerContextIndexedDatabase::indexedDB(ScriptExecutionContext* context)
    6262{
    63     return from(context)->webkitIndexedDB();
     63    return from(context)->indexedDB();
    6464}
    6565
    66 IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB()
     66IDBFactory* WorkerContextIndexedDatabase::indexedDB()
    6767{
    6868    if (!m_context->securityOrigin()->canAccessDatabase())
  • trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h

    r109556 r129385  
    4343    static WorkerContextIndexedDatabase* from(ScriptExecutionContext*);
    4444
    45     static IDBFactory* webkitIndexedDB(ScriptExecutionContext*);
     45    static IDBFactory* indexedDB(ScriptExecutionContext*);
    4646
    4747private:
    4848    explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
    4949
    50     IDBFactory* webkitIndexedDB();
     50    IDBFactory* indexedDB();
    5151
    5252    ScriptExecutionContext* m_context;
  • trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl

    r112490 r129385  
    3131        Supplemental=WorkerContext
    3232    ] WorkerContextIndexedDatabase {
    33         readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
     33        readonly attribute [ImplementedAs=indexedDB,V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
    3434
    35         attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
    36         attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
    37         attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
    38         attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
    39         attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
    40         attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
    41         attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
    42         attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
    43         attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
     35        attribute IDBCursorConstructor webkitIDBCursor;
     36        attribute IDBDatabaseConstructor webkitIDBDatabase;
     37        attribute IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
     38        attribute IDBFactoryConstructor webkitIDBFactory;
     39        attribute IDBIndexConstructor webkitIDBIndex;
     40        attribute IDBKeyRangeConstructor webkitIDBKeyRange;
     41        attribute IDBObjectStoreConstructor webkitIDBObjectStore;
     42        attribute IDBRequestConstructor webkitIDBRequest;
     43        attribute IDBTransactionConstructor webkitIDBTransaction;
     44
     45        readonly attribute [V8EnabledAtRuntime] IDBFactory indexedDB;
     46
     47        attribute IDBCursorConstructor IDBCursor;
     48        attribute IDBDatabaseConstructor IDBDatabase;
     49        attribute IDBDatabaseExceptionConstructor IDBDatabaseException;
     50        attribute IDBFactoryConstructor IDBFactory;
     51        attribute IDBIndexConstructor IDBIndex;
     52        attribute IDBKeyRangeConstructor IDBKeyRange;
     53        attribute IDBObjectStoreConstructor IDBObjectStore;
     54        attribute IDBRequestConstructor IDBRequest;
     55        attribute IDBTransactionConstructor IDBTransaction;
    4456    };
    4557
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r128924 r129385  
    6262    static void setWebkitIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; }
    6363    static bool webkitIndexedDBEnabled() { return isIndexedDBEnabled; }
    64     static bool webkitIDBCursorEnabled() { return isIndexedDBEnabled; }
    65     static bool webkitIDBDatabaseEnabled() { return isIndexedDBEnabled; }
    66     static bool webkitIDBDatabaseErrorEnabled() { return isIndexedDBEnabled; }
    67     static bool webkitIDBDatabaseExceptionEnabled() { return isIndexedDBEnabled; }
    68     static bool webkitIDBFactoryEnabled() { return isIndexedDBEnabled; }
    69     static bool webkitIDBIndexEnabled() { return isIndexedDBEnabled; }
    70     static bool webkitIDBKeyRangeEnabled() { return isIndexedDBEnabled; }
    71     static bool webkitIDBObjectStoreEnabled() { return isIndexedDBEnabled; }
    72     static bool webkitIDBRequestEnabled() { return isIndexedDBEnabled; }
    73     static bool webkitIDBTransactionEnabled() { return isIndexedDBEnabled; }
     64    static bool indexedDBEnabled() { return isIndexedDBEnabled; }
    7465
    7566#if ENABLE(CSS_EXCLUSIONS)
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r125293 r129385  
    204204
    205205    # Skip indexed database attributes for now, they aren't yet supported for the GObject generator.
    206     if ($attribute->signature->name =~ /^webkitIndexedDB/ or $attribute->signature->name =~ /^webkitIDB/) {
     206    if ($attribute->signature->name =~ /^(?:webkit)?[Ii]ndexedDB/ or $attribute->signature->name =~ /^(?:webkit)?IDB/) {
    207207        return 1;
    208208    }
  • trunk/Source/WebCore/page/FeatureObserver.h

    r129315 r129385  
    4949        WebAudioStart,
    5050        PrefixedContentSecurityPolicy,
     51        UnprefixedIndexedDB,
    5152        // Add new features above this line.
    5253        NumberOfFeatures, // This enum value must be last.
Note: See TracChangeset for help on using the changeset viewer.