summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 08:58:31 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 08:58:31 +0000
commitc250d0224a2ff6befb6a1692f2ed596b09f17447 (patch)
tree2437da6d53f254684f3b31da9bb1ad065bfcef39
parente17a8a157bc8b8ba60854296e9ed07137aed8487 (diff)
downloadchromium_src-c250d0224a2ff6befb6a1692f2ed596b09f17447.zip
chromium_src-c250d0224a2ff6befb6a1692f2ed596b09f17447.tar.gz
chromium_src-c250d0224a2ff6befb6a1692f2ed596b09f17447.tar.bz2
DevTools: remove extensions-related workaround from the docked devtools window destruction.
Review URL: http://codereview.chromium.org/155206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20139 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/debugger/devtools_window.cc7
-rw-r--r--chrome/browser/extensions/extension_browser_event_router.cc14
2 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index acb87c2..9c5705c 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -91,13 +91,8 @@ void DevToolsWindow::InspectedTabClosing() {
// Update dev tools to reflect removed dev tools window.
inspected_window_->UpdateDevTools();
// In case of docked tab_contents we own it, so delete here.
+ delete tab_contents_;
- // Instead of deleting tab contents, we add it into the
- // stub browser and initiate regular closure;
- Browser* b = Browser::Create(profile_);
- b->tabstrip_model()->AddTabContents(tab_contents_, -1, false,
- PageTransition::START_PAGE, true);
- b->CloseAllTabs();
delete this;
} else {
// First, initiate self-destruct to free all the registrars.
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc
index ad69ba5..89f3951 100644
--- a/chrome/browser/extensions/extension_browser_event_router.cc
+++ b/chrome/browser/extensions/extension_browser_event_router.cc
@@ -268,7 +268,19 @@ void ExtensionBrowserEventRouter::TabUpdated(TabContents* contents,
bool did_navigate) {
int tab_id = ExtensionTabUtil::GetTabId(contents);
std::map<int, TabEntry>::iterator i = tab_entries_.find(tab_id);
- CHECK(tab_entries_.end() != i);
+ if(tab_entries_.end() == i) {
+ // TODO(rafaelw): Unregister EBER on TAB_CONTENTS_DESTROYED in order
+ // not to receive NAV_ENTRY_COMMITTED from objects that are allocated
+ // at the same address as previously deleted TabContents.
+ //
+ // The problem here is that NAV_ENTRY_COMMITTED is issued by the navigation
+ // controller independently from tabstrip model. One should not rely upon
+ // TabStripModelObserver events when registering / unregistering
+ // tab contents events' handlers.
+ registrar_.Remove(this, NotificationType::NAV_ENTRY_COMMITTED,
+ Source<NavigationController>(&contents->controller()));
+ return;
+ }
TabEntry& entry = i->second;
DictionaryValue* changed_properties = NULL;