Bug 80061 - Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper
Summary: Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks: 79327
  Show dependency treegraph
 
Reported: 2012-03-01 15:38 PST by Adam Barth
Modified: 2012-03-01 16:25 PST (History)
2 users (show)

See Also:


Attachments
Patch (6.18 KB, patch)
2012-03-01 15:40 PST, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (11.29 KB, patch)
2012-03-01 15:45 PST, Adam Barth
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2012-03-01 15:38:28 PST
Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper
Comment 1 Adam Barth 2012-03-01 15:40:05 PST
Created attachment 129761 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-01 15:42:39 PST
Comment on attachment 129761 [details]
Patch

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

This modules thing really has worked out well, it seems.  So much less crap in these core classes.

> Source/WebCore/page/PageGroup.h:46
> +    class PageGroup : public Supplementable<PageGroup> {

Remind me what (if any) over head Suplementable adds to this object?  No storage, correct?
Comment 3 Dimitri Glazkov (Google) 2012-03-01 15:43:12 PST
Comment on attachment 129761 [details]
Patch

Missing new files...
Comment 4 Eric Seidel (no email) 2012-03-01 15:44:17 PST
Comment on attachment 129761 [details]
Patch

Sorry, my fault.
Comment 5 Adam Barth 2012-03-01 15:45:47 PST
Created attachment 129763 [details]
Patch
Comment 6 Kentaro Hara 2012-03-01 15:47:35 PST
Comment on attachment 129763 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:13
> + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND

Is this a license block of Google?
Comment 7 Dimitri Glazkov (Google) 2012-03-01 15:48:10 PST
Comment on attachment 129763 [details]
Patch

My drive-by review thirst is now quenched.
Comment 8 Eric Seidel (no email) 2012-03-01 15:48:37 PST
Comment on attachment 129763 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:44
> +PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)

PassOwnPtr?

> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:47
> +    DEFINE_STATIC_LOCAL(AtomicString, name, ("PageGroupIndexedDatabase"));
> +    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, name));

One wonders why we don't just make these hashes static on the Suplement implementation, instead of keyed off of an AtomicString.

> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h:41
> +    static PageGroupIndexedDatabase* from(PageGroup&);

I'm surprised I didn't rag on you about using smart pointers for these from() functions earlier.  Seems leaky w/o them...
Comment 9 Adam Barth 2012-03-01 15:55:15 PST
> > Source/WebCore/page/PageGroup.h:46
> > +    class PageGroup : public Supplementable<PageGroup> {
> 
> Remind me what (if any) over head Suplementable adds to this object?  No storage, correct?

It adds one pointer, which is what we're removing in this patch.  (Of course, there's only one PageGroup per process, so the amount of memory we're talking about is quite small.)

> Is this a license block of Google?

This code was written by Google, yes.

(In reply to comment #8)
> (From update of attachment 129763 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=129763&action=review
> 
> > Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:44
> > +PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
> 
> PassOwnPtr?

The type here is to patch the type returned by Page::group(), which is what all the callers of this function use.  Normally we would use a pointer, but that made the call sites slightly less pretty.

> > Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:47
> > +    DEFINE_STATIC_LOCAL(AtomicString, name, ("PageGroupIndexedDatabase"));
> > +    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, name));
> 
> One wonders why we don't just make these hashes static on the Suplement implementation, instead of keyed off of an AtomicString.

I'm not sure I follow.

> > Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h:41
> > +    static PageGroupIndexedDatabase* from(PageGroup&);
> 
> I'm surprised I didn't rag on you about using smart pointers for these from() functions earlier.  Seems leaky w/o them...

The object is owned by PageGroup.  In the implementation of from(..), you'll notice that we call adoptPtr and then given the owning reference to the PageGroup.
Comment 10 Kentaro Hara 2012-03-01 15:58:07 PST
(In reply to comment #9)
> > + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
>
> > Is this a license block of Google?
> 
> This code was written by Google, yes.

I meant, the licence block should be Google, but it appears you are using a licence template of Apple. ("THIS SOFTWARE IS PROVIDED BY APPLE INC.")
Comment 11 Adam Barth 2012-03-01 16:00:10 PST
> I meant, the licence block should be Google, but it appears you are using a licence template of Apple. ("THIS SOFTWARE IS PROVIDED BY APPLE INC.")

I see.  Yes.  Will fix.
Comment 12 Eric Seidel (no email) 2012-03-01 16:14:50 PST
Comment on attachment 129763 [details]
Patch

I did not mean to clear dglazkovs r+, sorry.
Comment 13 Eric Seidel (no email) 2012-03-01 16:17:20 PST
Comment on attachment 129763 [details]
Patch

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

>>> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:44
>>> +PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
>> 
>> PassOwnPtr?
> 
> The type here is to patch the type returned by Page::group(), which is what all the callers of this function use.  Normally we would use a pointer, but that made the call sites slightly less pretty.

I see, the fact that you're adopting the pointer makes this OK.

>>> Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp:47
>>> +    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, name));
>> 
>> One wonders why we don't just make these hashes static on the Suplement implementation, instead of keyed off of an AtomicString.
> 
> I'm not sure I follow.

Remind me and we can discuss in person.  Not particularly important.
Comment 14 Adam Barth 2012-03-01 16:25:48 PST
Committed r109463: <http://trac.webkit.org/changeset/109463>