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

Unified Diff: chrome/browser/tab_contents/site_instance.h

Issue 42054: Stop using renderer specific host ids in ResourceDispatcher. This allows it ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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: chrome/browser/tab_contents/site_instance.h
===================================================================
--- chrome/browser/tab_contents/site_instance.h (revision 11493)
+++ chrome/browser/tab_contents/site_instance.h (working copy)
@@ -7,6 +7,7 @@
#include "chrome/browser/browsing_instance.h"
#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/common/notification_observer.h"
#include "googleurl/src/gurl.h"
///////////////////////////////////////////////////////////////////////////////
@@ -43,7 +44,8 @@
// tabs with no NavigationEntries or in NavigationEntries in the history.
//
///////////////////////////////////////////////////////////////////////////////
-class SiteInstance : public base::RefCounted<SiteInstance> {
+class SiteInstance : public base::RefCounted<SiteInstance>,
+ public NotificationObserver {
public:
// Virtual to allow tests to extend it.
virtual ~SiteInstance();
@@ -61,12 +63,6 @@
render_process_host_factory_ = rph_factory;
}
- // Set / Get the host ID for this SiteInstance's current RenderProcessHost.
- void set_process_host_id(int process_host_id) {
- process_host_id_ = process_host_id;
- }
- int process_host_id() const { return process_host_id_; }
-
// Update / Get the max page ID for this SiteInstance.
void UpdateMaxPageID(int32 page_id) {
if (page_id > max_page_id_)
@@ -133,16 +129,14 @@
// Create a new SiteInstance. Protected to give access to BrowsingInstance
// and tests; most callers should use CreateSiteInstance or
// GetRelatedSiteInstance instead.
- SiteInstance(BrowsingInstance* browsing_instance)
- : browsing_instance_(browsing_instance),
- render_process_host_factory_(NULL),
- process_host_id_(-1),
- max_page_id_(-1),
- has_site_(false) {
- DCHECK(browsing_instance);
- }
+ SiteInstance(BrowsingInstance* browsing_instance);
private:
+ // NotificationObserver implementation.
+ void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
// BrowsingInstance to which this SiteInstance belongs.
scoped_refptr<BrowsingInstance> browsing_instance_;
@@ -150,11 +144,8 @@
// that the default BrowserRenderProcessHost should be created.
const RenderProcessHostFactory* render_process_host_factory_;
- // Current host ID for the RenderProcessHost that is rendering pages for this
- // SiteInstance. If the rendering process dies, this host ID can be
- // replaced when a new process is created, without losing the association
- // between all pages in this SiteInstance.
- int process_host_id_;
+ // Current RenderProcessHost that is rendering pages for this SiteInstance.
+ RenderProcessHost* process_;
// The current max_page_id in the SiteInstance's RenderProcessHost. If the
// rendering process dies, its replacement should start issuing page IDs that
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/browser/tab_contents/site_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698