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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 } | 1016 } |
1017 | 1017 |
1018 void FrameLoader::notifyIfInitialDocumentAccessed() | 1018 void FrameLoader::notifyIfInitialDocumentAccessed() |
1019 { | 1019 { |
1020 if (m_didAccessInitialDocumentTimer.isActive()) { | 1020 if (m_didAccessInitialDocumentTimer.isActive()) { |
1021 m_didAccessInitialDocumentTimer.stop(); | 1021 m_didAccessInitialDocumentTimer.stop(); |
1022 didAccessInitialDocumentTimerFired(0); | 1022 didAccessInitialDocumentTimerFired(0); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 | 1025 |
1026 bool FrameLoader::prepareForCommit() | 1026 bool FrameLoader::prepareForCommit() |
haraken
2015/07/23 23:19:30
Just a question: When will prepareForCommit() be c
| |
1027 { | 1027 { |
1028 PluginScriptForbiddenScope forbidPluginDestructorScripting; | 1028 PluginScriptForbiddenScope forbidPluginDestructorScripting; |
1029 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; | 1029 RefPtrWillBeRawPtr<DocumentLoader> pdl = m_provisionalDocumentLoader; |
1030 | 1030 |
1031 if (m_frame->document()) { | |
1032 unsigned nodeCount = 0; | |
1033 for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext() ) { | |
1034 if (frame->isLocalFrame()) | |
1035 nodeCount += m_frame->domWindow()->document()->nodeCount(); | |
haraken
2015/07/23 23:19:30
If things happen in the order of:
1) User script
| |
1036 } | |
1037 float ratio = static_cast<float>(nodeCount) / InstanceCounters::counterV alue(InstanceCounters::NodeCounter); | |
1038 if (ratio > 1) | |
haraken
2015/07/23 23:19:30
When can this happen?
| |
1039 ratio = 1; | |
1040 if (ThreadState::current()->shouldSchedulePreciseGCOnNavigation(ratio)) | |
1041 ThreadState::current()->schedulePreciseGC(); | |
1042 } | |
1043 | |
1031 if (m_documentLoader) { | 1044 if (m_documentLoader) { |
1032 client()->dispatchWillClose(); | 1045 client()->dispatchWillClose(); |
1033 dispatchUnloadEvent(); | 1046 dispatchUnloadEvent(); |
1034 } | 1047 } |
1035 m_frame->detachChildren(); | 1048 m_frame->detachChildren(); |
1036 // The previous calls to dispatchUnloadEvent() and detachChildren() can | 1049 // The previous calls to dispatchUnloadEvent() and detachChildren() can |
1037 // execute arbitrary script via things like unload events. If the executed | 1050 // execute arbitrary script via things like unload events. If the executed |
1038 // script intiates a new load or causes the current frame to be detached, | 1051 // script intiates a new load or causes the current frame to be detached, |
1039 // we need to abandon the current load. | 1052 // we need to abandon the current load. |
1040 if (pdl != m_provisionalDocumentLoader) | 1053 if (pdl != m_provisionalDocumentLoader) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1494 // FIXME: We need a way to propagate insecure requests policy flags to | 1507 // FIXME: We need a way to propagate insecure requests policy flags to |
1495 // out-of-process frames. For now, we'll always use default behavior. | 1508 // out-of-process frames. For now, we'll always use default behavior. |
1496 if (!parentFrame->isLocalFrame()) | 1509 if (!parentFrame->isLocalFrame()) |
1497 return nullptr; | 1510 return nullptr; |
1498 | 1511 |
1499 ASSERT(toLocalFrame(parentFrame)->document()); | 1512 ASSERT(toLocalFrame(parentFrame)->document()); |
1500 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; | 1513 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; |
1501 } | 1514 } |
1502 | 1515 |
1503 } // namespace blink | 1516 } // namespace blink |
OLD | NEW |