Bug 151014

Summary: Modern IDB: Refactor memory objectstore/transaction interation
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, alecflett, commit-queue, jsbell
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 149117, 150939    
Attachments:
Description Flags
Patch v1 none

Description Brady Eidson 2015-11-08 22:09:28 PST
Modern IDB: Refactor memory objectstore/transaction integration

The only time object stores should ever notify transactions about changed records is when they are deleted.

This works because even puts/adds are defined as undergoing a delete first.

This also works such that when transactions abort, records are put back in to the database as normal.

This is important because as we support indexes (https://bugs.webkit.org/show_bug.cgi?id=150939), indexes will rely on OS.delete removing a record and OS.put adding a record.
Comment 1 Brady Eidson 2015-11-08 22:24:34 PST
Created attachment 265033 [details]
Patch v1
Comment 2 Darin Adler 2015-11-09 09:48:22 PST
Comment on attachment 265033 [details]
Patch v1

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

> Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp:168
> +    ASSERT(!m_orderedKeys || m_orderedKeys->find(keyData) == m_orderedKeys->end());

Why not use contains here instead of find==end?
Comment 3 Brady Eidson 2015-11-09 10:14:45 PST
(In reply to comment #2)
> Comment on attachment 265033 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=265033&action=review
> 
> > Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp:168
> > +    ASSERT(!m_orderedKeys || m_orderedKeys->find(keyData) == m_orderedKeys->end());
> 
> Why not use contains here instead of find==end?

m_orderedKeys is a std::set, which apparently doesn't have ::contains() - Only find. :(
Comment 4 WebKit Commit Bot 2015-11-09 10:36:43 PST
Comment on attachment 265033 [details]
Patch v1

Clearing flags on attachment: 265033

Committed r192163: <http://trac.webkit.org/changeset/192163>
Comment 5 WebKit Commit Bot 2015-11-09 10:36:48 PST
All reviewed patches have been landed.  Closing bug.