Bug 142052

Summary: Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Page LoadingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, kling, koivisto
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2015-02-26 12:09:40 PST
Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame(). DatabaseContext is an ActiveDOMObject and DatabaseContext::canSuspend() returns false if its has open databases already. Therefore, such pages would already not go into the page cache.

Another issue is that DatabaseContext::m_hasOpenDatabases is never reset to false. Therefore, any page that ever used the WebDatabase API is currently not page-cacheable. This issue will be addressed separately.
Comment 1 Chris Dumez 2015-02-26 12:16:10 PST
Actually, DatabaseContext does not even override ActiveDOMObject::canSuspend() currently no it always returns false and any page with a DatabaseContext is not page-cacheable, no matter if there are open databases or not.
Comment 2 Chris Dumez 2015-02-26 13:10:37 PST
Created attachment 247439 [details]
Patch
Comment 3 Chris Dumez 2015-02-27 09:42:37 PST
Radar: <rdar://problem/19923085>
Comment 4 Andreas Kling 2015-02-27 11:13:22 PST
Comment on attachment 247439 [details]
Patch

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

r=me

> Source/WebCore/ChangeLog:18
> +        An issue that remains is that DatabaseContext::m_hasOpenDatabases is never reset
> +        to false so once a page opened a database, it will never be page-cacheable. This
> +        will be taken care of separately though.

Sweet.
Comment 5 WebKit Commit Bot 2015-02-27 11:15:46 PST
Comment on attachment 247439 [details]
Patch

Rejecting attachment 247439 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 247439, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
file Source/WebCore/page/DiagnosticLoggingKeys.cpp
patching file Source/WebCore/page/DiagnosticLoggingKeys.h
patching file LayoutTests/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file LayoutTests/fast/history/page-cache-webdatabase-opened-db-expected.txt
patching file LayoutTests/fast/history/page-cache-webdatabase-opened-db.html

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Andreas Kling']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.appspot.com/results/5816908611846144
Comment 6 Chris Dumez 2015-02-27 11:21:10 PST
Created attachment 247525 [details]
Patch
Comment 7 Chris Dumez 2015-02-27 11:22:27 PST
Comment on attachment 247525 [details]
Patch

Clearing flags on attachment: 247525

Committed r180770: <http://trac.webkit.org/changeset/180770>
Comment 8 Chris Dumez 2015-02-27 11:22:31 PST
All reviewed patches have been landed.  Closing bug.