Title: [143954] trunk/Source/WebCore
Revision
143954
Author
[email protected]
Date
2013-02-25 11:36:14 -0800 (Mon, 25 Feb 2013)

Log Message

Changed DatabaseTracker::getMaxSizeForDatabase() to return the previous
database size instead of 0 when the quota limit has been reached.
https://bugs.webkit.org/show_bug.cgi?id=110557.

Reviewed by Geoffrey Garen.

Testing of concurrent multi-process consumption of database quota shows that
returning a value of 0 when the quota is exceeded still allows some databases
to run away with unbounded growth. However, if getMaxSizeForDatabase() returns
the existing database size, the underlying sqlite3 database will successfully
reject new growth.

The value returned by DatabaseTracker::getMaxSizeForDatabase() is used to set
the SQLite3 database size using a sql command "PRAGMA max_page_count = <size>".
The SQLite3 documentation on this pragma says, "The maximum page count cannot
be reduced below the current database size."

It is undefined what setting it to a reduced size will do. So, we're changing
getMaxSizeForDatabase() to return the existing size instead.

No new tests.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::getMaxSizeForDatabase):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (143953 => 143954)


--- trunk/Source/WebCore/ChangeLog	2013-02-25 19:29:23 UTC (rev 143953)
+++ trunk/Source/WebCore/ChangeLog	2013-02-25 19:36:14 UTC (rev 143954)
@@ -1,3 +1,30 @@
+2013-02-25  Mark Lam  <[email protected]>
+
+        Changed DatabaseTracker::getMaxSizeForDatabase() to return the previous
+        database size instead of 0 when the quota limit has been reached.
+        https://bugs.webkit.org/show_bug.cgi?id=110557.
+
+        Reviewed by Geoffrey Garen.
+
+        Testing of concurrent multi-process consumption of database quota shows that
+        returning a value of 0 when the quota is exceeded still allows some databases
+        to run away with unbounded growth. However, if getMaxSizeForDatabase() returns
+        the existing database size, the underlying sqlite3 database will successfully
+        reject new growth.
+
+        The value returned by DatabaseTracker::getMaxSizeForDatabase() is used to set
+        the SQLite3 database size using a sql command "PRAGMA max_page_count = <size>".
+        The SQLite3 documentation on this pragma says, "The maximum page count cannot
+        be reduced below the current database size."
+
+        It is undefined what setting it to a reduced size will do. So, we're changing
+        getMaxSizeForDatabase() to return the existing size instead.
+
+        No new tests.
+
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+
 2013-02-25  Tony Chang  <[email protected]>
 
         Refactor logic for relaying out children out of RenderBlock::styleDidChange

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (143953 => 143954)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp	2013-02-25 19:29:23 UTC (rev 143953)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp	2013-02-25 19:36:14 UTC (rev 143954)
@@ -301,7 +301,7 @@
     // effective quota will permanently become 2^64.
     unsigned long long maxSize = quota - diskUsage + databaseFileSize;
     if (maxSize > quota)
-        maxSize = 0;
+        maxSize = databaseFileSize;
     return maxSize;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to