Support window.opener after a process swap.

Changes:
1. Swap out RVHs instead of closing them, so we can return to the same Frame object if we later come back.
2. Filter out messages from swapped out RVHs, in case any are in-flight.
3. Remove the workaround for navigating away from an app.
4. Update tests to reflect the new sequence of events.

BUG=65953
TEST=AppApiTest.AppProcess
TEST=ResourceDispatcherTest.CrossSiteImmediateLoadOnunloadCookie

Review URL: http://codereview.chromium.org/6319001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85134 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc
index a121109..ed8cd9b 100644
--- a/content/browser/site_instance.cc
+++ b/content/browser/site_instance.cc
@@ -25,8 +25,11 @@
          url.spec() == chrome::kAboutShorthangURL;
 }
 
+int32 SiteInstance::next_site_instance_id_ = 1;
+
 SiteInstance::SiteInstance(BrowsingInstance* browsing_instance)
-    : browsing_instance_(browsing_instance),
+    : id_(next_site_instance_id_++),
+      browsing_instance_(browsing_instance),
       render_process_host_factory_(NULL),
       process_(NULL),
       max_page_id_(-1),