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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 1964863002: Persist prompt/block download limiter state on renderer-initiated loads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding subframe limiter test Created 4 years, 7 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: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index cfcdbb018785fee3ad156a9d7f12fb4663fc94a2..a2466205ae629dc0754116845a32da34d9605330 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -177,12 +177,22 @@ void NavigatorImpl::DidStartProvisionalLoad(
std::unique_ptr<NavigationHandleImpl>());
}
- NavigationEntry* pending_entry = controller_->GetPendingEntry();
+ // It is safer to assume navigations are renderer-initiated unless shown
+ // otherwise. Browser navigations generally have more privileges, and they
+ // should always have a pending NavigationEntry to distinguish them.
+ bool is_renderer_initiated = true;
+ int pending_nav_entry_id = 0;
+ NavigationEntryImpl* pending_entry = controller_->GetPendingEntry();
+ if (pending_entry) {
+ is_renderer_initiated = pending_entry->is_renderer_initiated();
+ pending_nav_entry_id = pending_entry->GetUniqueID();
+ }
render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create(
validated_url, render_frame_host->frame_tree_node(),
+ is_renderer_initiated,
false, // is_synchronous
is_iframe_srcdoc, // is_srcdoc
- navigation_start, pending_entry ? pending_entry->GetUniqueID() : 0));
+ navigation_start, pending_nav_entry_id));
}
void NavigatorImpl::DidFailProvisionalLoadWithError(
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698