function forgetReferrerEventually(tabId) {
  if (g_referrerTimers[tabId]) {
    clearTimeout(g_referrerTimers[tabId]);
  }
  g_referrerTimers[tabId] = setTimeout(() => {
    delete g_referrers[tabId];
    delete g_referrerTimers[tabId];
    delete g_postRequests[tabId];
  }, REFERRER_IN_MEMORY_TIME);
}
This file is one part of the Referer persistency implementation. The other
part resides in chromecom.js.

This file collects Referer headers for every http(s) request, and temporarily
stores the request headers in a dictionary, for REFERRER_IN_MEMORY_TIME ms.

When the viewer is opened, it opens a port ("chromecom-referrer"). This port
is used to set up the webRequest listeners that stick the Referer headers to
the HTTP requests created by this extension. When the port is disconnected,
the webRequest listeners and the referrer information is discarded.

See setReferer in chromecom.js for more explanation of this logic.