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

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

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: 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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 return; 740 return;
741 } 741 }
742 742
743 if (shouldSendCompleteNotification(m_frame, m_isNavigationHandledByClient)) { 743 if (shouldSendCompleteNotification(m_frame, m_isNavigationHandledByClient)) {
744 m_progressTracker->progressCompleted(); 744 m_progressTracker->progressCompleted();
745 // Retry restoring scroll offset since finishing loading disables content 745 // Retry restoring scroll offset since finishing loading disables content
746 // size clamping. 746 // size clamping.
747 restoreScrollPositionAndViewState(); 747 restoreScrollPositionAndViewState();
748 748
749 m_loadType = FrameLoadTypeStandard; 749 m_loadType = FrameLoadTypeStandard;
750 m_frame->localDOMWindow()->finishedLoading(); 750 m_frame->domWindow()->finishedLoading();
751 } 751 }
752 752
753 Frame* parent = m_frame->tree().parent(); 753 Frame* parent = m_frame->tree().parent();
754 if (parent && parent->isLocalFrame()) 754 if (parent && parent->isLocalFrame())
755 toLocalFrame(parent)->loader().checkCompleted(); 755 toLocalFrame(parent)->loader().checkCompleted();
756 } 756 }
757 757
758 void FrameLoader::checkTimerFired(TimerBase*) { 758 void FrameLoader::checkTimerFired(TimerBase*) {
759 if (Page* page = m_frame->page()) { 759 if (Page* page = m_frame->page()) {
760 if (page->suspended()) 760 if (page->suspended())
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 AutoReset<FrameLoadType> loadTypeChange(&m_loadType, frameLoadType); 863 AutoReset<FrameLoadType> loadTypeChange(&m_loadType, frameLoadType);
864 saveScrollState(); 864 saveScrollState();
865 865
866 KURL oldURL = m_frame->document()->url(); 866 KURL oldURL = m_frame->document()->url();
867 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && 867 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) &&
868 url.fragmentIdentifier() != oldURL.fragmentIdentifier(); 868 url.fragmentIdentifier() != oldURL.fragmentIdentifier();
869 if (hashChange) { 869 if (hashChange) {
870 // If we were in the autoscroll/middleClickAutoscroll mode we want to stop 870 // If we were in the autoscroll/middleClickAutoscroll mode we want to stop
871 // it before following the link to the anchor 871 // it before following the link to the anchor
872 m_frame->eventHandler().stopAutoscroll(); 872 m_frame->eventHandler().stopAutoscroll();
873 m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url); 873 m_frame->domWindow()->enqueueHashchangeEvent(oldURL, url);
874 } 874 }
875 m_documentLoader->setIsClientRedirect(clientRedirect == 875 m_documentLoader->setIsClientRedirect(clientRedirect ==
876 ClientRedirectPolicy::ClientRedirect); 876 ClientRedirectPolicy::ClientRedirect);
877 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr, 877 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
878 ScrollRestorationAuto, frameLoadType, 878 ScrollRestorationAuto, frameLoadType,
879 initiatingDocument); 879 initiatingDocument);
880 880
881 m_documentLoader->initialScrollState().wasScrolledByUser = false; 881 m_documentLoader->initialScrollState().wasScrolledByUser = false;
882 882
883 checkCompleted(); 883 checkCompleted();
884 884
885 m_frame->localDOMWindow()->statePopped( 885 m_frame->domWindow()->statePopped(stateObject
886 stateObject ? std::move(stateObject) 886 ? std::move(stateObject)
887 : SerializedScriptValue::nullValue()); 887 : SerializedScriptValue::nullValue());
888 888
889 if (historyLoadType == HistorySameDocumentLoad) 889 if (historyLoadType == HistorySameDocumentLoad)
890 restoreScrollPositionAndViewState(); 890 restoreScrollPositionAndViewState();
891 891
892 // We need to scroll to the fragment whether or not a hash change occurred, 892 // We need to scroll to the fragment whether or not a hash change occurred,
893 // since the user might have scrolled since the previous navigation. 893 // since the user might have scrolled since the previous navigation.
894 processFragment(url, NavigationWithinSameDocument); 894 processFragment(url, NavigationWithinSameDocument);
895 takeObjectSnapshot(); 895 takeObjectSnapshot();
896 } 896 }
897 897
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 m_documentLoader ? m_documentLoader->url() : String()); 1959 m_documentLoader ? m_documentLoader->url() : String());
1960 return tracedValue; 1960 return tracedValue;
1961 } 1961 }
1962 1962
1963 inline void FrameLoader::takeObjectSnapshot() const { 1963 inline void FrameLoader::takeObjectSnapshot() const {
1964 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1964 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1965 toTracedValue()); 1965 toTracedValue());
1966 } 1966 }
1967 1967
1968 } // namespace blink 1968 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698