 
 # Tidy up tab caches when tabs are removed.  We cannot rely on unregisterFrame because Chrome does not always
 # provide sender.tab there.
-# NOTE(smblott) (2015-05-05) This may break restoreTab on legacy Chrome versions, but we'll be moving to
-# chrome.sessions support only soon anyway.
 chrome.tabs.onRemoved.addListener (tabId) ->
   delete cache[tabId] for cache in [ frameIdsForTab, urlForTab, tabInfoMap ]
 


# Event handlers
selectionChangedHandlers = []
# Note. tabLoadedHandlers handlers is exported for use also by "marks.coffee".
root.tabLoadedHandlers = {} # tabId -> function()

# A secret, available only within the current instantiation of Vimium.  The secret is big, likely unguessable

  openTabInfo = tabInfoMap[tabId]
  updatePositionsAndWindowsForAllTabsInWindow(openTabInfo.windowId)

  # keep the reference around for a while to wait for the last messages from the closed tab (e.g. for updating
  # scroll position)
  tabInfoMap.deletor = -> delete tabInfoMap[tabId]
  setTimeout tabInfoMap.deletor, 1000
  delete frameIdsForTab[tabId]
  delete urlForTab[tabId]

# End action functions

