Prevent new loads while in PageCache (or being added to PageCache).
rdar://problem/21523788
Created attachment 255540 [details] Patch
Comment on attachment 255540 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255540&action=review > Source/WebCore/loader/cache/CachedResource.cpp:218 > + if (cachedResourceLoader.frame()->page() && cachedResourceLoader.frame()->page()->inPageCache()) { This is the actual change. The test of the patch is about getting rid of the complexity I added in r185337.
Comment on attachment 255540 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255540&action=review > Source/WebCore/loader/FrameLoader.h:280 > + enum class PageDismissalType { > + None, > + BeforeUnload, > + PageHide, > + Unload > + }; I like this better in a single line; not sure if others agree. > Source/WebCore/loader/cache/CachedResource.cpp:217 > + // Prevent new loads if we are in the PageCache (or being added to the PageCache). I would not use parentheses here. Just leave them out. > Source/WebCore/page/Page.cpp:571 > + auto* document = mainFrame().document(); > + if (!document) > + return false; > + > + return document->inPageCache(); I like writing it like this: auto* document = mainFrame().document(); return document && document->inPageCache();
Committed r186005: <http://trac.webkit.org/changeset/186005>