Bug 123138

Summary: Add a cross-platform IDBRecordIdentifier
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, andersca, ap, charles.wei, commit-queue, jsbell, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 123027    
Attachments:
Description Flags
Patch v1
none
Patch v2 kling: review+

Description Brady Eidson 2013-10-21 23:06:44 PDT
Add a cross-platform IDBRecordIdentifier

Turns out it's already a cross platform concept.  Just need the right header and other code changes to adapt.

More work towards https://bugs.webkit.org/show_bug.cgi?id=123027
Comment 1 Brady Eidson 2013-10-21 23:13:01 PDT
Created attachment 214820 [details]
Patch v1
Comment 2 Andreas Kling 2013-10-22 09:14:18 PDT
Comment on attachment 214820 [details]
Patch v1 

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

> Source/WebCore/Modules/indexeddb/IDBBackingStoreInterface.h:71
> +        virtual const IDBRecordIdentifier* recordIdentifier() const = 0;

Why is this a pointer instead now? Will it ever be null?

> Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:947
> +    ASSERT(recordIdentifier);

It would be nicer to pass the IDBRecordIdentifier here by reference. Then you wouldn't need this ugly assertion..

> Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:1195
> +    ASSERT(recordIdentifier);

It would be nicer to pass the IDBRecordIdentifier here by reference. Then you wouldn't need this ugly assertion..

> Source/WebCore/Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:66
> +    ASSERT(recordIdentifier);

It would be nicer to pass the IDBRecordIdentifier here by reference. Then you wouldn't need this ugly assertion..
Comment 3 Brady Eidson 2013-10-22 09:24:06 PDT
(In reply to comment #2)
> (From update of attachment 214820 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214820&action=review
> 
> > Source/WebCore/Modules/indexeddb/IDBBackingStoreInterface.h:71
> > +        virtual const IDBRecordIdentifier* recordIdentifier() const = 0;
> 
> Why is this a pointer instead now? Will it ever be null?

I forgot ptr->reference is your thing.  It might be null, in that previously it might have been a default constructed object representing nothing.

I'll see if I can make it back to a reference...
Comment 4 Brady Eidson 2013-10-22 09:49:31 PDT
Created attachment 214866 [details]
Patch v2
Comment 5 Andreas Kling 2013-10-22 09:57:08 PDT
Comment on attachment 214866 [details]
Patch v2 

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

Okay. r=me

Looking forward to your "fix all of this terrible code" refactor :)

> Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:1643
> +    virtual const IDBRecordIdentifier& recordIdentifier() const OVERRIDE { ASSERT_NOT_REACHED(); return *(m_recordIdentifier.get()); }

return *m_recordIdentifier;

> Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:1734
> +    virtual const IDBRecordIdentifier& recordIdentifier() const OVERRIDE { ASSERT_NOT_REACHED(); return *(m_recordIdentifier.get()); }

return *m_recordIdentifier;

> Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:117
> +        virtual const IDBRecordIdentifier& recordIdentifier() const OVERRIDE { return *(m_recordIdentifier.get()); }

return *m_recordIdentifier;
Comment 6 Brady Eidson 2013-10-22 10:07:07 PDT
http://trac.webkit.org/changeset/157798
Comment 7 Brady Eidson 2013-10-22 10:07:39 PDT
(In reply to comment #5)
> (From update of attachment 214866 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214866&action=review
> 
> Okay. r=me
> 
> Looking forward to your "fix all of this terrible code" refactor :)

Me too, brother, me too.