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

Side by Side Diff: chrome/ext/background.js

Issue 29372398: Issue 4804 - Avoid trashing pagemaps prematurely (Closed)
Patch Set: Created Jan. 18, 2017, 8:08 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 return frame; 123 return frame;
124 } 124 }
125 125
126 function updatePageFrameStructure(frameId, tabId, url) 126 function updatePageFrameStructure(frameId, tabId, url)
127 { 127 {
128 if (frameId == 0) 128 if (frameId == 0)
129 { 129 {
130 let page = new Page({id: tabId, url: url}); 130 let page = new Page({id: tabId, url: url});
131 131
132 ext._removeFromAllPageMaps(tabId);
kzar 2017/01/18 08:12:09 I can't see why to remove the tabId from the pageM
Sebastian Noack 2017/01/18 11:58:31 The Page and PageMap objects abstract the concept
133
134 chrome.tabs.get(tabId, function() 132 chrome.tabs.get(tabId, function()
135 { 133 {
136 // If the tab is prerendered, chrome.tabs.get() sets 134 // If the tab is prerendered, chrome.tabs.get() sets
137 // chrome.runtime.lastError and we have to dispatch the onLoading event, 135 // chrome.runtime.lastError and we have to dispatch the onLoading event,
138 // since the onUpdated event isn't dispatched for prerendered tabs. 136 // since the onUpdated event isn't dispatched for prerendered tabs.
139 // However, we have to keep relying on the unUpdated event for tabs that 137 // However, we have to keep relying on the unUpdated event for tabs that
140 // are already visible. Otherwise browser action changes get overridden 138 // are already visible. Otherwise browser action changes get overridden
141 // when Chrome automatically resets them on navigation. 139 // when Chrome automatically resets them on navigation.
142 if (chrome.runtime.lastError) 140 if (chrome.runtime.lastError)
143 ext.pages.onLoading._dispatch(page); 141 ext.pages.onLoading._dispatch(page);
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 ext.windows = { 589 ext.windows = {
592 create: function(createData, callback) 590 create: function(createData, callback)
593 { 591 {
594 chrome.windows.create(createData, function(createdWindow) 592 chrome.windows.create(createData, function(createdWindow)
595 { 593 {
596 afterTabLoaded(callback)(createdWindow.tabs[0]); 594 afterTabLoaded(callback)(createdWindow.tabs[0]);
597 }); 595 });
598 } 596 }
599 }; 597 };
600 })(); 598 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld