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

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

Issue 2589143003: Add 'get' prefix for Settings.in generated code. (Closed)
Patch Set: Capitalize the prefix. Created 4 years 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
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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, 538 ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel,
539 "Error with Suborigin header: " + message)); 539 "Error with Suborigin header: " + message));
540 } 540 }
541 } 541 }
542 m_frame->document()->clientHintsPreferences().updateFrom( 542 m_frame->document()->clientHintsPreferences().updateFrom(
543 m_documentLoader->clientHintsPreferences()); 543 m_documentLoader->clientHintsPreferences());
544 } 544 }
545 545
546 Settings* settings = m_frame->document()->settings(); 546 Settings* settings = m_frame->document()->settings();
547 if (settings) { 547 if (settings) {
548 m_frame->document()->fetcher()->setImagesEnabled(settings->imagesEnabled()); 548 m_frame->document()->fetcher()->setImagesEnabled(
549 settings->GetImagesEnabled());
549 m_frame->document()->fetcher()->setAutoLoadImages( 550 m_frame->document()->fetcher()->setAutoLoadImages(
550 settings->loadsImagesAutomatically()); 551 settings->GetLoadsImagesAutomatically());
551 } 552 }
552 553
553 if (m_documentLoader) { 554 if (m_documentLoader) {
554 const AtomicString& dnsPrefetchControl = 555 const AtomicString& dnsPrefetchControl =
555 m_documentLoader->response().httpHeaderField( 556 m_documentLoader->response().httpHeaderField(
556 HTTPNames::X_DNS_Prefetch_Control); 557 HTTPNames::X_DNS_Prefetch_Control);
557 if (!dnsPrefetchControl.isEmpty()) 558 if (!dnsPrefetchControl.isEmpty())
558 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl); 559 m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl);
559 560
560 String headerContentLanguage = m_documentLoader->response().httpHeaderField( 561 String headerContentLanguage = m_documentLoader->response().httpHeaderField(
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 if (client()) 777 if (client())
777 client()->setOpener(opener); 778 client()->setOpener(opener);
778 } 779 }
779 780
780 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) { 781 bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason) {
781 // With Oilpan, a FrameLoader might be accessed after the FrameHost has been 782 // With Oilpan, a FrameLoader might be accessed after the FrameHost has been
782 // detached. FrameClient will not be accessible, so bail early. 783 // detached. FrameClient will not be accessible, so bail early.
783 if (!client()) 784 if (!client())
784 return false; 785 return false;
785 Settings* settings = m_frame->settings(); 786 Settings* settings = m_frame->settings();
786 bool allowed = client()->allowPlugins(settings && settings->pluginsEnabled()); 787 bool allowed =
788 client()->allowPlugins(settings && settings->GetPluginsEnabled());
787 if (!allowed && reason == AboutToInstantiatePlugin) 789 if (!allowed && reason == AboutToInstantiatePlugin)
788 client()->didNotAllowPlugins(); 790 client()->didNotAllowPlugins();
789 return allowed; 791 return allowed;
790 } 792 }
791 793
792 void FrameLoader::updateForSameDocumentNavigation( 794 void FrameLoader::updateForSameDocumentNavigation(
793 const KURL& newURL, 795 const KURL& newURL,
794 SameDocumentNavigationSource sameDocumentNavigationSource, 796 SameDocumentNavigationSource sameDocumentNavigationSource,
795 PassRefPtr<SerializedScriptValue> data, 797 PassRefPtr<SerializedScriptValue> data,
796 HistoryScrollRestorationType scrollRestorationType, 798 HistoryScrollRestorationType scrollRestorationType,
(...skipping 10 matching lines...) Expand all
807 // we don't fire them for fragment redirection that happens in window.onload 809 // we don't fire them for fragment redirection that happens in window.onload
808 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838 810 // handler. See https://bugs.webkit.org/show_bug.cgi?id=31838
809 // Do not fire the notifications if the frame is concurrently navigating away 811 // Do not fire the notifications if the frame is concurrently navigating away
810 // from the document, since a new document is already loading. 812 // from the document, since a new document is already loading.
811 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader) 813 if (m_frame->document()->loadEventFinished() && !m_provisionalDocumentLoader)
812 client()->didStartLoading(NavigationWithinSameDocument); 814 client()->didStartLoading(NavigationWithinSameDocument);
813 815
814 HistoryCommitType historyCommitType = loadTypeToCommitType(type); 816 HistoryCommitType historyCommitType = loadTypeToCommitType(type);
815 if (!m_currentItem) 817 if (!m_currentItem)
816 historyCommitType = HistoryInertCommit; 818 historyCommitType = HistoryInertCommit;
817 if (m_frame->settings()->historyEntryRequiresUserGesture() && 819 if (m_frame->settings()->GetHistoryEntryRequiresUserGesture() &&
818 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) { 820 initiatingDocument && !initiatingDocument->hasReceivedUserGesture()) {
819 historyCommitType = HistoryInertCommit; 821 historyCommitType = HistoryInertCommit;
820 } 822 }
821 823
822 setHistoryItemStateForCommit( 824 setHistoryItemStateForCommit(
823 type, historyCommitType, 825 type, historyCommitType,
824 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi 826 sameDocumentNavigationSource == SameDocumentNavigationHistoryApi
825 ? HistoryNavigationType::HistoryApi 827 ? HistoryNavigationType::HistoryApi
826 : HistoryNavigationType::Fragment); 828 : HistoryNavigationType::Fragment);
827 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) { 829 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 return request.resourceRequest().httpMethod() == HTTPNames::POST 954 return request.resourceRequest().httpMethod() == HTTPNames::POST
953 ? FrameLoadTypeStandard 955 ? FrameLoadTypeStandard
954 : FrameLoadTypeReplaceCurrentItem; 956 : FrameLoadTypeReplaceCurrentItem;
955 } 957 }
956 958
957 if (request.substituteData().failingURL() == 959 if (request.substituteData().failingURL() ==
958 m_documentLoader->urlForHistory() && 960 m_documentLoader->urlForHistory() &&
959 m_loadType == FrameLoadTypeReload) 961 m_loadType == FrameLoadTypeReload)
960 return FrameLoadTypeReload; 962 return FrameLoadTypeReload;
961 963
962 if (m_frame->settings()->historyEntryRequiresUserGesture() && 964 if (m_frame->settings()->GetHistoryEntryRequiresUserGesture() &&
963 request.originDocument() && 965 request.originDocument() &&
964 !request.originDocument()->hasReceivedUserGesture()) 966 !request.originDocument()->hasReceivedUserGesture())
965 return FrameLoadTypeReplaceCurrentItem; 967 return FrameLoadTypeReplaceCurrentItem;
966 968
967 return FrameLoadTypeStandard; 969 return FrameLoadTypeStandard;
968 } 970 }
969 971
970 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) { 972 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) {
971 // If no origin Document* was specified, skip remaining security checks and 973 // If no origin Document* was specified, skip remaining security checks and
972 // assume the caller has fully initialized the FrameLoadRequest. 974 // assume the caller has fully initialized the FrameLoadRequest.
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 void FrameLoader::runScriptsAtDocumentElementAvailable() { 1812 void FrameLoader::runScriptsAtDocumentElementAvailable() {
1811 client()->runScriptsAtDocumentElementAvailable(); 1813 client()->runScriptsAtDocumentElementAvailable();
1812 // The frame might be detached at this point. 1814 // The frame might be detached at this point.
1813 } 1815 }
1814 1816
1815 void FrameLoader::dispatchDidClearDocumentOfWindowObject() { 1817 void FrameLoader::dispatchDidClearDocumentOfWindowObject() {
1816 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript)) 1818 if (!m_frame->script().canExecuteScripts(NotAboutToExecuteScript))
1817 return; 1819 return;
1818 1820
1819 Settings* settings = m_frame->settings(); 1821 Settings* settings = m_frame->settings();
1820 if (settings && settings->forceMainWorldInitialization()) 1822 if (settings && settings->GetForceMainWorldInitialization())
1821 m_frame->script().initializeMainWorld(); 1823 m_frame->script().initializeMainWorld();
1822 InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame); 1824 InspectorInstrumentation::didClearDocumentOfWindowObject(m_frame);
1823 1825
1824 if (m_dispatchingDidClearWindowObjectInMainWorld) 1826 if (m_dispatchingDidClearWindowObjectInMainWorld)
1825 return; 1827 return;
1826 AutoReset<bool> inDidClearWindowObject( 1828 AutoReset<bool> inDidClearWindowObject(
1827 &m_dispatchingDidClearWindowObjectInMainWorld, true); 1829 &m_dispatchingDidClearWindowObjectInMainWorld, true);
1828 // We just cleared the document, not the entire window object, but for the 1830 // We just cleared the document, not the entire window object, but for the
1829 // embedder that's close enough. 1831 // embedder that's close enough.
1830 client()->dispatchDidClearWindowObjectInMainWorld(); 1832 client()->dispatchDidClearWindowObjectInMainWorld();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 m_documentLoader ? m_documentLoader->url() : String()); 1960 m_documentLoader ? m_documentLoader->url() : String());
1959 return tracedValue; 1961 return tracedValue;
1960 } 1962 }
1961 1963
1962 inline void FrameLoader::takeObjectSnapshot() const { 1964 inline void FrameLoader::takeObjectSnapshot() const {
1963 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1965 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1964 toTracedValue()); 1966 toTracedValue());
1965 } 1967 }
1966 1968
1967 } // namespace blink 1969 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698