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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1035 int nodeCount = static_cast<int>(totalNodeCount); | 1035 int nodeCount = static_cast<int>(totalNodeCount); |
1036 for (Document* document : Document::liveDocumentSet()) { | 1036 for (Document* document : Document::liveDocumentSet()) { |
1037 if (document != m_frame->document()) | 1037 if (document != m_frame->document()) |
1038 nodeCount -= document->nodeCount(); | 1038 nodeCount -= document->nodeCount(); |
1039 } | 1039 } |
1040 ASSERT(nodeCount >= 0); | 1040 ASSERT(nodeCount >= 0); |
1041 float ratio = static_cast<float>(nodeCount) / totalNodeCount; | 1041 float ratio = static_cast<float>(nodeCount) / totalNodeCount; |
1042 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); | 1042 ThreadState::current()->schedulePageNavigationGCIfNeeded(ratio); |
1043 } | 1043 } |
1044 | 1044 |
1045 // TODO(dcheng): See comment in LocalFrame::detach() about sequencing this | |
1046 // immediately before detachChildren() instead. | |
1047 SubframeLoadingDisabler disabler(m_frame->document()); | |
dcheng
2016/02/03 08:42:17
Here, m_frame->document() might be null during the
| |
1045 if (m_documentLoader) { | 1048 if (m_documentLoader) { |
1046 client()->dispatchWillClose(); | 1049 client()->dispatchWillClose(); |
1047 dispatchUnloadEvent(); | 1050 dispatchUnloadEvent(); |
1048 } | 1051 } |
1049 m_frame->detachChildren(); | 1052 m_frame->detachChildren(); |
1050 // The previous calls to dispatchUnloadEvent() and detachChildren() can | 1053 // The previous calls to dispatchUnloadEvent() and detachChildren() can |
1051 // execute arbitrary script via things like unload events. If the executed | 1054 // execute arbitrary script via things like unload events. If the executed |
1052 // script intiates a new load or causes the current frame to be detached, | 1055 // script intiates a new load or causes the current frame to be detached, |
1053 // we need to abandon the current load. | 1056 // we need to abandon the current load. |
1054 if (pdl != m_provisionalDocumentLoader) | 1057 if (pdl != m_provisionalDocumentLoader) |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1550 // FIXME: We need a way to propagate insecure requests policy flags to | 1553 // FIXME: We need a way to propagate insecure requests policy flags to |
1551 // out-of-process frames. For now, we'll always use default behavior. | 1554 // out-of-process frames. For now, we'll always use default behavior. |
1552 if (!parentFrame->isLocalFrame()) | 1555 if (!parentFrame->isLocalFrame()) |
1553 return nullptr; | 1556 return nullptr; |
1554 | 1557 |
1555 ASSERT(toLocalFrame(parentFrame)->document()); | 1558 ASSERT(toLocalFrame(parentFrame)->document()); |
1556 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; | 1559 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; |
1557 } | 1560 } |
1558 | 1561 |
1559 } // namespace blink | 1562 } // namespace blink |
OLD | NEW |