<https://webkit.org/b/129644>
Now that we have Document::allDocuments(), we can jettison all the
style resolvers by walking the set of live documents and calling
clearStyleResolver() on each one, instead of having a function on
Page that walks the frame tree of every living page, etc.
Reviewed by Antti Koivisto.
* page/Page.cpp:
* page/Page.h:
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::releaseMemory):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165629
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-14 Andreas Kling <akling@apple.com>
+
+ Simplify jettisoning of style resolvers on memory pressure.
+ <https://webkit.org/b/129644>
+
+ Now that we have Document::allDocuments(), we can jettison all the
+ style resolvers by walking the set of live documents and calling
+ clearStyleResolver() on each one, instead of having a function on
+ Page that walks the frame tree of every living page, etc.
+
+ Reviewed by Antti Koivisto.
+
+ * page/Page.cpp:
+ * page/Page.h:
+ * platform/mac/MemoryPressureHandlerMac.mm:
+ (WebCore::MemoryPressureHandler::releaseMemory):
+
2014-03-07 Jer Noble <jer.noble@apple.com>
Add Remote Control command support to HTLMediaElement
}
}
-void Page::jettisonStyleResolversInAllDocuments()
-{
- if (!allPages)
- return;
-
- for (auto it = allPages->begin(), end = allPages->end(); it != end; ++it) {
- Page& page = **it;
- for (Frame* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
- if (Document* document = frame->document())
- document->clearStyleResolver();
- }
- }
-}
-
void Page::refreshPlugins(bool reload)
{
if (!allPages)
public:
static void updateStyleForAllPagesAfterGlobalChangeInEnvironment();
- static void jettisonStyleResolversInAllDocuments();
// It is up to the platform to ensure that non-null clients are provided where required.
struct PageClients {
#import "MemoryPressureHandler.h"
#import <WebCore/CSSValuePool.h>
+#import <WebCore/Document.h>
#import <WebCore/GCController.h>
#import <WebCore/FontCache.h>
#import <WebCore/MemoryCache.h>
clearWidthCaches();
- Page::jettisonStyleResolversInAllDocuments();
+ for (auto* document : Document::allDocuments())
+ document->clearStyleResolver();
gcController().discardAllCompiledCode();