Refactoring the Database class to not depend on
authordumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Oct 2009 20:14:29 +0000 (20:14 +0000)
committerdumi@chromium.org <dumi@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Oct 2009 20:14:29 +0000 (20:14 +0000)
commit68695e0f0e2b58cfd9eab874081f03460dc96d5f
tree964147c294b0dca0715a08fd9ba76205e266bd5d
parentcd6569dc0cc6efc237d58f241813145eca71dfc0
Refactoring the Database class to not depend on
OriginQuotaManager. Also, adding a SecurityOrigin copy to each
Database instance, that is safe to use on the file
thread. Finally, adding new simple fields and getters to the
Database object for storing/getting the display name and estimated
size specified by the user in the openDatabase() call.

Patch by Dumitru Daniliuc <dumi@chromium.org> on 2009-10-27
Reviewed by Adam Barth.

https://bugs.webkit.org/show_bug.cgi?id=30548

* page/SecurityOrigin.h:
* storage/Database.cpp:
(WebCore::Database::openDatabase): Storing the display name and
the estimated size in the Database object.
(WebCore::Database::Database): Storing the display name and the
estimated size in the Database object, as well as a SecurityOrigin
instance that is safe to use on the DB thread.
(WebCore::Database::maximumSize): Delegate the call to
DatabaseTracker::getMaxSizeForDatabase().
(WebCore::Database::databaseThreadSecurityOrigin): Return the
SecurityOrigin instance that's safe to use on the DB thread.
(WebCore::Database::threadSafeSecurityOrigin): Return the
SecurityOrigin instance that's safe to use on the current thread.
(WebCore::Database::displayName): Return the display name
specified by the user in the openDatabase() call.
(WebCore::Database::estimatedSize): Return the estimated size
specified by the user in the openDatabase() call.
(WebCore::Database::fileName): Return the name of the file where
the current Database is tored.
* storage/Database.h:
* storage/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::getMaxSizeForDatabase): Returns the
maximum size for a DB file based on the current size of that file
and the space available for that origin.
* storage/DatabaseTracker.h:
* storage/SQLTransaction.cpp:
* storage/SQLTransactionClient.cpp:
(WebCore::SQLTransactionClient::didCommitTransaction): Use the
correct SecurityOrigin instance.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/page/SecurityOrigin.h
WebCore/storage/Database.cpp
WebCore/storage/Database.h
WebCore/storage/DatabaseTracker.cpp
WebCore/storage/DatabaseTracker.h
WebCore/storage/OriginQuotaManager.cpp
WebCore/storage/SQLTransaction.cpp
WebCore/storage/SQLTransactionClient.cpp