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

Unified Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 2655143002: Drop replacesCurrentHistoryItem, NavigationType (Closed)
Patch Set: More compile fixes Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
index f54da409225a9f4fa64f26ad71eda001e5e3c011..6c15100173ca517ea5d19bf1888f3b35065ef4df 100644
--- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
+++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
@@ -342,11 +342,13 @@ void FrameLoaderClientImpl::detached(FrameDetachType type) {
m_webFrame->setCoreFrame(nullptr);
}
-void FrameLoaderClientImpl::dispatchWillSendRequest(ResourceRequest& request) {
+void FrameLoaderClientImpl::willSendRequest(ResourceRequest& request,
+ FrameLoadType type) {
// Give the WebFrameClient a crack at the request.
if (m_webFrame->client()) {
WrappedResourceRequest webreq(request);
- m_webFrame->client()->willSendRequest(m_webFrame, webreq);
+ m_webFrame->client()->willSendRequest(m_webFrame, webreq,
+ static_cast<WebFrameLoadType>(type));
}
}
@@ -387,17 +389,20 @@ void FrameLoaderClientImpl::
m_webFrame);
}
-void FrameLoaderClientImpl::dispatchDidNavigateWithinPage(
- HistoryItem* item,
- HistoryCommitType commitType,
- bool contentInitiated) {
+void FrameLoaderClientImpl::didNavigateWithinPage(DocumentLoader* loader,
+ FrameLoadType frameLoadType,
+ HistoryItem* item,
+ HistoryCommitType commitType,
+ bool contentInitiated) {
bool shouldCreateHistoryEntry = commitType == StandardCommit;
// TODO(dglazkov): Does this need to be called for subframes?
m_webFrame->viewImpl()->didCommitLoad(shouldCreateHistoryEntry, true);
- if (m_webFrame->client())
+ if (m_webFrame->client()) {
m_webFrame->client()->didNavigateWithinPage(
- m_webFrame, WebHistoryItem(item),
+ WebDataSourceImpl::fromDocumentLoader(loader),
+ static_cast<WebFrameLoadType>(frameLoadType), WebHistoryItem(item),
static_cast<WebHistoryCommitType>(commitType), contentInitiated);
+ }
}
void FrameLoaderClientImpl::dispatchWillCommitProvisionalLoad() {
@@ -405,9 +410,14 @@ void FrameLoaderClientImpl::dispatchWillCommitProvisionalLoad() {
m_webFrame->client()->willCommitProvisionalLoad(m_webFrame);
}
-void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() {
- if (m_webFrame->client())
- m_webFrame->client()->didStartProvisionalLoad(m_webFrame);
+void FrameLoaderClientImpl::didStartProvisionalLoad(
+ DocumentLoader* loader,
+ FrameLoadType frameLoadType) {
+ if (m_webFrame->client()) {
+ m_webFrame->client()->didStartProvisionalLoad(
+ WebDataSourceImpl::fromDocumentLoader(loader),
+ static_cast<WebFrameLoadType>(frameLoadType));
+ }
if (WebDevToolsAgentImpl* devTools = devToolsAgent())
devTools->didStartProvisionalLoad(m_webFrame->frame());
}
@@ -424,17 +434,21 @@ void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type) {
static_cast<WebIconURL::Type>(type));
}
-void FrameLoaderClientImpl::dispatchDidCommitLoad(
+void FrameLoaderClientImpl::didCommitProvisionalLoad(
+ DocumentLoader* loader,
+ FrameLoadType frameLoadType,
HistoryItem* item,
HistoryCommitType commitType) {
if (!m_webFrame->parent()) {
m_webFrame->viewImpl()->didCommitLoad(commitType == StandardCommit, false);
}
- if (m_webFrame->client())
+ if (m_webFrame->client()) {
m_webFrame->client()->didCommitProvisionalLoad(
- m_webFrame, WebHistoryItem(item),
+ WebDataSourceImpl::fromDocumentLoader(loader),
+ static_cast<WebFrameLoadType>(frameLoadType), WebHistoryItem(item),
static_cast<WebHistoryCommitType>(commitType));
+ }
if (WebDevToolsAgentImpl* devTools = devToolsAgent())
devTools->didCommitLoadForLocalFrame(m_webFrame->frame());
}
@@ -504,9 +518,8 @@ static bool allowCreatingBackgroundTabs() {
NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(
const ResourceRequest& request,
DocumentLoader* loader,
- NavigationType type,
NavigationPolicy policy,
- bool replacesCurrentHistoryItem,
+ FrameLoadType frameLoadType,
bool isClientRedirect,
HTMLFormElement* form) {
if (!m_webFrame->client())
@@ -519,31 +532,11 @@ NavigationPolicy FrameLoaderClientImpl::decidePolicyForNavigation(
WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader(loader);
- // Newly created child frames may need to be navigated to a history item
- // during a back/forward navigation. This will only happen when the parent
- // is a LocalFrame doing a back/forward navigation that has not completed.
- // (If the load has completed and the parent later adds a frame with script,
- // we do not want to use a history item for it.)
- bool isHistoryNavigationInNewChildFrame =
- m_webFrame->parent() && m_webFrame->parent()->isWebLocalFrame() &&
- isBackForwardLoadType(toWebLocalFrameImpl(m_webFrame->parent())
- ->frame()
- ->loader()
- .documentLoader()
- ->loadType()) &&
- !toWebLocalFrameImpl(m_webFrame->parent())
- ->frame()
- ->document()
- ->loadEventFinished();
-
WrappedResourceRequest wrappedResourceRequest(request);
WebFrameClient::NavigationPolicyInfo navigationInfo(wrappedResourceRequest);
- navigationInfo.navigationType = static_cast<WebNavigationType>(type);
navigationInfo.defaultPolicy = static_cast<WebNavigationPolicy>(policy);
navigationInfo.extraData = ds ? ds->getExtraData() : nullptr;
- navigationInfo.replacesCurrentHistoryItem = replacesCurrentHistoryItem;
- navigationInfo.isHistoryNavigationInNewChildFrame =
- isHistoryNavigationInNewChildFrame;
+ navigationInfo.loadType = static_cast<WebFrameLoadType>(frameLoadType);
navigationInfo.isClientRedirect = isClientRedirect;
// Caching could be disabled for requests initiated by DevTools.
// TODO(ananta)
@@ -588,14 +581,14 @@ void FrameLoaderClientImpl::didStopLoading() {
void FrameLoaderClientImpl::loadURLExternally(const ResourceRequest& request,
NavigationPolicy policy,
const String& suggestedName,
- bool shouldReplaceCurrentEntry) {
+ FrameLoadType loadType) {
if (!m_webFrame->client())
return;
DCHECK(m_webFrame->frame()->document());
Fullscreen::fullyExitFullscreen(*m_webFrame->frame()->document());
m_webFrame->client()->loadURLExternally(
WrappedResourceRequest(request), static_cast<WebNavigationPolicy>(policy),
- suggestedName, shouldReplaceCurrentEntry);
+ suggestedName, static_cast<WebFrameLoadType>(loadType));
}
void FrameLoaderClientImpl::loadErrorPage(int reason) {
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.h ('k') | third_party/WebKit/Source/web/WebDataSourceImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698