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

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

Issue 2416523002: Expose the initiating origin/URL of a navigation in the Blink public API (Closed)
Patch Set: rebase 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 visitor->trace(m_provisionalItem); 214 visitor->trace(m_provisionalItem);
215 visitor->trace(m_deferredHistoryLoad); 215 visitor->trace(m_deferredHistoryLoad);
216 } 216 }
217 217
218 void FrameLoader::init() { 218 void FrameLoader::init() {
219 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString())); 219 ResourceRequest initialRequest(KURL(ParsedURLString, emptyString()));
220 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal); 220 initialRequest.setRequestContext(WebURLRequest::RequestContextInternal);
221 initialRequest.setFrameType(m_frame->isMainFrame() 221 initialRequest.setFrameType(m_frame->isMainFrame()
222 ? WebURLRequest::FrameTypeTopLevel 222 ? WebURLRequest::FrameTypeTopLevel
223 : WebURLRequest::FrameTypeNested); 223 : WebURLRequest::FrameTypeNested);
224 m_provisionalDocumentLoader = 224 m_provisionalDocumentLoader = client()->createDocumentLoader(
225 client()->createDocumentLoader(m_frame, initialRequest, SubstituteData(), 225 m_frame, initialRequest, SubstituteData(),
226 ClientRedirectPolicy::NotClientRedirect); 226 ClientRedirectPolicy::NotClientRedirect, nullptr);
227 m_provisionalDocumentLoader->startLoadingMainResource(); 227 m_provisionalDocumentLoader->startLoadingMainResource();
228 m_frame->document()->cancelParsing(); 228 m_frame->document()->cancelParsing();
229 m_stateMachine.advanceTo( 229 m_stateMachine.advanceTo(
230 FrameLoaderStateMachine::DisplayingInitialEmptyDocument); 230 FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
231 // Self-suspend if created in an already deferred Page. Note that both 231 // Self-suspend if created in an already deferred Page. Note that both
232 // startLoadingMainResource() and cancelParsing() may have already detached 232 // startLoadingMainResource() and cancelParsing() may have already detached
233 // the frame, since they both fire JS events. 233 // the frame, since they both fire JS events.
234 if (m_frame->page() && m_frame->page()->defersLoading()) 234 if (m_frame->page() && m_frame->page()->defersLoading())
235 setDefersLoading(true); 235 setDefersLoading(true);
236 takeObjectSnapshot(); 236 takeObjectSnapshot();
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 // beforeunload fired above, and detaching a DocumentLoader can fire events, 1688 // beforeunload fired above, and detaching a DocumentLoader can fire events,
1689 // which can detach this frame. 1689 // which can detach this frame.
1690 if (!m_frame->host()) 1690 if (!m_frame->host())
1691 return; 1691 return;
1692 1692
1693 m_provisionalDocumentLoader = client()->createDocumentLoader( 1693 m_provisionalDocumentLoader = client()->createDocumentLoader(
1694 m_frame, resourceRequest, 1694 m_frame, resourceRequest,
1695 frameLoadRequest.substituteData().isValid() 1695 frameLoadRequest.substituteData().isValid()
1696 ? frameLoadRequest.substituteData() 1696 ? frameLoadRequest.substituteData()
1697 : defaultSubstituteDataForURL(resourceRequest.url()), 1697 : defaultSubstituteDataForURL(resourceRequest.url()),
1698 frameLoadRequest.clientRedirect()); 1698 frameLoadRequest.clientRedirect(), frameLoadRequest.originDocument());
1699 m_provisionalDocumentLoader->setNavigationType(navigationType); 1699 m_provisionalDocumentLoader->setNavigationType(navigationType);
1700 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( 1700 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem(
1701 type == FrameLoadTypeReplaceCurrentItem); 1701 type == FrameLoadTypeReplaceCurrentItem);
1702 m_frame->navigationScheduler().cancel(); 1702 m_frame->navigationScheduler().cancel();
1703 m_checkTimer.stop(); 1703 m_checkTimer.stop();
1704 1704
1705 m_loadType = type; 1705 m_loadType = type;
1706 1706
1707 if (frameLoadRequest.form()) 1707 if (frameLoadRequest.form())
1708 client()->dispatchWillSubmitForm(frameLoadRequest.form()); 1708 client()->dispatchWillSubmitForm(frameLoadRequest.form());
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 m_documentLoader ? m_documentLoader->url() : String()); 1958 m_documentLoader ? m_documentLoader->url() : String());
1959 return tracedValue; 1959 return tracedValue;
1960 } 1960 }
1961 1961
1962 inline void FrameLoader::takeObjectSnapshot() const { 1962 inline void FrameLoader::takeObjectSnapshot() const {
1963 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1963 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1964 toTracedValue()); 1964 toTracedValue());
1965 } 1965 }
1966 1966
1967 } // namespace blink 1967 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698