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

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

Issue 23618036: Merge NOTIFICATION_RENDER_VIEW_HOST_CHANGED into NOTIFICATION_WEB_CONTENTS_SWAPPED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 2 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/render_view_host_manager.cc
diff --git a/content/browser/web_contents/render_view_host_manager.cc b/content/browser/web_contents/render_view_host_manager.cc
index f07729c89e7e157b1a50c3c152212009c6e89a11..99f26629bbe2eac44760257ef51685f6b11ba96b 100644
--- a/content/browser/web_contents/render_view_host_manager.cc
+++ b/content/browser/web_contents/render_view_host_manager.cc
@@ -165,15 +165,7 @@ RenderViewHostImpl* RenderViewHostManager::Navigate(
} else {
// This is our primary renderer, notify here as we won't be calling
// CommitPending (which does the notify).
- RenderViewHost* null_rvh = NULL;
- std::pair<RenderViewHost*, RenderViewHost*> details =
- std::make_pair(null_rvh, render_view_host_);
- NotificationService::current()->Notify(
- NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
- Source<NavigationController>(
- &delegate_->GetControllerForRenderManager()),
- Details<std::pair<RenderViewHost*, RenderViewHost*> >(
- &details));
+ delegate_->NotifySwappedFromRenderManager(NULL, render_view_host_);
}
}
@@ -778,23 +770,15 @@ void RenderViewHostManager::CommitPending() {
else if (focus_render_view && render_view_host_->GetView())
RenderWidgetHostViewPort::FromRWHV(render_view_host_->GetView())->Focus();
- std::pair<RenderViewHost*, RenderViewHost*> details =
- std::make_pair(old_render_view_host, render_view_host_);
- NotificationService::current()->Notify(
- NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
- Source<NavigationController>(
- &delegate_->GetControllerForRenderManager()),
- Details<std::pair<RenderViewHost*, RenderViewHost*> >(&details));
+ // Notify that we've swapped RenderViewHosts. We do this
+ // before shutting down the RVH so that we can clean up
+ // RendererResources related to the RVH first.
+ delegate_->NotifySwappedFromRenderManager(old_render_view_host,
+ render_view_host_);
// If the pending view was on the swapped out list, we can remove it.
swapped_out_hosts_.erase(render_view_host_->GetSiteInstance()->GetId());
- // Let the task manager know that we've swapped RenderViewHosts,
- // since it might need to update its process groupings. We do this
- // before shutting down the RVH so that we can clean up
- // RendererResources related to the RVH first.
- delegate_->NotifySwappedFromRenderManager(old_render_view_host);
-
// If there are no active RVHs in this SiteInstance, it means that
// this RVH was the last active one in the SiteInstance. Now that we
// know that all RVHs are swapped out, we can delete all the RVHs in

Powered by Google App Engine
This is Rietveld 408576698