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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 185993008: Moving DidFinishLoad from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes based on Charlie's review. Created 6 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6472aa02521ea1e94b6269cf9034f1bf3e040040..d06ce7d18e15e76156dae4d872c7fc39328fcda3 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -457,7 +457,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
OnDidRunInsecureContent)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad,
OnDocumentLoadedInFrame)
- IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad)
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits)
IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory)
@@ -2251,29 +2251,33 @@ void WebContentsImpl::OnDocumentLoadedInFrame() {
}
void WebContentsImpl::OnDidFinishLoad(
- int64 frame_id,
const GURL& url,
bool is_main_frame) {
- if (!render_view_message_source_) {
+ if (!render_frame_message_source_) {
RecordAction(base::UserMetricsAction("BadMessageTerminate_RVD2"));
GetRenderProcessHost()->ReceivedBadMessage();
return;
}
+ RenderFrameHostImpl* rfh =
+ static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
+
// --site-per-process mode has a short-term hack allowing cross-process
// subframe pages to commit thinking they are top-level. Correct it here to
// avoid confusing the observers.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
- render_view_message_source_ != GetRenderViewHost())
+ rfh != GetMainFrame()) {
is_main_frame = false;
+ }
GURL validated_url(url);
RenderProcessHost* render_process_host =
- render_view_message_source_->GetProcess();
+ render_frame_message_source_->GetProcess();
render_process_host->FilterURL(false, &validated_url);
+
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- DidFinishLoad(frame_id, validated_url, is_main_frame,
- render_view_message_source_));
+ DidFinishLoad(rfh->GetRoutingID(), validated_url,
+ is_main_frame, rfh->render_view_host()));
}
void WebContentsImpl::OnGoToEntryAtOffset(int offset) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698