Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/background.js

Issue 29723555: Noissue - Make ext._removeFromAllPageMaps private (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created March 15, 2018, 6:23 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
===================================================================
--- a/ext/background.js
+++ b/ext/background.js
@@ -55,21 +55,22 @@
nonEmptyPageMaps.delete(this);
},
delete(page)
{
this._delete(page.id);
}
};
- ext._removeFromAllPageMaps = pageId =>
+ function removeFromAllPageMaps(pageId)
{
for (let pageMap of nonEmptyPageMaps)
pageMap._delete(pageId);
- };
+ }
+
/* Pages */
let Page = ext.Page = function(tab)
{
this.id = tab.id;
this._url = tab.url && new URL(tab.url);
@@ -151,17 +152,17 @@
}
function updatePageFrameStructure(frameId, tabId, url, parentFrameId)
{
if (frameId == 0)
{
let page = new Page({id: tabId, url});
- ext._removeFromAllPageMaps(tabId);
+ removeFromAllPageMaps(tabId);
browser.tabs.get(tabId, () =>
{
// If the tab is prerendered, browser.tabs.get() sets
// browser.runtime.lastError and we have to dispatch the onLoading
// event, since the onUpdated event isn't dispatched for prerendered
// tabs. However, we have to keep relying on the onUpdated event for
// tabs that are already visible. Otherwise browser action changes get
@@ -274,17 +275,17 @@
details.parentFrameId);
}
});
function forgetTab(tabId)
{
ext.pages.onRemoved._dispatch(tabId);
- ext._removeFromAllPageMaps(tabId);
+ removeFromAllPageMaps(tabId);
framesOfTabs.delete(tabId);
}
browser.tabs.onReplaced.addListener((addedTabId, removedTabId) =>
{
forgetTab(removedTabId);
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld