Bug 151014 - Modern IDB: Refactor memory objectstore/transaction interation
Summary: Modern IDB: Refactor memory objectstore/transaction interation
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 150939
  Show dependency treegraph
 
Reported: 2015-11-08 22:09 PST by Brady Eidson
Modified: 2015-11-09 10:36 PST (History)
4 users (show)

See Also:


Attachments
Patch v1 (12.57 KB, patch)
2015-11-08 22:24 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 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.