Index: Source/core/loader/FrameLoader.cpp |
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
index c2f514fc7f1f11f9c3c6f75da1304e5d349d1b0b..4c02c17a436f8595cd3d04dd86edacf805014f63 100644 |
--- a/Source/core/loader/FrameLoader.cpp |
+++ b/Source/core/loader/FrameLoader.cpp |
@@ -1027,6 +1027,18 @@ bool FrameLoader::prepareForCommit() |
PluginScriptForbiddenScope forbidPluginDestructorScripting; |
RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; |
+ if (m_frame->document()) { |
+ unsigned totalNodeCount = InstanceCounters::counterValue(InstanceCounters::NodeCounter); |
+ int nodeCount = static_cast<int>(totalNodeCount); |
+ for (Document* document : Document::liveDocumentSet()) { |
+ if (document != m_frame->document()) |
+ nodeCount -= document->nodeCount(); |
+ } |
+ ASSERT(nodeCount >= 0); |
+ float ratio = static_cast<float>(nodeCount) / totalNodeCount; |
+ ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); |
+ } |
+ |
if (m_documentLoader) { |
client()->dispatchWillClose(); |
dispatchUnloadEvent(); |