Clean up SiteInstance with all swapped out views.
SiteInstanceImpl is extended with active_view_count(), and RenderViewHostManager shuts down all the views in a SiteInstance whose active_view_count() reaches 0. This CL also changes an assumption that some test cases depend on : a view stays valid for some time even after it gets shut down.
This also fixes a crash in RendererResource by deleting RVHs later.
BUG=253576
Review URL: https://chromiumcodereview.appspot.com/18649004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211289 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 0edd85b1..4268067 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -41,6 +41,7 @@
SiteInstanceImpl::SiteInstanceImpl(BrowsingInstance* browsing_instance)
: id_(next_site_instance_id_++),
+ active_view_count_(0),
browsing_instance_(browsing_instance),
process_(NULL),
has_site_(false) {