Bug 76004 - Use the [Supplemental] IDL in SQLDatabase
Summary: Use the [Supplemental] IDL in SQLDatabase
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 72138
  Show dependency treegraph
 
Reported: 2012-01-10 16:06 PST by Kentaro Hara
Modified: 2012-02-24 10:18 PST (History)
4 users (show)

See Also:


Attachments
Patch (23.25 KB, patch)
2012-01-10 16:16 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for commit (23.33 KB, patch)
2012-01-10 16:39 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-01-10 16:06:02 PST
We've been working on WebKit modularization.

By using the [Supplemental] IDL, we can move SQLDatabase related code from WebCore/page/DOMWindow.{h,cpp,idl} to WebCore/storage/DOMWindowSQLDatabase.{h,cpp,idl}.
Comment 1 Kentaro Hara 2012-01-10 16:16:04 PST
Created attachment 121932 [details]
Patch
Comment 2 Adam Barth 2012-01-10 16:26:19 PST
Comment on attachment 121932 [details]
Patch

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

> Source/WebCore/storage/DOMWindowSQLDatabase.cpp:46
> +PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* imp, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)

Maybe |imp| should be |window| ?  We like to use more specific names outside of the bindings.

> Source/WebCore/storage/DOMWindowSQLDatabase.cpp:52
> +    if (imp->frame() && AbstractDatabase::isAvailable() && imp->frame()->document()->securityOrigin()->canAccessDatabase())

imp->frame() will always be true when imp->isCurrentlyDisplayedInFrame() is true.

imp->frame()->document() can just be imp->document()    (there's no reason to indirect through the frame)

Feel free to leave the code as-is since you're just moving it.  Maybe we should just add FIXME comments about these nits?

> Source/WebCore/storage/DOMWindowSQLDatabase.h:51
> +};

Can you make the constructor and destructor private?
Comment 3 Kentaro Hara 2012-01-10 16:39:58 PST
Created attachment 121938 [details]
patch for commit
Comment 4 Kentaro Hara 2012-01-10 16:40:41 PST
(In reply to comment #2)
> (From update of attachment 121932 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=121932&action=review
> 
> > Source/WebCore/storage/DOMWindowSQLDatabase.cpp:46
> > +PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* imp, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
> 
> Maybe |imp| should be |window| ?  We like to use more specific names outside of the bindings.

Done.

> > Source/WebCore/storage/DOMWindowSQLDatabase.cpp:52
> > +    if (imp->frame() && AbstractDatabase::isAvailable() && imp->frame()->document()->securityOrigin()->canAccessDatabase())
> 
> imp->frame() will always be true when imp->isCurrentlyDisplayedInFrame() is true.
> 
> imp->frame()->document() can just be imp->document()    (there's no reason to indirect through the frame)
> 
> Feel free to leave the code as-is since you're just moving it.  Maybe we should just add FIXME comments about these nits?

OK, then I'll leave it as-is in this patch and write a follow-up patch.

> > Source/WebCore/storage/DOMWindowSQLDatabase.h:51
> > +};
> 
> Can you make the constructor and destructor private?

Done. Committed. Thanks!
Comment 5 WebKit Review Bot 2012-01-10 17:12:38 PST
Comment on attachment 121938 [details]
patch for commit

Clearing flags on attachment: 121938

Committed r104654: <http://trac.webkit.org/changeset/104654>
Comment 6 Adam Barth 2012-02-24 10:18:26 PST
I think this has been fixed.