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

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: Trim includes/forward decls/fix names 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 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 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 1678
1679 // beforeunload fired above, and detaching a DocumentLoader can fire events, 1679 // beforeunload fired above, and detaching a DocumentLoader can fire events,
1680 // which can detach this frame. 1680 // which can detach this frame.
1681 if (!m_frame->host()) 1681 if (!m_frame->host())
1682 return; 1682 return;
1683 1683
1684 m_provisionalDocumentLoader = client()->createDocumentLoader( 1684 m_provisionalDocumentLoader = client()->createDocumentLoader(
1685 m_frame, request, frameLoadRequest.substituteData().isValid() 1685 m_frame, request, frameLoadRequest.substituteData().isValid()
1686 ? frameLoadRequest.substituteData() 1686 ? frameLoadRequest.substituteData()
1687 : defaultSubstituteDataForURL(request.url()), 1687 : defaultSubstituteDataForURL(request.url()),
1688 frameLoadRequest.clientRedirect()); 1688 frameLoadRequest.clientRedirect(), frameLoadRequest.requestorDocument());
1689 m_provisionalDocumentLoader->setNavigationType(navigationType); 1689 m_provisionalDocumentLoader->setNavigationType(navigationType);
1690 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( 1690 m_provisionalDocumentLoader->setReplacesCurrentHistoryItem(
1691 type == FrameLoadTypeReplaceCurrentItem); 1691 type == FrameLoadTypeReplaceCurrentItem);
1692 m_frame->navigationScheduler().cancel(); 1692 m_frame->navigationScheduler().cancel();
1693 m_checkTimer.stop(); 1693 m_checkTimer.stop();
1694 1694
1695 m_loadType = type; 1695 m_loadType = type;
1696 1696
1697 if (frameLoadRequest.form()) 1697 if (frameLoadRequest.form())
1698 client()->dispatchWillSubmitForm(frameLoadRequest.form()); 1698 client()->dispatchWillSubmitForm(frameLoadRequest.form());
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 m_documentLoader ? m_documentLoader->url() : String()); 1948 m_documentLoader ? m_documentLoader->url() : String());
1949 return tracedValue; 1949 return tracedValue;
1950 } 1950 }
1951 1951
1952 inline void FrameLoader::takeObjectSnapshot() const { 1952 inline void FrameLoader::takeObjectSnapshot() const {
1953 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1953 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1954 toTracedValue()); 1954 toTracedValue());
1955 } 1955 }
1956 1956
1957 } // namespace blink 1957 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698