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

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

Issue 18110006: Remove our logic to handle stopping a load inside startProvisionaLoad callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 RefPtr<HistoryItem> currentItem = history()->currentItem(); 958 RefPtr<HistoryItem> currentItem = history()->currentItem();
959 if (!currentItem) { 959 if (!currentItem) {
960 insertDummyHistoryItem(); 960 insertDummyHistoryItem();
961 961
962 ASSERT(stateMachine()->isDisplayingInitialEmptyDocument()); 962 ASSERT(stateMachine()->isDisplayingInitialEmptyDocument());
963 stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmpt yDocumentPostCommit); 963 stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmpt yDocumentPostCommit);
964 stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoa d); 964 stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoa d);
965 } 965 }
966 } 966 }
967 967
968 void FrameLoader::prepareForLoadStart()
969 {
970 m_progressTracker->progressStarted();
971 m_client->dispatchDidStartProvisionalLoad();
972
973 // Notify accessibility.
974 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) {
975 AXObjectCache::AXLoadingEvent loadingEvent = loadType() == FrameLoadType Reload ? AXObjectCache::AXLoadingReloaded : AXObjectCache::AXLoadingStarted;
976 cache->frameLoadingEventNotification(m_frame, loadingEvent);
977 }
978 }
979
980 void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockBac kForwardList, 968 void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockBac kForwardList,
981 PassRefPtr<Event> event, PassRefPtr<FormState> formState, ShouldSendReferrer shouldSendReferrer) 969 PassRefPtr<Event> event, PassRefPtr<FormState> formState, ShouldSendReferrer shouldSendReferrer)
982 { 970 {
983 // Protect frame from getting blown away inside dispatchBeforeLoadEvent in l oadWithDocumentLoader. 971 // Protect frame from getting blown away inside dispatchBeforeLoadEvent in l oadWithDocumentLoader.
984 RefPtr<Frame> protect(m_frame); 972 RefPtr<Frame> protect(m_frame);
985 973
986 KURL url = request.resourceRequest().url(); 974 KURL url = request.resourceRequest().url();
987 975
988 ASSERT(m_frame->document()); 976 ASSERT(m_frame->document());
989 if (!request.requester()->canDisplay(url)) { 977 if (!request.requester()->canDisplay(url)) {
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2104 2092
2105 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); 2093 setProvisionalDocumentLoader(m_policyDocumentLoader.get());
2106 m_loadType = type; 2094 m_loadType = type;
2107 setState(FrameStateProvisional); 2095 setState(FrameStateProvisional);
2108 2096
2109 setPolicyDocumentLoader(0); 2097 setPolicyDocumentLoader(0);
2110 2098
2111 if (formState) 2099 if (formState)
2112 m_client->dispatchWillSubmitForm(formState); 2100 m_client->dispatchWillSubmitForm(formState);
2113 2101
2114 prepareForLoadStart(); 2102 m_progressTracker->progressStarted();
2103 m_client->dispatchDidStartProvisionalLoad();
2104 ASSERT(m_policyDocumentLoader);
2115 2105
2116 // The load might be cancelled inside of prepareForLoadStart(), nulling out the m_provisionalDocumentLoader, 2106 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) {
2117 // so we need to null check it again. 2107 AXObjectCache::AXLoadingEvent loadingEvent = loadType() == FrameLoadType Reload ? AXObjectCache::AXLoadingReloaded : AXObjectCache::AXLoadingStarted;
2118 if (!m_provisionalDocumentLoader) 2108 cache->frameLoadingEventNotification(m_frame, loadingEvent);
2119 return; 2109 }
2120
2121 DocumentLoader* activeDocLoader = activeDocumentLoader();
2122 if (activeDocLoader && activeDocLoader->isLoadingMainResource())
2123 return;
2124 2110
2125 m_provisionalDocumentLoader->startLoadingMainResource(); 2111 m_provisionalDocumentLoader->startLoadingMainResource();
2126 } 2112 }
2127 2113
2128 void FrameLoader::checkNewWindowPolicyAndContinue(PassRefPtr<FormState> formStat e, const String& frameName, const NavigationAction& action) 2114 void FrameLoader::checkNewWindowPolicyAndContinue(PassRefPtr<FormState> formStat e, const String& frameName, const NavigationAction& action)
2129 { 2115 {
2130 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxPopups)) 2116 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxPopups))
2131 return; 2117 return;
2132 2118
2133 if (!DOMWindow::allowPopUp(m_frame)) 2119 if (!DOMWindow::allowPopUp(m_frame))
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); 2528 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect);
2543 2529
2544 page->chrome().setWindowRect(newWindowRect); 2530 page->chrome().setWindowRect(newWindowRect);
2545 page->chrome().show(); 2531 page->chrome().show();
2546 2532
2547 created = true; 2533 created = true;
2548 return frame; 2534 return frame;
2549 } 2535 }
2550 2536
2551 } // namespace WebCore 2537 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698