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

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 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio);
1040 }
1041
1030 if (m_documentLoader) { 1042 if (m_documentLoader) {
1031 client()->dispatchWillClose(); 1043 client()->dispatchWillClose();
1032 dispatchUnloadEvent(); 1044 dispatchUnloadEvent();
1033 } 1045 }
1034 m_frame->detachChildren(); 1046 m_frame->detachChildren();
1035 // The previous calls to dispatchUnloadEvent() and detachChildren() can 1047 // The previous calls to dispatchUnloadEvent() and detachChildren() can
1036 // execute arbitrary script via things like unload events. If the executed 1048 // 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, 1049 // script intiates a new load or causes the current frame to be detached,
1038 // we need to abandon the current load. 1050 // we need to abandon the current load.
1039 if (pdl != m_provisionalDocumentLoader) 1051 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 1511 // 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. 1512 // out-of-process frames. For now, we'll always use default behavior.
1501 if (!parentFrame->isLocalFrame()) 1513 if (!parentFrame->isLocalFrame())
1502 return nullptr; 1514 return nullptr;
1503 1515
1504 ASSERT(toLocalFrame(parentFrame)->document()); 1516 ASSERT(toLocalFrame(parentFrame)->document());
1505 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1517 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1506 } 1518 }
1507 1519
1508 } // namespace blink 1520 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698