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

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

Issue 6615790883176448: Issue 2034 - Respect chrome.webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES (Closed)
Left Patch Set: Renamed function to propagateHandlerBehaviorChange Created April 10, 2015, 6:45 a.m.
Right Patch Set: Renamed overlooked variable name Created April 10, 2015, 7:02 a.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 | webrequest.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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 var handlerBehaviorChangedQuota = chrome.webRequest.MAX_HANDLER_BEHAVIOR_CHANG ED_CALLS_PER_10_MINUTES; 329 var handlerBehaviorChangedQuota = chrome.webRequest.MAX_HANDLER_BEHAVIOR_CHANG ED_CALLS_PER_10_MINUTES;
330 330
331 function propagateHandlerBehaviorChange() 331 function propagateHandlerBehaviorChange()
332 { 332 {
333 // Make sure to not call handlerBehaviorChanged() more often than allowed 333 // Make sure to not call handlerBehaviorChanged() more often than allowed
334 // by chrome.webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES. 334 // by chrome.webRequest.MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES.
335 // Otherwise Chrome notifies the user that this extension is causing issues. 335 // Otherwise Chrome notifies the user that this extension is causing issues.
336 if (handlerBehaviorChangedQuota > 0) 336 if (handlerBehaviorChangedQuota > 0)
337 { 337 {
338 chrome.webNavigation.onBeforeNavigate.removeListener(handlerBehaviorChange d); 338 chrome.webNavigation.onBeforeNavigate.removeListener(propagateHandlerBehav iorChange);
Wladimir Palant 2015/04/10 06:58:14 Feel free to change the name here as well. Please
Sebastian Noack 2015/04/10 07:03:21 Done.
339 chrome.webRequest.handlerBehaviorChanged(); 339 chrome.webRequest.handlerBehaviorChanged();
340 340
341 handlerBehaviorChangedQuota--; 341 handlerBehaviorChangedQuota--;
342 setTimeout(function() { handlerBehaviorChangedQuota++; }, 600000); 342 setTimeout(function() { handlerBehaviorChangedQuota++; }, 600000);
343 } 343 }
344 } 344 }
345 345
346 ext.webRequest = { 346 ext.webRequest = {
347 onBeforeRequest: new ext._EventTarget(), 347 onBeforeRequest: new ext._EventTarget(),
348 handlerBehaviorChanged: function() 348 handlerBehaviorChanged: function()
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 callback(new Page(tab)); 556 callback(new Page(tab));
557 } 557 }
558 else 558 else
559 { 559 {
560 ext.pages.open(optionsUrl, callback); 560 ext.pages.open(optionsUrl, callback);
561 } 561 }
562 }); 562 });
563 }); 563 });
564 }; 564 };
565 })(); 565 })();
LEFTRIGHT
« no previous file | webrequest.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld