| OLD | NEW |
| 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 didAccessInitialDocumentTimerFired(0); | 1037 didAccessInitialDocumentTimerFired(0); |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 bool FrameLoader::prepareForCommit() | 1041 bool FrameLoader::prepareForCommit() |
| 1042 { | 1042 { |
| 1043 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 1043 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
| 1044 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; | 1044 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; |
| 1045 | 1045 |
| 1046 if (m_frame->document()) { | 1046 if (m_frame->document()) { |
| 1047 unsigned nodeCount = 0; |
| 1048 for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext()
) { |
| 1049 if (frame->isLocalFrame()) { |
| 1050 LocalFrame* localFrame = toLocalFrame(frame); |
| 1051 nodeCount += localFrame->document()->nodeCount(); |
| 1052 } |
| 1053 } |
| 1047 unsigned totalNodeCount = InstanceCounters::counterValue(InstanceCounter
s::NodeCounter); | 1054 unsigned totalNodeCount = InstanceCounters::counterValue(InstanceCounter
s::NodeCounter); |
| 1048 int nodeCount = static_cast<int>(totalNodeCount); | |
| 1049 for (Document* document : Document::liveDocumentSet()) { | |
| 1050 if (document != m_frame->document()) | |
| 1051 nodeCount -= document->nodeCount(); | |
| 1052 } | |
| 1053 ASSERT(nodeCount >= 0); | |
| 1054 float ratio = static_cast<float>(nodeCount) / totalNodeCount; | 1055 float ratio = static_cast<float>(nodeCount) / totalNodeCount; |
| 1055 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); | 1056 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); |
| 1056 } | 1057 } |
| 1057 | 1058 |
| 1058 // Don't allow any new child frames to load in this frame: attaching a new | 1059 // Don't allow any new child frames to load in this frame: attaching a new |
| 1059 // child frame during or after detaching children results in an attached | 1060 // child frame during or after detaching children results in an attached |
| 1060 // frame on a detached DOM tree, which is bad. | 1061 // frame on a detached DOM tree, which is bad. |
| 1061 SubframeLoadingDisabler disabler(m_frame->document()); | 1062 SubframeLoadingDisabler disabler(m_frame->document()); |
| 1062 if (m_documentLoader) { | 1063 if (m_documentLoader) { |
| 1063 client()->dispatchWillClose(); | 1064 client()->dispatchWillClose(); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 // FIXME: We need a way to propagate insecure requests policy flags to | 1573 // FIXME: We need a way to propagate insecure requests policy flags to |
| 1573 // out-of-process frames. For now, we'll always use default behavior. | 1574 // out-of-process frames. For now, we'll always use default behavior. |
| 1574 if (!parentFrame->isLocalFrame()) | 1575 if (!parentFrame->isLocalFrame()) |
| 1575 return nullptr; | 1576 return nullptr; |
| 1576 | 1577 |
| 1577 ASSERT(toLocalFrame(parentFrame)->document()); | 1578 ASSERT(toLocalFrame(parentFrame)->document()); |
| 1578 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1579 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
| 1579 } | 1580 } |
| 1580 | 1581 |
| 1581 } // namespace blink | 1582 } // namespace blink |
| OLD | NEW |