Bug 126577

Summary: [SOUP] [WK2] - Disable MemoryCache when the DOCUMENT_VIEWER cache model is set
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, commit-queue, gustavo, gyuyoung.kim, ryuan.choi
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch
none
Proposed patch v2
none
Proposed patch v3 none

Tomas Popela
Reported 2014-01-07 06:08:40 PST
As in http://trac.webkit.org/changeset/152483, but this time for WK2. When WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER is set we need to disable the MemoryCache completely (based on cacheMinDeadCapacity and cacheMaxDeadCapacity values) to prevent caching the resources.
Attachments
Proposed patch (2.81 KB, patch)
2014-01-07 06:18 PST, Tomas Popela
no flags
Proposed patch v2 (2.60 KB, patch)
2014-01-14 06:57 PST, Tomas Popela
no flags
Proposed patch v3 (2.57 KB, patch)
2014-01-15 00:45 PST, Tomas Popela
no flags
Tomas Popela
Comment 1 2014-01-07 06:18:22 PST
Created attachment 220518 [details] Proposed patch
Carlos Garcia Campos
Comment 2 2014-01-07 06:25:57 PST
In r152483 we also check that cacheTotalCapacity is 0, don't we need that in wk2 as well?
Carlos Garcia Campos
Comment 3 2014-01-07 06:27:43 PST
Comment on attachment 220518 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=220518&action=review > Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp:107 > + bool disableCache = !cacheMinDeadCapacity && !cacheMaxDeadCapacity; > + WebCore::memoryCache()->setDisabled(disableCache); This is not specific to GTK, it also affects EFL, so I would confirm with EFL guys that this is the desired behaviour for them too, otherwise we should need to do this inside a platform ifdef.
Tomas Popela
Comment 4 2014-01-07 06:33:17 PST
(In reply to comment #2) > In r152483 we also check that cacheTotalCapacity is 0, don't we need that in wk2 as well? Actually the calculateCacheSizes will return != 0 for cacheTotalCapacity even for WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. Another solution will be just asking straight for cache model.
Carlos Garcia Campos
Comment 5 2014-01-12 01:23:57 PST
(In reply to comment #4) > (In reply to comment #2) > > In r152483 we also check that cacheTotalCapacity is 0, don't we need that in wk2 as well? > > Actually the calculateCacheSizes will return != 0 for cacheTotalCapacity even for WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. Another solution will be just asking straight for cache model. Yes, in the end what we want is to make sure that memory cache is disabled for DocumentViewer cache model, because that's what our public API documentation says. So, I would do something like this: #if PLATFORM(GTK) WebCore::memoryCache()->setDisabled(cacheModel == CacheModelDocumentViewer); #endif It's also more obvious and it's the only model that returns cacheMinDeadCapacity = cacheMaxDeadCapacity = 0 after all.
Tomas Popela
Comment 6 2014-01-14 06:57:10 PST
Created attachment 221158 [details] Proposed patch v2
Sergio Villar Senin
Comment 7 2014-01-14 23:15:04 PST
Comment on attachment 221158 [details] Proposed patch v2 Same comment, have you checked with the EFL guys if they want this behavior? I'm almost sure they want, so we wouldn't need the ifdef
Ryuan Choi
Comment 8 2014-01-14 23:39:50 PST
(In reply to comment #7) > (From update of attachment 221158 [details]) > Same comment, have you checked with the EFL guys if they want this behavior? I'm almost sure they want, so we wouldn't need the ifdef I also think that macro is not necessary.
Tomas Popela
Comment 9 2014-01-15 00:45:30 PST
Created attachment 221237 [details] Proposed patch v3 Disable MemoryCache even for EFL (remove the GTK ifdef)
Carlos Garcia Campos
Comment 10 2014-01-15 00:52:14 PST
Comment on attachment 221237 [details] Proposed patch v3 Thanks
WebKit Commit Bot
Comment 11 2014-01-15 01:41:19 PST
Comment on attachment 221237 [details] Proposed patch v3 Clearing flags on attachment: 221237 Committed r162059: <http://trac.webkit.org/changeset/162059>
WebKit Commit Bot
Comment 12 2014-01-15 01:41:22 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.