summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/extension_host.cc3
-rw-r--r--chrome/browser/extensions/extension_process_manager.cc9
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 8ccc9c7..d78d8bc 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -48,6 +48,9 @@ ExtensionHost::~ExtensionHost() {
void ExtensionHost::CreateView(Browser* browser) {
#if defined(TOOLKIT_VIEWS)
view_.reset(new ExtensionView(this, browser));
+ // We own |view_|, so don't auto delete when it's removed from the view
+ // hierarchy.
+ view_->SetParentOwned(false);
#else
// TODO(port)
NOTREACHED();
diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
index 5f1eada..a511920 100644
--- a/chrome/browser/extensions/extension_process_manager.cc
+++ b/chrome/browser/extensions/extension_process_manager.cc
@@ -34,9 +34,9 @@ ExtensionProcessManager::ExtensionProcessManager(Profile* profile)
}
ExtensionProcessManager::~ExtensionProcessManager() {
- // Copy background_hosts_ to avoid iterator invalidation issues.
- ExtensionHostSet to_delete(background_hosts_.begin(),
- background_hosts_.end());
+ // Copy all_hosts_ to avoid iterator invalidation issues.
+ ExtensionHostSet to_delete(all_hosts_.begin(),
+ all_hosts_.end());
ExtensionHostSet::iterator iter;
for (iter = to_delete.begin(); iter != to_delete.end(); ++iter)
delete *iter;
@@ -45,9 +45,12 @@ ExtensionProcessManager::~ExtensionProcessManager() {
ExtensionHost* ExtensionProcessManager::CreateView(Extension* extension,
const GURL& url,
Browser* browser) {
+ DCHECK(extension);
+ DCHECK(browser);
ExtensionHost* host =
new ExtensionHost(extension, GetSiteInstanceForURL(url), url, this);
host->CreateView(browser);
+ all_hosts_.insert(host);
return host;
}