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

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

Issue 107893003: Make the renderer-side prerendering code use RenderFrames instead of RenderViews. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: creis review comments Created 7 years 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
===================================================================
--- content/browser/web_contents/web_contents_impl.cc (revision 239602)
+++ content/browser/web_contents/web_contents_impl.cc (working copy)
@@ -2768,6 +2768,20 @@
return OnMessageReceived(NULL, render_frame_host, message);
}
+void WebContentsImpl::RenderFrameCreated(RenderFrameHost* render_frame_host) {
+ // Note this is only for subframes, the notification for the main frame
+ // happens in RenderViewCreated.
mmenke 2013/12/10 20:56:41 Shouldn't this comment be in the WebContentsObserv
jam 2013/12/10 21:14:17 I specifically avoided that because it's an implem
mmenke 2013/12/10 21:26:39 Sorry, I completely misunderstood the comment (I w
+ FOR_EACH_OBSERVER(WebContentsObserver,
+ observers_,
+ RenderFrameCreated(render_frame_host));
+}
+
+void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) {
+ FOR_EACH_OBSERVER(WebContentsObserver,
+ observers_,
+ RenderFrameDeleted(render_frame_host));
+}
+
RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() {
return render_view_host_delegate_view_;
}
@@ -2828,6 +2842,13 @@
FOR_EACH_OBSERVER(
WebContentsObserver, observers_, RenderViewCreated(render_view_host));
+
+ // We tell the observers now instead of when the main RenderFrameHostImpl is
+ // constructed because otherwise it would be too early (i.e. IPCs sent to the
+ // frame would be dropped because it's not created yet).
+ RenderFrameHost* main_frame = GetMainFrame();
+ FOR_EACH_OBSERVER(
+ WebContentsObserver, observers_, RenderFrameCreated(main_frame));
}
void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) {

Powered by Google App Engine
This is Rietveld 408576698