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

Side by Side Diff: ext/background.js

Issue 29996582: Issue 7257 - Throttle badge updates (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Feb. 3, 2019, 6:14 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 | lib/stats.js » ('j') | lib/stats.js » ('J')
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 return frame.parent || null; 518 return frame.parent || null;
519 return frames.get(0) || null; 519 return frames.get(0) || null;
520 } 520 }
521 }; 521 };
522 } 522 }
523 523
524 return ext.onMessage._dispatch( 524 return ext.onMessage._dispatch(
525 message, sender, sendResponse 525 message, sender, sendResponse
526 ).includes(true); 526 ).includes(true);
527 }); 527 });
528
529
530 /* Utilities */
531
532 let Scheduler = ext.Scheduler = function()
533 {
534 this.scheduled = false;
535 };
536 Scheduler.prototype = {
537 schedule(delay, func)
538 {
539 setTimeout(() =>
540 {
541 this.scheduled = false;
542 func();
543 },
544 delay);
545
546 this.scheduled = true;
547 }
548 };
Sebastian Noack 2019/02/03 23:18:03 Please don't add new stuff to ext.*, we eventually
Manish Jethani 2019/02/04 05:33:03 I've moved it into lib/stats.js for now, although
Sebastian Noack 2019/02/04 06:32:04 Well, IMO this pattern isn't worth to be abstracte
Manish Jethani 2019/02/04 06:57:17 Acknowledged.
528 } 549 }
OLDNEW
« no previous file with comments | « no previous file | lib/stats.js » ('j') | lib/stats.js » ('J')

Powered by Google App Engine
This is Rietveld