summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 02:33:18 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 02:33:18 +0000
commitcd0dec6b9b78a34d7d632d898b18d98a5658ebaf (patch)
tree27b934688f7e5eb025a487a7fbf90635c8244ac0 /chrome
parent593c43b0d36dc37a260c3204857a642da7e6e523 (diff)
downloadchromium_src-cd0dec6b9b78a34d7d632d898b18d98a5658ebaf.zip
chromium_src-cd0dec6b9b78a34d7d632d898b18d98a5658ebaf.tar.gz
chromium_src-cd0dec6b9b78a34d7d632d898b18d98a5658ebaf.tar.bz2
Fix an ExternalTabContainer leak caused in the code path which attaches an ExternalTabContainer to
an IE tab, which connects to it. The leak occurs because of a refcount leak. This causes the AutomationProvider to not get released thus resulting in a running chrome.exe instance even after we shutdown IE. Review URL: http://codereview.chromium.org/600063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/external_tab_container.cc5
-rw-r--r--chrome/browser/external_tab_container.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 2f9b334..9d0d089 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -727,12 +727,13 @@ bool ExternalTabContainer::InitNavigationInfo(IPC::NavigationInfo* nav_info,
return true;
}
-ExternalTabContainer* ExternalTabContainer::RemovePendingTab(intptr_t cookie) {
+scoped_refptr<ExternalTabContainer> ExternalTabContainer::RemovePendingTab(
+ intptr_t cookie) {
PendingTabs::iterator index = pending_tabs_.find(cookie);
if (index != pending_tabs_.end()) {
scoped_refptr<ExternalTabContainer> container = (*index).second;
pending_tabs_.erase(index);
- return container.release();
+ return container;
}
NOTREACHED() << "Failed to find ExternalTabContainer for cookie: "
diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h
index 0cfdd49..0b25afb 100644
--- a/chrome/browser/external_tab_container.h
+++ b/chrome/browser/external_tab_container.h
@@ -163,7 +163,7 @@ class ExternalTabContainer : public TabContentsDelegate,
// Returns the ExternalTabContainer instance associated with the cookie
// passed in. It also erases the corresponding reference from the map.
// Returns NULL if we fail to find the cookie in the map.
- static ExternalTabContainer* RemovePendingTab(intptr_t cookie);
+ static scoped_refptr<ExternalTabContainer> RemovePendingTab(intptr_t cookie);
// Enables extension automation (for e.g. UITests), with the current tab
// used as a conduit for the extension API messages being handled by the