Chromium Code Reviews| Index: Source/core/loader/FrameLoader.cpp |
| diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
| index 3d8ab8b84bc46b42a5857b61572df491501f33b4..08ef3abe9caf37373ce569047d37e09b79181a24 100644 |
| --- a/Source/core/loader/FrameLoader.cpp |
| +++ b/Source/core/loader/FrameLoader.cpp |
| @@ -1028,6 +1028,19 @@ bool FrameLoader::prepareForCommit() |
| PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; |
| + if (m_frame->document()) { |
| + unsigned nodeCount = 0; |
| + for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext()) { |
| + if (frame->isLocalFrame()) |
| + nodeCount += m_frame->domWindow()->document()->nodeCount(); |
|
haraken
2015/07/23 23:19:30
If things happen in the order of:
1) User script
|
| + } |
| + float ratio = static_cast<float>(nodeCount) / InstanceCounters::counterValue(InstanceCounters::NodeCounter); |
| + if (ratio > 1) |
|
haraken
2015/07/23 23:19:30
When can this happen?
|
| + ratio = 1; |
| + if (ThreadState::current()->shouldSchedulePreciseGCOnNavigation(ratio)) |
| + ThreadState::current()->schedulePreciseGC(); |
| + } |
| + |
| if (m_documentLoader) { |
| client()->dispatchWillClose(); |
| dispatchUnloadEvent(); |