This will allow actual reuse of resources now that the cache is handling resource origin and CORS mode.
Created attachment 288566 [details] Patch
Created attachment 289039 [details] Patch for landing
Comment on attachment 289039 [details] Patch for landing Clearing flags on attachment: 289039 Committed r206010: <http://trac.webkit.org/changeset/206010>
All reviewed patches have been landed. Closing bug.
Comment on attachment 289039 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=289039&action=review > Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:99 > + m_parsedStyleSheetCache = sheet.m_parsedStyleSheetCache; This is not correct. It is not safe to have multiple cache clients for the same StyleSheetContents instance. This should make a copy() and call addedToMemoryCache() for it. This is a probable cause for https://bugs.webkit.org/show_bug.cgi?id=163905
Comment on attachment 289039 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=289039&action=review >> Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:99 >> + m_parsedStyleSheetCache = sheet.m_parsedStyleSheetCache; > > This is not correct. It is not safe to have multiple cache clients for the same StyleSheetContents instance. This should make a copy() and call addedToMemoryCache() for it. > > This is a probable cause for https://bugs.webkit.org/show_bug.cgi?id=163905 I can prepare something along the lines you mention but I would be interested in further understanding the situation. For instance, what is the reason of this multiple cache clients limitation? Can we remove it?
> I can prepare something along the lines you mention but I would be > interested in further understanding the situation. > For instance, what is the reason of this multiple cache clients limitation? > Can we remove it? It might actually be just matter of replacing m_isInMemoryCache bit with m_isInMemoryCacheCount that gets incremented and decremented as needed. The bit is used to figuring out if we need to make a copy of the stylesheet contents when it is mutated via API. See CSSStyleSheet::willMutateRules().
m_inMemoryCacheCount