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

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 1164883002: Ignore attempts to navigate once a provisional commit has gotten too far along. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/very-slow.php ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); 956 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get());
957 957
958 // Check if the destination page is allowed to access the previous page's ti ming information. 958 // Check if the destination page is allowed to access the previous page's ti ming information.
959 if (m_frame->document()) { 959 if (m_frame->document()) {
960 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(pdl->requ est().url()); 960 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::create(pdl->requ est().url());
961 pdl->timing().setHasSameOriginAsPreviousDocument(securityOrigin->canRequ est(m_frame->document()->url())); 961 pdl->timing().setHasSameOriginAsPreviousDocument(securityOrigin->canRequ est(m_frame->document()->url()));
962 } 962 }
963 963
964 if (m_documentLoader) { 964 if (m_documentLoader) {
965 client()->dispatchWillClose(); 965 client()->dispatchWillClose();
966 dispatchUnloadEvent(); 966 dispatchUnloadEvent();
michaeln 2015/06/03 19:43:59 Maybe a separate issue, but An earlier (pdl != m_p
967 } 967 }
968 m_frame->detachChildren(); 968 m_frame->detachChildren();
969 // The previous calls to dispatchUnloadEvent() and detachChildren() can 969 // The previous calls to dispatchUnloadEvent() and detachChildren() can
970 // execute arbitrary script via things like unload events. If the executed 970 // execute arbitrary script via things like unload events. If the executed
971 // script intiates a new load or causes the current frame to be detached, 971 // script intiates a new load or causes the current frame to be detached,
972 // we need to abandon the current load. 972 // we need to abandon the current load.
973 if (pdl != m_provisionalDocumentLoader) 973 if (pdl != m_provisionalDocumentLoader)
974 return; 974 return;
975 if (m_documentLoader) 975
976 if (m_documentLoader) {
977 NavigationDisablerForBeforeUnload navigationDisabler;
michaeln 2015/06/03 00:51:50 I have to rename the class still.
976 m_documentLoader->detachFromFrame(); 978 m_documentLoader->detachFromFrame();
979 }
977 // detachFromFrame() will abort XHRs that haven't completed, which can 980 // detachFromFrame() will abort XHRs that haven't completed, which can
978 // trigger event listeners for 'abort'. These event listeners might detach 981 // trigger event listeners for 'abort'. These event listeners might detach
979 // the frame. 982 // the frame.
980 // TODO(dcheng): Investigate if this can be moved above the check that 983 // TODO(dcheng): Investigate if this can be moved above the check that
981 // m_provisionalDocumentLoader hasn't changed. 984 // m_provisionalDocumentLoader hasn't changed.
982 if (!m_frame->client()) 985 if (!m_frame->client())
983 return; 986 return;
984 // No more events will be dispatched so detach the Document. 987 // No more events will be dispatched so detach the Document.
985 if (m_frame->document()) 988 if (m_frame->document())
986 m_frame->document()->detach(); 989 m_frame->document()->detach();
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 // FIXME: We need a way to propagate insecure requests policy flags to 1436 // FIXME: We need a way to propagate insecure requests policy flags to
1434 // out-of-process frames. For now, we'll always use default behavior. 1437 // out-of-process frames. For now, we'll always use default behavior.
1435 if (!parentFrame->isLocalFrame()) 1438 if (!parentFrame->isLocalFrame())
1436 return nullptr; 1439 return nullptr;
1437 1440
1438 ASSERT(toLocalFrame(parentFrame)->document()); 1441 ASSERT(toLocalFrame(parentFrame)->document());
1439 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1442 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1440 } 1443 }
1441 1444
1442 } // namespace blink 1445 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/navigation/resources/very-slow.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698