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

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

Issue 2630783003: PlzNavigate: Fix the http/tests/security/cross-frame-access-parent-isolated-world.html and http/tes… (Closed)
Patch Set: Rebased to tip Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 WebEventListenerClass::TouchStartOrMove, 1348 WebEventListenerClass::TouchStartOrMove,
1349 WebEventListenerProperties::Nothing); 1349 WebEventListenerProperties::Nothing);
1350 m_frame->page()->chromeClient().setEventListenerProperties( 1350 m_frame->page()->chromeClient().setEventListenerProperties(
1351 WebEventListenerClass::MouseWheel, WebEventListenerProperties::Nothing); 1351 WebEventListenerClass::MouseWheel, WebEventListenerProperties::Nothing);
1352 m_frame->page()->chromeClient().setEventListenerProperties( 1352 m_frame->page()->chromeClient().setEventListenerProperties(
1353 WebEventListenerClass::TouchEndOrCancel, 1353 WebEventListenerClass::TouchEndOrCancel,
1354 WebEventListenerProperties::Nothing); 1354 WebEventListenerProperties::Nothing);
1355 } 1355 }
1356 1356
1357 client()->transitionToCommittedForNewPage(); 1357 client()->transitionToCommittedForNewPage();
1358 m_frame->navigationScheduler().cancel(); 1358
1359 // PlzNavigate: We need to ensure that script initiated navigations are
1360 // honored.
1361 if (!m_isNavigationHandledByClient)
1362 m_frame->navigationScheduler().cancel();
1363
1359 m_frame->editor().clearLastEditCommand(); 1364 m_frame->editor().clearLastEditCommand();
1360 1365
1361 // If we are still in the process of initializing an empty document then its 1366 // If we are still in the process of initializing an empty document then its
1362 // frame is not in a consistent state for rendering, so avoid 1367 // frame is not in a consistent state for rendering, so avoid
1363 // setJSStatusBarText since it may cause clients to attempt to render the 1368 // setJSStatusBarText since it may cause clients to attempt to render the
1364 // frame. 1369 // frame.
1365 if (!m_stateMachine.creatingInitialEmptyDocument()) { 1370 if (!m_stateMachine.creatingInitialEmptyDocument()) {
1366 DOMWindow* window = m_frame->domWindow(); 1371 DOMWindow* window = m_frame->domWindow();
1367 window->setStatus(String()); 1372 window->setStatus(String());
1368 window->setDefaultStatus(String()); 1373 window->setDefaultStatus(String());
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 resourceRequest.setRequestContext( 1682 resourceRequest.setRequestContext(
1678 determineRequestContextFromNavigationType(navigationType)); 1683 determineRequestContextFromNavigationType(navigationType));
1679 resourceRequest.setFrameType(m_frame->isMainFrame() 1684 resourceRequest.setFrameType(m_frame->isMainFrame()
1680 ? WebURLRequest::FrameTypeTopLevel 1685 ? WebURLRequest::FrameTypeTopLevel
1681 : WebURLRequest::FrameTypeNested); 1686 : WebURLRequest::FrameTypeNested);
1682 1687
1683 // Record the latest requiredCSP value that will be used when sending this 1688 // Record the latest requiredCSP value that will be used when sending this
1684 // request. 1689 // request.
1685 recordLatestRequiredCSP(); 1690 recordLatestRequiredCSP();
1686 modifyRequestForCSP(resourceRequest, nullptr); 1691 modifyRequestForCSP(resourceRequest, nullptr);
1692
1693 // We remember this flag here because shouldContinueForNavigationPolicy()
1694 // resets it.
1695 bool navigationWasHandledByClient = m_isNavigationHandledByClient;
1696
1687 if (!shouldContinueForNavigationPolicy( 1697 if (!shouldContinueForNavigationPolicy(
1688 resourceRequest, frameLoadRequest.substituteData(), nullptr, 1698 resourceRequest, frameLoadRequest.substituteData(), nullptr,
1689 frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), 1699 frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(),
1690 navigationType, navigationPolicy, 1700 navigationType, navigationPolicy,
1691 type == FrameLoadTypeReplaceCurrentItem, 1701 type == FrameLoadTypeReplaceCurrentItem,
1692 frameLoadRequest.clientRedirect() == 1702 frameLoadRequest.clientRedirect() ==
1693 ClientRedirectPolicy::ClientRedirect, 1703 ClientRedirectPolicy::ClientRedirect,
1694 frameLoadRequest.form())) 1704 frameLoadRequest.form()))
1695 return; 1705 return;
1696 1706
1697 m_frame->document()->cancelParsing(); 1707 m_frame->document()->cancelParsing();
1698 detachDocumentLoader(m_provisionalDocumentLoader); 1708 detachDocumentLoader(m_provisionalDocumentLoader);
1699 1709
1700 // beforeunload fired above, and detaching a DocumentLoader can fire events, 1710 // beforeunload fired above, and detaching a DocumentLoader can fire events,
1701 // which can detach this frame. 1711 // which can detach this frame.
1702 if (!m_frame->host()) 1712 if (!m_frame->host())
1703 return; 1713 return;
1704 1714
1705 m_provisionalDocumentLoader = client()->createDocumentLoader( 1715 m_provisionalDocumentLoader = client()->createDocumentLoader(
1706 m_frame, resourceRequest, 1716 m_frame, resourceRequest,
1707 frameLoadRequest.substituteData().isValid() 1717 frameLoadRequest.substituteData().isValid()
1708 ? frameLoadRequest.substituteData() 1718 ? frameLoadRequest.substituteData()
1709 : defaultSubstituteDataForURL(resourceRequest.url()), 1719 : defaultSubstituteDataForURL(resourceRequest.url()),
1710 frameLoadRequest.clientRedirect()); 1720 frameLoadRequest.clientRedirect());
1711 m_provisionalDocumentLoader->setNavigationType(navigationType); 1721 m_provisionalDocumentLoader->setNavigationType(navigationType);
1712 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( 1722 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem(
1713 type == FrameLoadTypeReplaceCurrentItem); 1723 type == FrameLoadTypeReplaceCurrentItem);
1714 m_frame->navigationScheduler().cancel(); 1724
1715 m_checkTimer.stop(); 1725 // PlzNavigate: We need to ensure that script initiated navigations are
1726 // honored.
1727 if (!navigationWasHandledByClient) {
1728 m_frame->navigationScheduler().cancel();
1729 m_checkTimer.stop();
1730 }
1716 1731
1717 m_loadType = type; 1732 m_loadType = type;
1718 1733
1719 if (frameLoadRequest.form()) 1734 if (frameLoadRequest.form())
1720 client()->dispatchWillSubmitForm(frameLoadRequest.form()); 1735 client()->dispatchWillSubmitForm(frameLoadRequest.form());
1721 1736
1722 m_progressTracker->progressStarted(); 1737 m_progressTracker->progressStarted();
1723 m_provisionalDocumentLoader->appendRedirect( 1738 m_provisionalDocumentLoader->appendRedirect(
1724 m_provisionalDocumentLoader->getRequest().url()); 1739 m_provisionalDocumentLoader->getRequest().url());
1725 client()->dispatchDidStartProvisionalLoad(); 1740 client()->dispatchDidStartProvisionalLoad();
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 m_documentLoader ? m_documentLoader->url() : String()); 1921 m_documentLoader ? m_documentLoader->url() : String());
1907 return tracedValue; 1922 return tracedValue;
1908 } 1923 }
1909 1924
1910 inline void FrameLoader::takeObjectSnapshot() const { 1925 inline void FrameLoader::takeObjectSnapshot() const {
1911 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1926 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1912 toTracedValue()); 1927 toTracedValue());
1913 } 1928 }
1914 1929
1915 } // namespace blink 1930 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698