Index: Source/core/loader/FrameLoader.cpp |
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
index b81267c0ef5fb128740650103d36f04f08db84c6..98d64ef03883afd3e99427139982f4b08b8a5a57 100644 |
--- a/Source/core/loader/FrameLoader.cpp |
+++ b/Source/core/loader/FrameLoader.cpp |
@@ -1027,6 +1027,19 @@ 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; |
+ if (ThreadState::current()->shouldSchedulePreciseGCOnNavigation(ratio)) |
+ ThreadState::current()->schedulePreciseGC(); |
haraken
2015/08/03 01:03:59
Shall we change the signature to schedulePageNavig
keishi
2015/08/06 06:59:14
Done.
|
+ } |
+ |
if (m_documentLoader) { |
client()->dispatchWillClose(); |
dispatchUnloadEvent(); |