Bug 123138 - Add a cross-platform IDBRecordIdentifier
Summary: Add a cross-platform IDBRecordIdentifier
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 123027
  Show dependency treegraph
 
Reported: 2013-10-21 23:06 PDT by Brady Eidson
Modified: 2013-10-22 10:07 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1 (36.25 KB, patch)
2013-10-21 23:13 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v2 (37.69 KB, patch)
2013-10-22 09:49 PDT, Brady Eidson
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.