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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 853693003: Remove the use of page id from determining whether to send the initial document notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 8fa21dc458b1cac2fe80adfc54126e31a35d352e..f24982617bb4e1aee439ff23e38f355157fc35a3 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2021,10 +2021,18 @@ blink::WebServiceWorkerProvider* RenderFrameImpl::createServiceWorkerProvider(
void RenderFrameImpl::didAccessInitialDocument(blink::WebLocalFrame* frame) {
DCHECK(!frame_ || frame_ == frame);
- // Notify the browser process that it is no longer safe to show the pending
- // URL of the main frame, since a URL spoof is now possible.
- if (!frame->parent() && render_view_->page_id_ == -1)
- Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_));
+ // If the request hasn't yet committed, notify the browser process that it is
+ // no longer safe to show the pending URL of the main frame, since a URL spoof
+ // is now possible. (If the request has committed, the browser already knows.)
+ if (!frame->parent()) {
+ DocumentState* document_state =
+ DocumentState::FromDataSource(frame->dataSource());
+ NavigationState* navigation_state = document_state->navigation_state();
+
+ if (!navigation_state->request_committed()) {
+ Send(new FrameHostMsg_DidAccessInitialDocument(routing_id_));
+ }
+ }
}
// TODO(alexmos): Remove once Blink is updated to use the version that takes
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698