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

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

Issue 7725005: Fix for a memory corruption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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/tab_contents/render_view_host_manager.cc
===================================================================
--- content/browser/tab_contents/render_view_host_manager.cc (revision 97282)
+++ content/browser/tab_contents/render_view_host_manager.cc (working copy)
@@ -635,8 +635,18 @@
// in case we navigate back to it.
if (old_render_view_host->IsRenderViewLive()) {
DCHECK(old_render_view_host->is_swapped_out());
- swapped_out_hosts_[old_render_view_host->site_instance()->id()] =
- old_render_view_host;
+ // Temp fix for http://crbug.com/90867 until we do a better cleanup to make
+ // sure we don't get different rvh instances for the same site instance
+ // in the same rvhmgr.
+ // TODO(creis): Clean this up.
Charlie Reis 2011/08/24 21:18:52 Ugh, I'll try to fix the duplicated code in my nex
MAD 2011/08/24 21:31:07 Added a note, thought you already had one here: v
+ int32 old_site_instance_id = old_render_view_host->site_instance()->id();
+ RenderViewHostMap::iterator iter =
+ swapped_out_hosts_.find(old_site_instance_id);
+ if (iter != swapped_out_hosts_.end() &&
+ iter->second != old_render_view_host) {
+ iter->second->Shutdown();
Charlie Reis 2011/08/24 21:18:52 Please add just a little more comment here, like "
MAD 2011/08/24 21:31:07 Done.
+ }
+ swapped_out_hosts_[old_site_instance_id] = old_render_view_host;
} else {
old_render_view_host->Shutdown();
}
@@ -855,8 +865,18 @@
// in case we navigate back to it.
if (old_render_view_host->IsRenderViewLive()) {
DCHECK(old_render_view_host->is_swapped_out());
- swapped_out_hosts_[old_render_view_host->site_instance()->id()] =
- old_render_view_host;
+ // Temp fix for http://crbug.com/90867 until we do a better cleanup to make
+ // sure we don't get different rvh instances for the same site instance
+ // in the same rvhmgr.
+ // TODO(creis): Clean this up.
+ int32 old_site_instance_id = old_render_view_host->site_instance()->id();
+ RenderViewHostMap::iterator iter =
+ swapped_out_hosts_.find(old_site_instance_id);
+ if (iter != swapped_out_hosts_.end() &&
+ iter->second != old_render_view_host) {
+ iter->second->Shutdown();
+ }
+ swapped_out_hosts_[old_site_instance_id] = old_render_view_host;
} else {
old_render_view_host->Shutdown();
}

Powered by Google App Engine
This is Rietveld 408576698