From 8ccf722629b08f2a06b2cadbdc3d0c9dc885e25d Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Wed, 13 May 2009 17:58:43 +0100 Subject: Apply fixes for webkit bugs 24776 and 25616 to add ENABLE(DATABASE) guards. This makes the macro work, so ENABLE_DATABASE can be toggled in config.h and the JavaScriptCore.derived.mk or V8Bindings.derived.mk. --- WebKit/mac/Storage/WebDatabaseManager.mm | 4 ++++ WebKit/mac/Storage/WebDatabaseManagerInternal.h | 4 ++++ WebKit/mac/Storage/WebDatabaseManagerPrivate.h | 4 ++++ WebKit/mac/Storage/WebDatabaseTrackerClient.h | 4 ++++ WebKit/mac/Storage/WebDatabaseTrackerClient.mm | 4 ++++ WebKit/mac/Storage/WebSecurityOrigin.mm | 10 ++++++++++ WebKit/mac/Storage/WebSecurityOriginPrivate.h | 1 + 7 files changed, 31 insertions(+) (limited to 'WebKit/mac/Storage') diff --git a/WebKit/mac/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm index fa9eea6..a84f235 100644 --- a/WebKit/mac/Storage/WebDatabaseManager.mm +++ b/WebKit/mac/Storage/WebDatabaseManager.mm @@ -29,6 +29,8 @@ #import "WebDatabaseManagerPrivate.h" #import "WebDatabaseManagerInternal.h" +#if ENABLE(DATABASE) + #import "WebDatabaseTrackerClient.h" #import "WebSecurityOriginInternal.h" @@ -137,3 +139,5 @@ void WebKitInitializeDatabasesIfNecessary() initialized = YES; } + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseManagerInternal.h b/WebKit/mac/Storage/WebDatabaseManagerInternal.h index 2065a4e..6a4ad1d 100644 --- a/WebKit/mac/Storage/WebDatabaseManagerInternal.h +++ b/WebKit/mac/Storage/WebDatabaseManagerInternal.h @@ -26,4 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + void WebKitInitializeDatabasesIfNecessary(); + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h index faa4e5d..e373b1c 100644 --- a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h +++ b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + extern NSString *WebDatabaseDirectoryDefaultsKey; extern NSString *WebDatabaseDisplayNameKey; @@ -62,3 +64,5 @@ extern NSString *WebDatabaseIdentifierKey; - (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin; @end + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.h b/WebKit/mac/Storage/WebDatabaseTrackerClient.h index 5db444c..d06cfe9 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.h +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.h @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + #import class WebDatabaseTrackerClient : public WebCore::DatabaseTrackerClient { @@ -38,3 +40,5 @@ public: private: WebDatabaseTrackerClient(); }; + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm index 48530d6..89626fb 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm @@ -28,6 +28,8 @@ #import "WebDatabaseTrackerClient.h" +#if ENABLE(DATABASE) + #import "WebDatabaseManagerPrivate.h" #import "WebSecurityOriginInternal.h" #import @@ -67,3 +69,5 @@ void WebDatabaseTrackerClient::dispatchDidModifyDatabase(SecurityOrigin* origin, object:webSecurityOrigin.get() userInfo:userInfo.get()]; } + +#endif diff --git a/WebKit/mac/Storage/WebSecurityOrigin.mm b/WebKit/mac/Storage/WebSecurityOrigin.mm index 85313d0..56a21f5 100644 --- a/WebKit/mac/Storage/WebSecurityOrigin.mm +++ b/WebKit/mac/Storage/WebSecurityOrigin.mm @@ -71,12 +71,20 @@ using namespace WebCore; - (unsigned long long)usage { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast(_private)); +#else + return 0; +#endif } - (unsigned long long)quota { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast(_private)); +#else + return 0; +#endif } // Sets the storage quota (in bytes) @@ -84,7 +92,9 @@ using namespace WebCore; // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota { +#if ENABLE(DATABASE) DatabaseTracker::tracker().setQuota(reinterpret_cast(_private), quota); +#endif } - (BOOL)isEqual:(id)anObject diff --git a/WebKit/mac/Storage/WebSecurityOriginPrivate.h b/WebKit/mac/Storage/WebSecurityOriginPrivate.h index 0796c6e..c7836f8 100644 --- a/WebKit/mac/Storage/WebSecurityOriginPrivate.h +++ b/WebKit/mac/Storage/WebSecurityOriginPrivate.h @@ -49,4 +49,5 @@ // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota; + @end -- cgit v1.1