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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2661743002: PlzNavigate: Invoke didStartProvisionalLoad() when the renderer initiates a navigation in startLoad( (Closed)
Patch Set: Remove CHECK for redirect chain as the redirects may not be populated for provisional loads for ren… Created 3 years, 10 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f680dafd3d08e312a0c3974b5edbd53d4cc6f020..83bc1ffca79bb649c8c594ee065cb609840935a6 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3449,27 +3449,25 @@ void RenderFrameImpl::didCreateDataSource(blink::WebLocalFrame* frame,
content_initiated));
}
-void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame) {
- DCHECK_EQ(frame_, frame);
- WebDataSource* ds = frame->provisionalDataSource();
-
+void RenderFrameImpl::didStartProvisionalLoad(
+ blink::WebDataSource* data_source) {
// In fast/loader/stop-provisional-loads.html, we abort the load before this
// callback is invoked.
- if (!ds)
+ if (!data_source)
return;
TRACE_EVENT2("navigation,benchmark,rail",
"RenderFrameImpl::didStartProvisionalLoad", "id", routing_id_,
- "url", ds->getRequest().url().string().utf8());
- DocumentState* document_state = DocumentState::FromDataSource(ds);
+ "url", data_source->getRequest().url().string().utf8());
+ DocumentState* document_state = DocumentState::FromDataSource(data_source);
NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>(
document_state->navigation_state());
- bool is_top_most = !frame->parent();
+ bool is_top_most = !frame_->parent();
if (is_top_most) {
render_view_->set_navigation_gesture(
WebUserGestureIndicator::isProcessingUserGesture() ?
NavigationGestureUser : NavigationGestureAuto);
- } else if (ds->replacesCurrentHistoryItem()) {
+ } else if (data_source->replacesCurrentHistoryItem()) {
// Subframe navigations that don't add session history items must be
// marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we
// handle loading of error pages.
@@ -3481,15 +3479,16 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame) {
DCHECK(!navigation_start.is_null());
for (auto& observer : render_view_->observers())
- observer.DidStartProvisionalLoad(frame);
+ observer.DidStartProvisionalLoad(frame_);
for (auto& observer : observers_)
- observer.DidStartProvisionalLoad();
+ observer.DidStartProvisionalLoad(data_source);
std::vector<GURL> redirect_chain;
- GetRedirectChain(ds, &redirect_chain);
- CHECK(!redirect_chain.empty());
+ GetRedirectChain(data_source, &redirect_chain);
+
Send(new FrameHostMsg_DidStartProvisionalLoad(
- routing_id_, ds->getRequest().url(), redirect_chain, navigation_start));
+ routing_id_, data_source->getRequest().url(), redirect_chain,
+ navigation_start));
}
void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698