Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1227)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 1252683003: Oilpan: Schedule a precise GC when a page navigates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698