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

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

Issue 2461043003: Fix for the RedirectTest.ClientServerServer test. (Closed)
Patch Set: More build error fixes Created 4 years, 1 month 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 visitor->trace(m_deferredHistoryLoad); 213 visitor->trace(m_deferredHistoryLoad);
214 } 214 }
215 215
216 void FrameLoader::init() { 216 void FrameLoader::init() {
217 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString())); 217 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString()));
218 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal); 218 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal);
219 initialRequest.setFrameType(m_frame->isMainFrame() 219 initialRequest.setFrameType(m_frame->isMainFrame()
220 ? WebURLRequest::FrameTypeTopLevel 220 ? WebURLRequest::FrameTypeTopLevel
221 : WebURLRequest::FrameTypeNested); 221 : WebURLRequest::FrameTypeNested);
222 m_provisionalDocumentLoader = 222 m_provisionalDocumentLoader =
223 client()->createDocumentLoader(m_frame, initialRequest, SubstituteData()); 223 client()->createDocumentLoader(m_frame, initialRequest, SubstituteData(),
224 ClientRedirectPolicy::NotClientRedirect);
224 m_provisionalDocumentLoader->startLoadingMainResource(); 225 m_provisionalDocumentLoader->startLoadingMainResource();
225 m_frame->document()->cancelParsing(); 226 m_frame->document()->cancelParsing();
226 m_stateMachine.advanceTo( 227 m_stateMachine.advanceTo(
227 FrameLoaderStateMachine::DisplayingInitialEmptyDocument); 228 FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
228 // Self-suspend if created in an already deferred Page. Note that both 229 // Self-suspend if created in an already deferred Page. Note that both
229 // startLoadingMainResource() and cancelParsing() may have already detached 230 // startLoadingMainResource() and cancelParsing() may have already detached
230 // the frame, since they both fire JS events. 231 // the frame, since they both fire JS events.
231 if (m_frame->page() && m_frame->page()->defersLoading()) 232 if (m_frame->page() && m_frame->page()->defersLoading())
232 setDefersLoading(true); 233 setDefersLoading(true);
233 takeObjectSnapshot(); 234 takeObjectSnapshot();
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 detachDocumentLoader(m_provisionalDocumentLoader); 1652 detachDocumentLoader(m_provisionalDocumentLoader);
1652 1653
1653 // beforeunload fired above, and detaching a DocumentLoader can fire events, 1654 // beforeunload fired above, and detaching a DocumentLoader can fire events,
1654 // which can detach this frame. 1655 // which can detach this frame.
1655 if (!m_frame->host()) 1656 if (!m_frame->host())
1656 return; 1657 return;
1657 1658
1658 m_provisionalDocumentLoader = client()->createDocumentLoader( 1659 m_provisionalDocumentLoader = client()->createDocumentLoader(
1659 m_frame, request, frameLoadRequest.substituteData().isValid() 1660 m_frame, request, frameLoadRequest.substituteData().isValid()
1660 ? frameLoadRequest.substituteData() 1661 ? frameLoadRequest.substituteData()
1661 : defaultSubstituteDataForURL(request.url())); 1662 : defaultSubstituteDataForURL(request.url()),
1663 frameLoadRequest.clientRedirect());
1662 m_provisionalDocumentLoader->setNavigationType(navigationType); 1664 m_provisionalDocumentLoader->setNavigationType(navigationType);
1663 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( 1665 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem(
1664 type == FrameLoadTypeReplaceCurrentItem); 1666 type == FrameLoadTypeReplaceCurrentItem);
1665 m_provisionalDocumentLoader->setIsClientRedirect(
1666 frameLoadRequest.clientRedirect() ==
1667 ClientRedirectPolicy::ClientRedirect);
1668
1669 m_frame->navigationScheduler().cancel(); 1667 m_frame->navigationScheduler().cancel();
1670 m_checkTimer.stop(); 1668 m_checkTimer.stop();
1671 1669
1672 m_loadType = type; 1670 m_loadType = type;
1673 1671
1674 if (frameLoadRequest.form()) 1672 if (frameLoadRequest.form())
1675 client()->dispatchWillSubmitForm(frameLoadRequest.form()); 1673 client()->dispatchWillSubmitForm(frameLoadRequest.form());
1676 1674
1677 m_progressTracker->progressStarted(); 1675 m_progressTracker->progressStarted();
1678 if (m_provisionalDocumentLoader->isClientRedirect())
1679 m_provisionalDocumentLoader->appendRedirect(m_frame->document()->url());
1680 m_provisionalDocumentLoader->appendRedirect( 1676 m_provisionalDocumentLoader->appendRedirect(
1681 m_provisionalDocumentLoader->request().url()); 1677 m_provisionalDocumentLoader->request().url());
1682 double triggeringEventTime = 1678 double triggeringEventTime =
1683 frameLoadRequest.triggeringEvent() 1679 frameLoadRequest.triggeringEvent()
1684 ? frameLoadRequest.triggeringEvent()->platformTimeStamp() 1680 ? frameLoadRequest.triggeringEvent()->platformTimeStamp()
1685 : 0; 1681 : 0;
1686 client()->dispatchDidStartProvisionalLoad(triggeringEventTime); 1682 client()->dispatchDidStartProvisionalLoad(triggeringEventTime);
1687 DCHECK(m_provisionalDocumentLoader); 1683 DCHECK(m_provisionalDocumentLoader);
1688 m_provisionalDocumentLoader->startLoadingMainResource(); 1684 m_provisionalDocumentLoader->startLoadingMainResource();
1689 1685
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1929 m_documentLoader ? m_documentLoader->url() : String()); 1925 m_documentLoader ? m_documentLoader->url() : String());
1930 return tracedValue; 1926 return tracedValue;
1931 } 1927 }
1932 1928
1933 inline void FrameLoader::takeObjectSnapshot() const { 1929 inline void FrameLoader::takeObjectSnapshot() const {
1934 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1930 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1935 toTracedValue()); 1931 toTracedValue());
1936 } 1932 }
1937 1933
1938 } // namespace blink 1934 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698