| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } |
| OLD | NEW |