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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 m_didAccessInitialDocumentTimer.stop(); 1020 m_didAccessInitialDocumentTimer.stop();
1021 didAccessInitialDocumentTimerFired(0); 1021 didAccessInitialDocumentTimerFired(0);
1022 } 1022 }
1023 } 1023 }
1024 1024
1025 bool FrameLoader::prepareForCommit() 1025 bool FrameLoader::prepareForCommit()
1026 { 1026 {
1027 PluginScriptForbiddenScope forbidPluginDestructorScripting; 1027 PluginScriptForbiddenScope forbidPluginDestructorScripting;
1028 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; 1028 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
1029 1029
1030 if (m_frame->document()) {
1031 unsigned totalNodeCount = InstanceCounters::counterValue(InstanceCounter s::NodeCounter);
1032 int nodeCount = static_cast<int>(totalNodeCount);
1033 for (Document* document : Document::liveDocumentSet()) {
1034 if (document != m_frame->document())
1035 nodeCount -= document->nodeCount();
1036 }
1037 ASSERT(nodeCount >= 0);
1038 float ratio = static_cast<float>(nodeCount) / totalNodeCount;
1039 if (ThreadState::current()->shouldSchedulePreciseGCOnNavigation(ratio))
1040 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.
1041 }
1042
1030 if (m_documentLoader) { 1043 if (m_documentLoader) {
1031 client()->dispatchWillClose(); 1044 client()->dispatchWillClose();
1032 dispatchUnloadEvent(); 1045 dispatchUnloadEvent();
1033 } 1046 }
1034 m_frame->detachChildren(); 1047 m_frame->detachChildren();
1035 // The previous calls to dispatchUnloadEvent() and detachChildren() can 1048 // The previous calls to dispatchUnloadEvent() and detachChildren() can
1036 // execute arbitrary script via things like unload events. If the executed 1049 // execute arbitrary script via things like unload events. If the executed
1037 // script intiates a new load or causes the current frame to be detached, 1050 // script intiates a new load or causes the current frame to be detached,
1038 // we need to abandon the current load. 1051 // we need to abandon the current load.
1039 if (pdl != m_provisionalDocumentLoader) 1052 if (pdl != m_provisionalDocumentLoader)
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 // FIXME: We need a way to propagate insecure requests policy flags to 1512 // FIXME: We need a way to propagate insecure requests policy flags to
1500 // out-of-process frames. For now, we'll always use default behavior. 1513 // out-of-process frames. For now, we'll always use default behavior.
1501 if (!parentFrame->isLocalFrame()) 1514 if (!parentFrame->isLocalFrame())
1502 return nullptr; 1515 return nullptr;
1503 1516
1504 ASSERT(toLocalFrame(parentFrame)->document()); 1517 ASSERT(toLocalFrame(parentFrame)->document());
1505 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1518 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1506 } 1519 }
1507 1520
1508 } // namespace blink 1521 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698