diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 00:34:30 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-18 00:34:30 +0000 |
commit | f3b1a084a01ab82caf998daefcb989c66ff16135 (patch) | |
tree | 1072e46976c2fb7fa82d72c74bdc579d78f0ce01 /content/browser/site_instance.cc | |
parent | 8f0633691cd10779408642e2ad5eaa9b0c190b0a (diff) | |
download | chromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.zip chromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.tar.gz chromium_src-f3b1a084a01ab82caf998daefcb989c66ff16135.tar.bz2 |
Define the public interface for content browser RenderProcessHost. This interface is implemented by the RenderProcessHostImpl class which lives in content\browser\renderer_host\render_process_host_impl.cc/.h. The RenderProcessHostImpl class is a consolidation of the RenderProcessHost and BrowserRenderProcessHost classes.
The RenderProcessHost public interface was created from the now deleted RenderProcessHost class defined in content\browser\renderer_host\render_process_host.h.
Additional methods have been added to the interface to ensure that it works correctly with the MockRenderProcessHost class used by unit tests. I had to implement a number of overrides in the MockRenderProcessHost class to ensure that tests work correctly. This was because of assumptions in the tests that the MockRPH class was a real RPH which it was till now.
Added a TODO for the methods which could potentially be removed from this interface. Will revisit that in a subsequent CL.
BUG=98716
TEST=No change in functionality. Hopefully it all compiles and works.
Review URL: http://codereview.chromium.org/8515027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/site_instance.cc')
-rw-r--r-- | content/browser/site_instance.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/content/browser/site_instance.cc b/content/browser/site_instance.cc index 4cb5759..50672ef 100644 --- a/content/browser/site_instance.cc +++ b/content/browser/site_instance.cc @@ -5,11 +5,12 @@ #include "content/browser/site_instance.h" #include "content/browser/browsing_instance.h" -#include "content/browser/renderer_host/browser_render_process_host.h" +#include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/webui/web_ui_factory.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" +#include "content/public/browser/render_process_host_factory.h" #include "content/public/common/url_constants.h" #include "net/base/registry_controlled_domain.h" @@ -55,7 +56,7 @@ bool SiteInstance::HasProcess() const { return (process_ != NULL); } -RenderProcessHost* SiteInstance::GetProcess() { +content::RenderProcessHost* SiteInstance::GetProcess() { // TODO(erikkay) It would be nice to ensure that the renderer type had been // properly set before we get here. The default tab creation case winds up // with no site set at this point, so it will default to TYPE_NORMAL. This @@ -66,8 +67,8 @@ RenderProcessHost* SiteInstance::GetProcess() { // Create a new process if ours went away or was reused. if (!process_) { // See if we should reuse an old process - if (RenderProcessHost::ShouldTryToUseExistingProcessHost()) - process_ = RenderProcessHost::GetExistingProcessHost( + if (content::RenderProcessHost::ShouldTryToUseExistingProcessHost()) + process_ = content::RenderProcessHost::GetExistingProcessHost( browsing_instance_->browser_context(), site_); // Otherwise (or if that fails), create a new one. @@ -77,7 +78,7 @@ RenderProcessHost* SiteInstance::GetProcess() { browsing_instance_->browser_context()); } else { process_ = - new BrowserRenderProcessHost(browsing_instance_->browser_context()); + new RenderProcessHostImpl(browsing_instance_->browser_context()); } } @@ -224,7 +225,8 @@ void SiteInstance::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); - RenderProcessHost* rph = content::Source<RenderProcessHost>(source).ptr(); + content::RenderProcessHost* rph = + content::Source<content::RenderProcessHost>(source).ptr(); if (rph == process_) process_ = NULL; } |