Bug 123131 - Re-instate ProposedDatabases needed by detailsForNameAndOrigin()
Summary: Re-instate ProposedDatabases needed by detailsForNameAndOrigin()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-10-21 19:00 PDT by Mark Lam
Modified: 2013-10-23 11:33 PDT (History)
6 users (show)

See Also:


Attachments
the patch. (8.25 KB, patch)
2013-10-21 19:27 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
patch 2: added a test, and track only 1 ProposedDatabase in DatabaseManager. (20.05 KB, patch)
2013-10-23 01:07 PDT, Mark Lam
eflews.bot: commit-queue-
Details | Formatted Diff | Diff
patch 3: fixed efl build failure (20.05 KB, patch)
2013-10-23 01:17 PDT, Mark Lam
buildbot: commit-queue-
Details | Formatted Diff | Diff
patch 4: with speculative fix for Windows build (20.24 KB, patch)
2013-10-23 09:24 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2013-10-21 19:00:18 PDT
The WebKit1 implementation for WebSQL quota management (to determine what database size is being requested by a webpage) used to rely on ProposedDatabase records being added and queried in DatabaseTracker::detailsForNameAndOrigin().  This was removed in favor passing the database details to the DatabaseContext::databaseExceededQuota().  However, this has proved to be inadequate.

This patch will fix this issue by re-instating the use of the ProposedDatabase record in DatabaseManager which serves as the front end interface for DatabaseTracker.
Comment 1 Mark Lam 2013-10-21 19:27:02 PDT
Created attachment 214808 [details]
the patch.

Layout tests are happy.  I don't any new regressions.
Comment 2 Mark Lam 2013-10-21 19:31:31 PDT
<rdar://problem/14813808>.
Comment 3 Geoffrey Garen 2013-10-21 20:24:54 PDT
Comment on attachment 214808 [details]
the patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=214808&action=review

> Source/WebCore/ChangeLog:19
> +        Previously, detailsForNameAndOrigin() relies on the ProposedDatabase
> +        mechanism to provide this size information. This change re-instates the
> +        ProposedDatabase mechanism so that WebKit1 client code that relies on
> +        this behavior will continue to work.

Can you add a test for this? Seems like a pretty straightforward case.

> Source/WebCore/Modules/webdatabase/DatabaseManager.h:139
> +    HashSet<ProposedDatabase*> m_proposedDatabases;

A set implies that we plan to handle lots of proposed databases concurrently or re-entrently. Do we really intend to do that?

If not, let's make this code self-documenting by switching to a single pointer instead of a set, and ASSERTing and returning early if we're wrong.
Comment 4 Mark Lam 2013-10-23 01:07:57 PDT
Created attachment 214937 [details]
patch 2: added a test, and track only 1 ProposedDatabase in DatabaseManager.

I tried to update the DumpRenderTree and test runner files for all the ports needed for the new test, but the gtk one has an abstraction layer that I don't quite understand yet.  So, instead, I added a TestExpectation to fail the test for the gtk port.  The gtk port owners will have to implement the needed changes based on other ports.

The test changes have been tested on Mac.  Will need to let the EWS check if they build on the other ports.
Comment 5 EFL EWS Bot 2013-10-23 01:11:55 PDT
Comment on attachment 214937 [details]
patch 2: added a test, and track only 1 ProposedDatabase in DatabaseManager.

Attachment 214937 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/7748072
Comment 6 Mark Lam 2013-10-23 01:17:28 PDT
Created attachment 214938 [details]
patch 3: fixed efl build failure
Comment 7 Build Bot 2013-10-23 01:57:36 PDT
Comment on attachment 214938 [details]
patch 3: fixed efl build failure

Attachment 214938 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/7728098
Comment 8 Mark Lam 2013-10-23 09:24:32 PDT
Created attachment 214970 [details]
patch 4: with speculative fix for Windows build
Comment 9 Geoffrey Garen 2013-10-23 11:22:19 PDT
Comment on attachment 214970 [details]
patch 4: with speculative fix for Windows build

View in context: https://bugs.webkit.org/attachment.cgi?id=214970&action=review

r=me

> Source/WebCore/Modules/webdatabase/DatabaseManager.h:119
> +        DatabaseManager* m_manager;

This should be a reference, since it can't be null.
Comment 10 Mark Lam 2013-10-23 11:33:46 PDT
Thanks for the review. Geoff's last feedback has been addressed.  Landed in r157874: <http://trac.webkit.org/r157874>.