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

Delta Between Two Patch Sets: chrome/ext/background.js

Issue 29357576: Issue 4483 - Update page structure when sitekey is received (Closed)
Left Patch Set: Avoid updating the page structure twice Created Oct. 17, 2016, 11:03 a.m.
Right Patch Set: Create page on one line Created Oct. 19, 2016, 12:36 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/whitelisting.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 var frame = createFrame(details.tabId, details.frameId); 129 var frame = createFrame(details.tabId, details.frameId);
130 frame.parent = framesOfTabs[details.tabId][details.parentFrameId] || null; 130 frame.parent = framesOfTabs[details.tabId][details.parentFrameId] || null;
131 }); 131 });
132 132
133 var eagerlyUpdatedPages = new ext.PageMap(); 133 var eagerlyUpdatedPages = new ext.PageMap();
134 134
135 ext._updatePageFrameStructure = function(frameId, tabId, url, eager) 135 ext._updatePageFrameStructure = function(frameId, tabId, url, eager)
136 { 136 {
137 if (frameId == 0) 137 if (frameId == 0)
138 { 138 {
139 let page = new Page({ 139 let page = new Page({id: tabId, url: url});
Sebastian Noack 2016/10/18 13:20:10 Nit: This doesn't need to be wrapped.
kzar 2016/10/19 12:36:58 Done.
140 id: tabId,
141 url: url
142 });
143 140
144 if (eagerlyUpdatedPages.get(page) != url) 141 if (eagerlyUpdatedPages.get(page) != url)
145 { 142 {
146 ext._removeFromAllPageMaps(tabId); 143 ext._removeFromAllPageMaps(tabId);
147 144
148 // When a sitekey header is received we must immediately update the page 145 // When a sitekey header is received we must immediately update the page
149 // structure in order to record and use the key. We want to avoid 146 // structure in order to record and use the key. We want to avoid
150 // trashing the page structure if the onCommitted event is then fired 147 // trashing the page structure if the onCommitted event is then fired
151 // for the page. 148 // for the page.
152 if (eager) 149 if (eager)
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 ext.windows = { 639 ext.windows = {
643 create: function(createData, callback) 640 create: function(createData, callback)
644 { 641 {
645 chrome.windows.create(createData, function(createdWindow) 642 chrome.windows.create(createData, function(createdWindow)
646 { 643 {
647 afterTabLoaded(callback)(createdWindow.tabs[0]); 644 afterTabLoaded(callback)(createdWindow.tabs[0]);
648 }); 645 });
649 } 646 }
650 }; 647 };
651 })(); 648 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld