WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 19:29:51 +0000 (19:29 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 19:29:51 +0000 (19:29 +0000)
commit3d94ef193ce200e4534c5f283274ea1382b1b6b4
tree66baf63689368a03891f9ba9b0dc1b42eed001f1
parente1aa5b3f5bb6586648b2a52ef75a7a94bd2d8364
WebCore:

        Reviewed by Anders

        Support for <rdar://problem/5556381> and <rdar://problem/5556379>

        The Database feature in the engine needs to support delegate calls for policy decisions and
        also provide notifications when origins and databases change their state.

        This patch also polishes off the missing features of the management API

        * page/Chrome.cpp: Implement the two UIDelegate methods
        (WebCore::Chrome::requestQuotaIncreaseForNewDatabase): Ask for more space to create a new database if it won't fit
        (WebCore::Chrome::requestQuotaIncreaseForDatabaseOperation): Ask for more space to complete an in-progress operation
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/graphics/svg/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForDatabaseOperation):

        * storage/Database.cpp:
        (WebCore::Database::openDatabase): Check to see if this database can be opened - the quota must be high
          enough and if it isn't, the UIDelegate should have a change to bump the quota.
          Also update the UI-relevant details (display name and estimated size) upon successful opening of the database

        * storage/DatabaseDetails.h: Remove the version parameter as it is a programatic detail of a
          site database and is not important to API clients
        (WebCore::DatabaseDetails::DatabaseDetails):
        (WebCore::DatabaseDetails::isValid):
        (WebCore::DatabaseDetails::name):

        * storage/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::openTrackerDatabase): Tweaked the schema here - there was a horrible bug with the old schema that would
          prevent you from having two databases of the same name from two different origins.  Also simplify the origin-management schema
        (WebCore::DatabaseTracker::canEstablishDatabase): Added.  Does some estimated size vs quota checks, and asks the UI delegate for
          more space if necessary
        (WebCore::DatabaseTracker::hasEntryForOrigin):
        (WebCore::DatabaseTracker::establishEntryForOrigin): Establishes a tracker entry for the given origin with the current default quota
          Also notifies the client of the new origin
        (WebCore::DatabaseTracker::setDatabaseDetails): Update the display name and estimated size for the given database
        (WebCore::DatabaseTracker::fullPathForDatabase): Tweak to add the ability to get the path without creating it - for management purposes
        (WebCore::DatabaseTracker::populateOrigins): Populate origins from the Origins table instead of the Databases table
        (WebCore::DatabaseTracker::origins):
        (WebCore::DatabaseTracker::detailsForNameAndOrigin): For API management
        (WebCore::DatabaseTracker::usageForDatabase):
        (WebCore::DatabaseTracker::usageForOrigin):
        (WebCore::DatabaseTracker::quotaForOrigin):
        (WebCore::DatabaseTracker::setQuota): Notify the client
        (WebCore::DatabaseTracker::addDatabase): Notify the client
        (WebCore::DatabaseTracker::deleteAllDatabases):
        (WebCore::DatabaseTracker::deleteDatabasesWithOrigin):
        (WebCore::DatabaseTracker::deleteDatabase):
        (WebCore::DatabaseTracker::deleteDatabaseFile):
        * storage/DatabaseTracker.h:

WebKit/gtk:

        Keep it building with new client method

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebKit::ChromeClient::requestQuotaIncreaseForDatabaseOperation):
        * WebCoreSupport/ChromeClientGtk.h:

WebKit/mac:

        Reviewed by Anders

        Support for <rdar://problem/5556381> and <rdar://problem/5556379>

        Hook up UI Delegate calls for the database engine feature and other small tweaks

        * Storage/WebDatabaseManager.mm:
        (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Renamed databaseName parameter to databaseIdentifier for clarity
        (-[WebDatabaseManager deleteDatabase:withOrigin:]): Renamed databaseName parameter to databaseIdentifier for clarity
        * Storage/WebDatabaseManagerPrivate.h:

        * Storage/WebDatabaseTrackerClient.h:
        * Storage/WebDatabaseTrackerClient.mm:
        (WebDatabaseTrackerClient::dispatchDidModifyDatabase): Renamed databaseName parameter to databaseIdentifier for clarity

        * WebCoreSupport/WebChromeClient.h:
        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::requestQuotaIncreaseForNewDatabase): Call through to the UI Delegate
        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation): Ditto

        * WebView/WebUIDelegatePrivate.h: Added the two UI Delegate methods

        * WebView/WebView.mm:
        (CallDelegateReturningUnsignedLongLong):
        (CallUIDelegateReturningUnsignedLongLong):
        * WebView/WebViewInternal.h:

WebKit/qt:

        Keep it building with new client method

        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::requestQuotaIncreaseForNewDatabase):
        (WebCore::ChromeClientQt::requestQuotaIncreaseForDatabaseOperation):
        * WebCoreSupport/ChromeClientQt.h:

WebKit/win:

        Keep it building with new client method

        * WebChromeClient.cpp:
        (ChromeClient::requestQuotaIncreaseForNewDatabase):
        (ChromeClient::requestQuotaIncreaseForDatabaseOperation):
        * WebChromeClient.h:

WebKit/wx:

        Keep it building with new client method

        * WebKitSupport/ChromeClientWx.cpp:
        (WebCore::ChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebCore::ChromeClient::requestQuotaIncreaseForDatabaseOperation):
        * WebKitSupport/ChromeClientWx.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
WebCore/ChangeLog
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ChromeClient.h
WebCore/platform/graphics/svg/SVGImageEmptyClients.h
WebCore/storage/Database.cpp
WebCore/storage/DatabaseDetails.h
WebCore/storage/DatabaseTracker.cpp
WebCore/storage/DatabaseTracker.h
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/Storage/WebDatabaseManager.mm
WebKit/mac/Storage/WebDatabaseManagerPrivate.h
WebKit/mac/Storage/WebDatabaseTrackerClient.h
WebKit/mac/Storage/WebDatabaseTrackerClient.mm
WebKit/mac/WebCoreSupport/WebChromeClient.h
WebKit/mac/WebCoreSupport/WebChromeClient.mm
WebKit/mac/WebView/WebUIDelegatePrivate.h
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewInternal.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
WebKit/qt/WebCoreSupport/ChromeClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebChromeClient.cpp
WebKit/win/WebChromeClient.h
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/ChromeClientWx.cpp
WebKit/wx/WebKitSupport/ChromeClientWx.h