| 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 if (m_provisionalDocumentLoader && request.substituteData().failingURL() ==
m_provisionalDocumentLoader->url() && m_loadType == FrameLoadTypeBackForward) | 728 if (m_provisionalDocumentLoader && request.substituteData().failingURL() ==
m_provisionalDocumentLoader->url() && m_loadType == FrameLoadTypeBackForward) |
| 729 return FrameLoadTypeBackForward; | 729 return FrameLoadTypeBackForward; |
| 730 if (request.resourceRequest().cachePolicy() == ReloadIgnoringCacheData) | 730 if (request.resourceRequest().cachePolicy() == ReloadIgnoringCacheData) |
| 731 return FrameLoadTypeReload; | 731 return FrameLoadTypeReload; |
| 732 if (request.resourceRequest().cachePolicy() == ReloadBypassingCache) | 732 if (request.resourceRequest().cachePolicy() == ReloadBypassingCache) |
| 733 return FrameLoadTypeReloadFromOrigin; | 733 return FrameLoadTypeReloadFromOrigin; |
| 734 // From the HTML5 spec for location.assign(): | 734 // From the HTML5 spec for location.assign(): |
| 735 // "If the browsing context's session history contains only one Document, | 735 // "If the browsing context's session history contains only one Document, |
| 736 // and that was the about:blank Document created when the browsing context | 736 // and that was the about:blank Document created when the browsing context |
| 737 // was created, then the navigation must be done with replacement enabled.
" | 737 // was created, then the navigation must be done with replacement enabled.
" |
| 738 if (request.lockBackForwardList() | 738 if (request.replacesCurrentItem() |
| 739 || (!m_stateMachine.committedMultipleRealLoads() | 739 || (!m_stateMachine.committedMultipleRealLoads() |
| 740 && equalIgnoringCase(m_frame->document()->url(), blankURL()))) | 740 && equalIgnoringCase(m_frame->document()->url(), blankURL()))) |
| 741 return FrameLoadTypeRedirectWithLockedBackForwardList; | 741 return FrameLoadTypeReplaceCurrentItem; |
| 742 if (!request.originDocument() && request.resourceRequest().url() == m_docume
ntLoader->urlForHistory()) | 742 if (!request.originDocument() && request.resourceRequest().url() == m_docume
ntLoader->urlForHistory()) |
| 743 return FrameLoadTypeSame; | 743 return FrameLoadTypeSame; |
| 744 if (request.substituteData().failingURL() == m_documentLoader->urlForHistory
() && m_loadType == FrameLoadTypeReload) | 744 if (request.substituteData().failingURL() == m_documentLoader->urlForHistory
() && m_loadType == FrameLoadTypeReload) |
| 745 return FrameLoadTypeReload; | 745 return FrameLoadTypeReload; |
| 746 return FrameLoadTypeStandard; | 746 return FrameLoadTypeStandard; |
| 747 } | 747 } |
| 748 | 748 |
| 749 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) | 749 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) |
| 750 { | 750 { |
| 751 // If no origin Document* was specified, skip remaining security checks and
assume the caller has fully initialized the FrameLoadRequest. | 751 // If no origin Document* was specified, skip remaining security checks and
assume the caller has fully initialized the FrameLoadRequest. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 // Perform same document navigation. | 900 // Perform same document navigation. |
| 901 if (sameDocumentHistoryNavigation || sameDocumentNavigation) { | 901 if (sameDocumentHistoryNavigation || sameDocumentNavigation) { |
| 902 ASSERT(historyItem || !sameDocumentHistoryNavigation); | 902 ASSERT(historyItem || !sameDocumentHistoryNavigation); |
| 903 RefPtr<SerializedScriptValue> stateObject = sameDocumentHistoryNavigatio
n ? | 903 RefPtr<SerializedScriptValue> stateObject = sameDocumentHistoryNavigatio
n ? |
| 904 historyItem->stateObject() : nullptr; | 904 historyItem->stateObject() : nullptr; |
| 905 | 905 |
| 906 if (!sameDocumentHistoryNavigation) { | 906 if (!sameDocumentHistoryNavigation) { |
| 907 m_documentLoader->setNavigationType(determineNavigationType( | 907 m_documentLoader->setNavigationType(determineNavigationType( |
| 908 newLoadType, false, request.triggeringEvent())); | 908 newLoadType, false, request.triggeringEvent())); |
| 909 if (shouldTreatURLAsSameAsCurrent(url)) | 909 if (shouldTreatURLAsSameAsCurrent(url)) |
| 910 newLoadType = FrameLoadTypeRedirectWithLockedBackForwardList; | 910 newLoadType = FrameLoadTypeReplaceCurrentItem; |
| 911 } | 911 } |
| 912 | 912 |
| 913 loadInSameDocument(url, stateObject, newLoadType, request.clientRedirect
()); | 913 loadInSameDocument(url, stateObject, newLoadType, request.clientRedirect
()); |
| 914 | 914 |
| 915 if (sameDocumentHistoryNavigation) | 915 if (sameDocumentHistoryNavigation) |
| 916 restoreScrollPositionAndViewState(); | 916 restoreScrollPositionAndViewState(); |
| 917 return; | 917 return; |
| 918 } | 918 } |
| 919 | 919 |
| 920 // Perform navigation to a different document. | 920 // Perform navigation to a different document. |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 if (m_frame->document()->pageDismissalEventBeingDispatched() != Document::No
Dismissal) | 1285 if (m_frame->document()->pageDismissalEventBeingDispatched() != Document::No
Dismissal) |
| 1286 return; | 1286 return; |
| 1287 | 1287 |
| 1288 NavigationType navigationType = determineNavigationType(type, frameLoadReque
st.resourceRequest().httpBody() || frameLoadRequest.form(), frameLoadRequest.tri
ggeringEvent()); | 1288 NavigationType navigationType = determineNavigationType(type, frameLoadReque
st.resourceRequest().httpBody() || frameLoadRequest.form(), frameLoadRequest.tri
ggeringEvent()); |
| 1289 frameLoadRequest.resourceRequest().setRequestContext(determineRequestContext
FromNavigationType(navigationType)); | 1289 frameLoadRequest.resourceRequest().setRequestContext(determineRequestContext
FromNavigationType(navigationType)); |
| 1290 frameLoadRequest.resourceRequest().setFrameType(m_frame->isMainFrame() ? Web
URLRequest::FrameTypeTopLevel : WebURLRequest::FrameTypeNested); | 1290 frameLoadRequest.resourceRequest().setFrameType(m_frame->isMainFrame() ? Web
URLRequest::FrameTypeTopLevel : WebURLRequest::FrameTypeNested); |
| 1291 ResourceRequest& request = frameLoadRequest.resourceRequest(); | 1291 ResourceRequest& request = frameLoadRequest.resourceRequest(); |
| 1292 | 1292 |
| 1293 m_policyDocumentLoader = client()->createDocumentLoader(m_frame, request, fr
ameLoadRequest.substituteData().isValid() ? frameLoadRequest.substituteData() :
defaultSubstituteDataForURL(request.url())); | 1293 m_policyDocumentLoader = client()->createDocumentLoader(m_frame, request, fr
ameLoadRequest.substituteData().isValid() ? frameLoadRequest.substituteData() :
defaultSubstituteDataForURL(request.url())); |
| 1294 m_policyDocumentLoader->setNavigationType(navigationType); | 1294 m_policyDocumentLoader->setNavigationType(navigationType); |
| 1295 m_policyDocumentLoader->setReplacesCurrentHistoryItem(type == FrameLoadTypeR
edirectWithLockedBackForwardList); | 1295 m_policyDocumentLoader->setReplacesCurrentHistoryItem(type == FrameLoadTypeR
eplaceCurrentItem); |
| 1296 m_policyDocumentLoader->setIsClientRedirect(frameLoadRequest.clientRedirect(
) == ClientRedirect); | 1296 m_policyDocumentLoader->setIsClientRedirect(frameLoadRequest.clientRedirect(
) == ClientRedirect); |
| 1297 | 1297 |
| 1298 // stopAllLoaders can detach the LocalFrame, so protect it. | 1298 // stopAllLoaders can detach the LocalFrame, so protect it. |
| 1299 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 1299 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
| 1300 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request, fra
meLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationPolicy) ||
!shouldClose()) && m_policyDocumentLoader) { | 1300 if ((!m_policyDocumentLoader->shouldContinueForNavigationPolicy(request, fra
meLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationPolicy) ||
!shouldClose()) && m_policyDocumentLoader) { |
| 1301 detachDocumentLoader(m_policyDocumentLoader); | 1301 detachDocumentLoader(m_policyDocumentLoader); |
| 1302 return; | 1302 return; |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 // FIXME: This is an odd set of steps to shut down parsing and it's unclear
why it works. | 1305 // FIXME: This is an odd set of steps to shut down parsing and it's unclear
why it works. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 // FIXME: We need a way to propagate insecure requests policy flags to | 1494 // 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. | 1495 // out-of-process frames. For now, we'll always use default behavior. |
| 1496 if (!parentFrame->isLocalFrame()) | 1496 if (!parentFrame->isLocalFrame()) |
| 1497 return nullptr; | 1497 return nullptr; |
| 1498 | 1498 |
| 1499 ASSERT(toLocalFrame(parentFrame)->document()); | 1499 ASSERT(toLocalFrame(parentFrame)->document()); |
| 1500 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1500 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 } // namespace blink | 1503 } // namespace blink |
| OLD | NEW |