Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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. Exceptions being navigations initiated by the user. | |
| 1361 if (!m_isNavigationHandledByClient || | |
| 1362 UserGestureIndicator::processingUserGesture()) { | |
|
Nate Chapin
2017/01/19 21:02:59
Is this user gesture check necessary to get the te
ananta
2017/01/19 21:38:08
The user gesture flag is passed via the FrameHostM
Nate Chapin
2017/01/19 23:33:50
Right, I got that. I just don't immediately see wh
ananta
2017/01/20 00:00:33
Based on our discussion, removing this check
| |
| 1363 m_frame->navigationScheduler().cancel(); | |
| 1364 } | |
| 1359 m_frame->editor().clearLastEditCommand(); | 1365 m_frame->editor().clearLastEditCommand(); |
| 1360 | 1366 |
| 1361 // If we are still in the process of initializing an empty document then its | 1367 // 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 | 1368 // frame is not in a consistent state for rendering, so avoid |
| 1363 // setJSStatusBarText since it may cause clients to attempt to render the | 1369 // setJSStatusBarText since it may cause clients to attempt to render the |
| 1364 // frame. | 1370 // frame. |
| 1365 if (!m_stateMachine.creatingInitialEmptyDocument()) { | 1371 if (!m_stateMachine.creatingInitialEmptyDocument()) { |
| 1366 DOMWindow* window = m_frame->domWindow(); | 1372 DOMWindow* window = m_frame->domWindow(); |
| 1367 window->setStatus(String()); | 1373 window->setStatus(String()); |
| 1368 window->setDefaultStatus(String()); | 1374 window->setDefaultStatus(String()); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1677 resourceRequest.setRequestContext( | 1683 resourceRequest.setRequestContext( |
| 1678 determineRequestContextFromNavigationType(navigationType)); | 1684 determineRequestContextFromNavigationType(navigationType)); |
| 1679 resourceRequest.setFrameType(m_frame->isMainFrame() | 1685 resourceRequest.setFrameType(m_frame->isMainFrame() |
| 1680 ? WebURLRequest::FrameTypeTopLevel | 1686 ? WebURLRequest::FrameTypeTopLevel |
| 1681 : WebURLRequest::FrameTypeNested); | 1687 : WebURLRequest::FrameTypeNested); |
| 1682 | 1688 |
| 1683 // Record the latest requiredCSP value that will be used when sending this | 1689 // Record the latest requiredCSP value that will be used when sending this |
| 1684 // request. | 1690 // request. |
| 1685 recordLatestRequiredCSP(); | 1691 recordLatestRequiredCSP(); |
| 1686 modifyRequestForCSP(resourceRequest, nullptr); | 1692 modifyRequestForCSP(resourceRequest, nullptr); |
| 1693 | |
| 1694 bool navigationHandledByClient = m_isNavigationHandledByClient; | |
|
Nate Chapin
2017/01/19 21:02:59
This should be probably have a "was" in the name,
ananta
2017/01/19 21:38:08
Done.
| |
| 1695 | |
| 1687 if (!shouldContinueForNavigationPolicy( | 1696 if (!shouldContinueForNavigationPolicy( |
| 1688 resourceRequest, frameLoadRequest.substituteData(), nullptr, | 1697 resourceRequest, frameLoadRequest.substituteData(), nullptr, |
| 1689 frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), | 1698 frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), |
| 1690 navigationType, navigationPolicy, | 1699 navigationType, navigationPolicy, |
| 1691 type == FrameLoadTypeReplaceCurrentItem, | 1700 type == FrameLoadTypeReplaceCurrentItem, |
| 1692 frameLoadRequest.clientRedirect() == | 1701 frameLoadRequest.clientRedirect() == |
| 1693 ClientRedirectPolicy::ClientRedirect, | 1702 ClientRedirectPolicy::ClientRedirect, |
| 1694 frameLoadRequest.form())) | 1703 frameLoadRequest.form())) |
| 1695 return; | 1704 return; |
| 1696 | 1705 |
| 1697 m_frame->document()->cancelParsing(); | 1706 m_frame->document()->cancelParsing(); |
| 1698 detachDocumentLoader(m_provisionalDocumentLoader); | 1707 detachDocumentLoader(m_provisionalDocumentLoader); |
| 1699 | 1708 |
| 1700 // beforeunload fired above, and detaching a DocumentLoader can fire events, | 1709 // beforeunload fired above, and detaching a DocumentLoader can fire events, |
| 1701 // which can detach this frame. | 1710 // which can detach this frame. |
| 1702 if (!m_frame->host()) | 1711 if (!m_frame->host()) |
| 1703 return; | 1712 return; |
| 1704 | 1713 |
| 1705 m_provisionalDocumentLoader = client()->createDocumentLoader( | 1714 m_provisionalDocumentLoader = client()->createDocumentLoader( |
| 1706 m_frame, resourceRequest, | 1715 m_frame, resourceRequest, |
| 1707 frameLoadRequest.substituteData().isValid() | 1716 frameLoadRequest.substituteData().isValid() |
| 1708 ? frameLoadRequest.substituteData() | 1717 ? frameLoadRequest.substituteData() |
| 1709 : defaultSubstituteDataForURL(resourceRequest.url()), | 1718 : defaultSubstituteDataForURL(resourceRequest.url()), |
| 1710 frameLoadRequest.clientRedirect()); | 1719 frameLoadRequest.clientRedirect()); |
| 1711 m_provisionalDocumentLoader->setNavigationType(navigationType); | 1720 m_provisionalDocumentLoader->setNavigationType(navigationType); |
| 1712 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( | 1721 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( |
| 1713 type == FrameLoadTypeReplaceCurrentItem); | 1722 type == FrameLoadTypeReplaceCurrentItem); |
| 1714 m_frame->navigationScheduler().cancel(); | 1723 |
| 1715 m_checkTimer.stop(); | 1724 // PlzNavigate: We need to ensure that script initiated navigations are |
| 1725 // honored. Exceptions being navigations initiated by the user. | |
| 1726 if (!navigationHandledByClient || | |
| 1727 UserGestureIndicator::processingUserGesture()) { | |
| 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 Loading... | |
| 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 |
| OLD | NEW |