diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 19:55:57 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 19:55:57 +0000 |
commit | ce3fa3c831cba1f44d34c1c66020f830be33a068 (patch) | |
tree | da18dbdfb081c17949dca2dcfa0633142a63a868 /chrome/browser/tab_contents/render_view_host_manager.h | |
parent | 6ee6368c466235c5919c9b4d5cfe11f8e48b29ca (diff) | |
download | chromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.zip chromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.tar.gz chromium_src-ce3fa3c831cba1f44d34c1c66020f830be33a068.tar.bz2 |
Re-land my change to clean up TabContents/WebContents ownership. This
is the same except in tab_strip_model_unittest I fixed a leak by making a
WebContents on the stack, I added a factory to the SiteInstance unittest to
prevent another leak, and I re-added a NULL set to the external_tab_container.
Fix the ownership model of TabContents and NavigationController. Previously the
NavigationController owned the TabContents, and there were extra steps required
at creation and destruction to clean everything up properly.
NavigationController is now a member of TabContents, and there is no setup or
tear down necessary other than the constructor and destructor. I could remove
the tab contents creation in the NavigationController, as well as all the
weird destruction code in WebContents which got moved to the destructor.
I made the controller getter return a reference since the ownership is clear
and there is no possibility of NULL. This required changing a lot of tiles, but
many of them were simplified since they no longer have to NULL check.
Previous review URL: http://codereview.chromium.org/69043
Review URL: http://codereview.chromium.org/67294
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/render_view_host_manager.h')
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_manager.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/chrome/browser/tab_contents/render_view_host_manager.h b/chrome/browser/tab_contents/render_view_host_manager.h index b3a5b25..15ee081 100644 --- a/chrome/browser/tab_contents/render_view_host_manager.h +++ b/chrome/browser/tab_contents/render_view_host_manager.h @@ -47,7 +47,7 @@ class RenderViewHostManager : public NotificationObserver { RenderViewHost* render_view_host) = 0; virtual void UpdateRenderViewSizeForRenderManager() = 0; virtual void NotifySwappedFromRenderManager() = 0; - virtual NavigationController* GetControllerForRenderManager() = 0; + virtual NavigationController& GetControllerForRenderManager() = 0; // Creates a DOMUI object for the given URL if one applies. Ownership of the // returned pointer will be passed to the caller. If no DOMUI applies, @@ -64,8 +64,7 @@ class RenderViewHostManager : public NotificationObserver { // They must outlive this class. The RenderViewHostDelegate is what will be // installed into all RenderViewHosts that are created. // - // You must call Init() before using this class and Shutdown() before - // deleting it. + // You must call Init() before using this class. RenderViewHostManager(RenderViewHostDelegate* render_view_delegate, Delegate* delegate); ~RenderViewHostManager(); @@ -76,9 +75,6 @@ class RenderViewHostManager : public NotificationObserver { int routing_id, base::WaitableEvent* modal_dialog_event); - // Schedules all RenderViewHosts for destruction. - void Shutdown(); - // Returns the currently actuive RenderViewHost. // // This will be non-NULL between Init() and Shutdown(). You may want to NULL |