Bug 153410 - Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store
Summary: Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 149117 153021
  Show dependency treegraph
 
Reported: 2016-01-24 12:28 PST by Brady Eidson
Modified: 2016-01-24 15:42 PST (History)
4 users (show)

See Also:


Attachments
Patch v1 (22.21 KB, patch)
2016-01-24 12:32 PST, Brady Eidson
darin: review+
Details | Formatted Diff | Diff
Patch for landing (22.66 KB, patch)
2016-01-24 14:53 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2016-01-24 12:28:35 PST
Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store
Comment 1 Brady Eidson 2016-01-24 12:32:24 PST
Created attachment 269703 [details]
Patch v1
Comment 2 Darin Adler 2016-01-24 14:16:15 PST
Comment on attachment 269703 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=269703&action=review

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:737
> +        ASSERT(m_vm);

Not sure this assertion is valuable given that the code to create m_vm is just above.

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:742
> +        const IDBKeyData& key = cursor->currentKey();

auto&?

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:743
> +        const Vector<uint8_t>& valueBuffer = cursor->currentValueBuffer();

auto&?

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:745
> +        Deprecated::ScriptValue value = deserializeIDBValueBuffer(m_globalObject->globalExec(), Vector<uint8_t>(valueBuffer), true);

auto?

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:835
> +    }
> +    {

I think there should be a blank line between these two.

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp:56
> +    auto cursor = std::unique_ptr<SQLiteIDBCursor>(new SQLiteIDBCursor(transaction, objectStoreIdentifier));

Can this use make_unique instead? Problem with private? Long term we would love to just be able to "grep for new without adopt" and it’s not so easy with unique_ptr used like this.

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp:82
> +    , m_indexID(IDBIndexMetadata::InvalidId)

Could we initialize this in the class definition?

> Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp:83
> +    , m_cursorDirection(IndexedDB::CursorDirection::Next)

Could we initialize this in the class definition?
Comment 3 Brady Eidson 2016-01-24 14:53:23 PST
Created attachment 269704 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2016-01-24 15:42:21 PST
Comment on attachment 269704 [details]
Patch for landing

Clearing flags on attachment: 269704

Committed r195517: <http://trac.webkit.org/changeset/195517>
Comment 5 WebKit Commit Bot 2016-01-24 15:42:24 PST
All reviewed patches have been landed.  Closing bug.