| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, | 542 ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, |
| 543 "Error with Suborigin header: " + message)); | 543 "Error with Suborigin header: " + message)); |
| 544 } | 544 } |
| 545 } | 545 } |
| 546 m_frame->document()->clientHintsPreferences().updateFrom( | 546 m_frame->document()->clientHintsPreferences().updateFrom( |
| 547 m_documentLoader->clientHintsPreferences()); | 547 m_documentLoader->clientHintsPreferences()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 Settings* settings = m_frame->document()->settings(); | 550 Settings* settings = m_frame->document()->settings(); |
| 551 if (settings) { | 551 if (settings) { |
| 552 m_frame->document()->fetcher()->setImagesEnabled(settings->imagesEnabled()); | 552 m_frame->document()->fetcher()->setImagesEnabled( |
| 553 settings->getImagesEnabled()); |
| 553 m_frame->document()->fetcher()->setAutoLoadImages( | 554 m_frame->document()->fetcher()->setAutoLoadImages( |
| 554 settings->loadsImagesAutomatically()); | 555 settings->getLoadsImagesAutomatically()); |
| 555 } | 556 } |
| 556 | 557 |
| 557 if (m_documentLoader) { | 558 if (m_documentLoader) { |
| 558 const AtomicString& dnsPrefetchControl = | 559 const AtomicString& dnsPrefetchControl = |
| 559 m_documentLoader->response().httpHeaderField( | 560 m_documentLoader->response().httpHeaderField( |
| 560 HTTPNames::X_DNS_Prefetch_Control); | 561 HTTPNames::X_DNS_Prefetch_Control); |
| 561 if (!dnsPrefetchControl.isEmpty()) | 562 if (!dnsPrefetchControl.isEmpty()) |
| 562 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl); | 563 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl); |
| 563 | 564 |
| 564 String headerContentLanguage = m_documentLoader->response().httpHeaderField( | 565 String headerContentLanguage = m_documentLoader->response().httpHeaderField( |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 if (client()) | 776 if (client()) |
| 776 client()->setOpener(opener); | 777 client()->setOpener(opener); |
| 777 } | 778 } |
| 778 | 779 |
| 779 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) { | 780 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) { |
| 780 // With Oilpan, a FrameLoader might be accessed after the FrameHost has been | 781 // With Oilpan, a FrameLoader might be accessed after the FrameHost has been |
| 781 // detached. FrameClient will not be accessible, so bail early. | 782 // detached. FrameClient will not be accessible, so bail early. |
| 782 if (!client()) | 783 if (!client()) |
| 783 return false; | 784 return false; |
| 784 Settings* settings = m_frame->settings(); | 785 Settings* settings = m_frame->settings(); |
| 785 bool allowed = client()->allowPlugins(settings && settings->pluginsEnabled()); | 786 bool allowed = |
| 787 client()->allowPlugins(settings && settings->getPluginsEnabled()); |
| 786 if (!allowed && reason == AboutToInstantiatePlugin) | 788 if (!allowed && reason == AboutToInstantiatePlugin) |
| 787 client()->didNotAllowPlugins(); | 789 client()->didNotAllowPlugins(); |
| 788 return allowed; | 790 return allowed; |
| 789 } | 791 } |
| 790 | 792 |
| 791 void FrameLoader::updateForSameDocumentNavigation( | 793 void FrameLoader::updateForSameDocumentNavigation( |
| 792 const KURL& newURL, | 794 const KURL& newURL, |
| 793 SameDocumentNavigationSource sameDocumentNavigationSource, | 795 SameDocumentNavigationSource sameDocumentNavigationSource, |
| 794 PassRefPtr<SerializedScriptValue> data, | 796 PassRefPtr<SerializedScriptValue> data, |
| 795 HistoryScrollRestorationType scrollRestorationType, | 797 HistoryScrollRestorationType scrollRestorationType, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 806 // we don't fire them for fragment redirection that happens in window.onload | 808 // we don't fire them for fragment redirection that happens in window.onload |
| 807 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838 | 809 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838 |
| 808 // Do not fire the notifications if the frame is concurrently navigating away | 810 // Do not fire the notifications if the frame is concurrently navigating away |
| 809 // from the document, since a new document is already loading. | 811 // from the document, since a new document is already loading. |
| 810 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader) | 812 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader) |
| 811 client()->didStartLoading(NavigationWithinSameDocument); | 813 client()->didStartLoading(NavigationWithinSameDocument); |
| 812 | 814 |
| 813 HistoryCommitType historyCommitType = loadTypeToCommitType(type); | 815 HistoryCommitType historyCommitType = loadTypeToCommitType(type); |
| 814 if (!m_currentItem) | 816 if (!m_currentItem) |
| 815 historyCommitType = HistoryInertCommit; | 817 historyCommitType = HistoryInertCommit; |
| 816 if (m_frame->settings()->historyEntryRequiresUserGesture() && | 818 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() && |
| 817 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) { | 819 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) { |
| 818 historyCommitType = HistoryInertCommit; | 820 historyCommitType = HistoryInertCommit; |
| 819 } | 821 } |
| 820 | 822 |
| 821 setHistoryItemStateForCommit( | 823 setHistoryItemStateForCommit( |
| 822 type, historyCommitType, | 824 type, historyCommitType, |
| 823 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi | 825 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi |
| 824 ? HistoryNavigationType::HistoryApi | 826 ? HistoryNavigationType::HistoryApi |
| 825 : HistoryNavigationType::Fragment); | 827 : HistoryNavigationType::Fragment); |
| 826 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) { | 828 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 return request.resourceRequest().httpMethod() == HTTPNames::POST | 953 return request.resourceRequest().httpMethod() == HTTPNames::POST |
| 952 ? FrameLoadTypeStandard | 954 ? FrameLoadTypeStandard |
| 953 : FrameLoadTypeReplaceCurrentItem; | 955 : FrameLoadTypeReplaceCurrentItem; |
| 954 } | 956 } |
| 955 | 957 |
| 956 if (request.substituteData().failingURL() == | 958 if (request.substituteData().failingURL() == |
| 957 m_documentLoader->urlForHistory() && | 959 m_documentLoader->urlForHistory() && |
| 958 m_loadType == FrameLoadTypeReload) | 960 m_loadType == FrameLoadTypeReload) |
| 959 return FrameLoadTypeReload; | 961 return FrameLoadTypeReload; |
| 960 | 962 |
| 961 if (m_frame->settings()->historyEntryRequiresUserGesture() && | 963 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() && |
| 962 request.originDocument() && | 964 request.originDocument() && |
| 963 !request.originDocument()->hasReceivedUserGesture()) | 965 !request.originDocument()->hasReceivedUserGesture()) |
| 964 return FrameLoadTypeReplaceCurrentItem; | 966 return FrameLoadTypeReplaceCurrentItem; |
| 965 | 967 |
| 966 return FrameLoadTypeStandard; | 968 return FrameLoadTypeStandard; |
| 967 } | 969 } |
| 968 | 970 |
| 969 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) { | 971 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) { |
| 970 // If no origin Document* was specified, skip remaining security checks and | 972 // If no origin Document* was specified, skip remaining security checks and |
| 971 // assume the caller has fully initialized the FrameLoadRequest. | 973 // assume the caller has fully initialized the FrameLoadRequest. |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1744 void FrameLoader::runScriptsAtDocumentElementAvailable() { | 1746 void FrameLoader::runScriptsAtDocumentElementAvailable() { |
| 1745 client()->runScriptsAtDocumentElementAvailable(); | 1747 client()->runScriptsAtDocumentElementAvailable(); |
| 1746 // The frame might be detached at this point. | 1748 // The frame might be detached at this point. |
| 1747 } | 1749 } |
| 1748 | 1750 |
| 1749 void FrameLoader::dispatchDidClearDocumentOfWindowObject() { | 1751 void FrameLoader::dispatchDidClearDocumentOfWindowObject() { |
| 1750 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript)) | 1752 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript)) |
| 1751 return; | 1753 return; |
| 1752 | 1754 |
| 1753 Settings* settings = m_frame->settings(); | 1755 Settings* settings = m_frame->settings(); |
| 1754 if (settings && settings->forceMainWorldInitialization()) | 1756 if (settings && settings->getForceMainWorldInitialization()) |
| 1755 m_frame->script().initializeMainWorld(); | 1757 m_frame->script().initializeMainWorld(); |
| 1756 InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame); | 1758 InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame); |
| 1757 | 1759 |
| 1758 if (m_dispatchingDidClearWindowObjectInMainWorld) | 1760 if (m_dispatchingDidClearWindowObjectInMainWorld) |
| 1759 return; | 1761 return; |
| 1760 AutoReset<bool> inDidClearWindowObject( | 1762 AutoReset<bool> inDidClearWindowObject( |
| 1761 &m_dispatchingDidClearWindowObjectInMainWorld, true); | 1763 &m_dispatchingDidClearWindowObjectInMainWorld, true); |
| 1762 // We just cleared the document, not the entire window object, but for the | 1764 // We just cleared the document, not the entire window object, but for the |
| 1763 // embedder that's close enough. | 1765 // embedder that's close enough. |
| 1764 client()->dispatchDidClearWindowObjectInMainWorld(); | 1766 client()->dispatchDidClearWindowObjectInMainWorld(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 m_documentLoader ? m_documentLoader->url() : String()); | 1894 m_documentLoader ? m_documentLoader->url() : String()); |
| 1893 return tracedValue; | 1895 return tracedValue; |
| 1894 } | 1896 } |
| 1895 | 1897 |
| 1896 inline void FrameLoader::takeObjectSnapshot() const { | 1898 inline void FrameLoader::takeObjectSnapshot() const { |
| 1897 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, | 1899 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, |
| 1898 toTracedValue()); | 1900 toTracedValue()); |
| 1899 } | 1901 } |
| 1900 | 1902 |
| 1901 } // namespace blink | 1903 } // namespace blink |
| OLD | NEW |