WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
25616
Add more ENABLE_DATABASE guards.
https://bugs.webkit.org/show_bug.cgi?id=25616
Summary
Add more ENABLE_DATABASE guards.
Ben Murdoch
Reported
2009-05-07 09:05:33 PDT
Further to the patch for
https://bugs.webkit.org/show_bug.cgi?id=24776
(landed as
r43283
) I have found further places in the source where the ENABLE_DATABASE macro guard is appropriate. Inserting these guards helps reduce the overall library size when the database api is disabled. Please see attached patch.
Attachments
Adds guards
(9.07 KB, patch)
2009-05-07 09:06 PDT
,
Ben Murdoch
darin
: review-
Details
Formatted Diff
Diff
Fixes include as per comments below.
(9.50 KB, patch)
2009-05-08 02:33 PDT
,
Ben Murdoch
no flags
Details
Formatted Diff
Diff
Adds guards to V8 bindings as well.
(16.02 KB, patch)
2009-05-13 04:57 PDT
,
Ben Murdoch
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Ben Murdoch
Comment 1
2009-05-07 09:06:47 PDT
Created
attachment 30100
[details]
Adds guards
Darin Adler
Comment 2
2009-05-07 09:47:59 PDT
Comment on
attachment 30100
[details]
Adds guards Seems like a fine thing to do.
> Index: WebCore/storage/Database.cpp > =================================================================== > --- WebCore/storage/Database.cpp (revision 43341) > +++ WebCore/storage/Database.cpp (working copy) > @@ -49,9 +49,10 @@ > #include "SQLiteStatement.h" > #include "SQLResultSet.h" > #include <wtf/MainThread.h> > -#include <wtf/StdLibExtras.h> > #endif > > +#include <wtf/StdLibExtras.h> > + > #if USE(JSC) > #include "JSDOMWindow.h" > #include <runtime/InitializeThreading.h>
Unconditional includes should go *before* any conditional includes in the first paragraph. Not between two paragraphs of conditional includes.
> Index: WebCore/storage/DatabaseDetails.h > =================================================================== > --- WebCore/storage/DatabaseDetails.h (revision 43341) > +++ WebCore/storage/DatabaseDetails.h (working copy) > @@ -29,6 +29,8 @@ > #ifndef DatabaseDetails_h > #define DatabaseDetails_h > > +#if ENABLE(DATABASE) > + > #include "PlatformString.h" > > namespace WebCore {
It's not correct to use the ENABLE macro without first including the Platform.h header. Doing so changes this header so it can't be included first, which we don't want. I see the same problem in a few other headers in this patch. review- since we should get such minor details right in a patch that's entirely about adding conditionals
Ben Murdoch
Comment 3
2009-05-07 10:09:19 PDT
Thanks for the comments Darin!
> Unconditional includes should go *before* any conditional includes in the first > paragraph. Not between two paragraphs of conditional includes.
OK, will fix and send a new patch.
> It's not correct to use the ENABLE macro without first including the Platform.h > header. Doing so changes this header so it can't be included first, which we > don't want. I see the same problem in a few other headers in this patch.
OK, but just to be clear -- I only need to add the platform header to those headers that don't have a corresponding implementation file i.e. DatabaseDetails.h SQLError.h SQLStatementCallback.h SQLStatementErrorCallback.h SQLTransactionCallback.h SQLTransactionErrorCallback.h as the others with an implementation file include config.h which pulls in platform.h? Is it preferable in those headers above to pull in platform.h or config.h? Thanks, Ben
Darin Adler
Comment 4
2009-05-07 11:16:21 PDT
(In reply to
comment #3
)
> OK, but just to be clear -- I only need to add the platform header to those > headers that don't have a corresponding implementation file i.e.
No, that's not it. I didn't realize <wtf/Platform.h> is in "config.h". Given that it is, my comment was wrong. It's the responsibility of .cpp files to include "config.h" and WebCore header files can safely assume it has already been included.
Ben Murdoch
Comment 5
2009-05-08 02:33:26 PDT
Created
attachment 30128
[details]
Fixes include as per comments below.
Ben Murdoch
Comment 6
2009-05-13 02:45:26 PDT
Ping ... :)
Ben Murdoch
Comment 7
2009-05-13 04:57:07 PDT
Created
attachment 30272
[details]
Adds guards to V8 bindings as well. This patch also applies the changes to V8 bindings. CC'ing dglazkov for the V8 changes.
Darin Adler
Comment 8
2009-05-13 06:26:27 PDT
Comment on
attachment 30272
[details]
Adds guards to V8 bindings as well.
> + Reviewed by NOBODY (OOPS!). > + > + Reviewed by NOBODY (OOPS!).
You should not have that in the patch you post.
> + WARNING: NO TEST CASES ADDED OR CHANGED
You should also remove this. Otherwise this looks fine, r=me
Gustavo Noronha (kov)
Comment 9
2009-05-14 07:49:42 PDT
Landed as
r43699
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug