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

Delta Between Two Patch Sets: chrome/content/ui/sendReport.js

Issue 5410618009976832: issue #690 - don't consider special subscriptions when complaining about high subscription count (Closed)
Left Patch Set: Created July 28, 2014, 9:41 a.m.
Right Patch Set: Created July 30, 2014, 6:06 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 | no next file » | 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 collectData: function(wnd, windowURI, callback) 745 collectData: function(wnd, windowURI, callback)
746 { 746 {
747 this.contentWnd = wnd; 747 this.contentWnd = wnd;
748 let now = Date.now() / MILLISECONDS_IN_SECOND; 748 let now = Date.now() / MILLISECONDS_IN_SECOND;
749 let outdatedThreshold = now - 14 * SECONDS_IN_DAY; 749 let outdatedThreshold = now - 14 * SECONDS_IN_DAY;
750 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR; 750 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR;
751 751
752 this.outdated = []; 752 this.outdated = [];
753 this.needUpdate = []; 753 this.needUpdate = [];
754 754
755 let subscriptions = FilterStorage.subscriptions.filter(subscriptionUpdateDat aSource.subscriptionFilter); 755 let subscriptions = FilterStorage.subscriptions.filter(this.subscriptionFilt er);
Wladimir Palant 2014/07/30 05:44:35 this.subscriptionFilter please.
saroyanm 2014/07/30 06:11:58 Oops.
756 for (let i = 0; i < subscriptions.length; i++) 756 for (let i = 0; i < subscriptions.length; i++)
757 { 757 {
758 let lastSuccess = subscriptions[i].lastSuccess; 758 let lastSuccess = subscriptions[i].lastSuccess;
759 if (lastSuccess < outdatedThreshold) 759 if (lastSuccess < outdatedThreshold)
760 this.outdated.push(subscriptions[i]); 760 this.outdated.push(subscriptions[i]);
761 if (lastSuccess < needUpdateThreshold) 761 if (lastSuccess < needUpdateThreshold)
762 this.needUpdate.push(subscriptions[i]); 762 this.needUpdate.push(subscriptions[i]);
763 } 763 }
764 764
765 callback(); 765 callback();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 isEnabled: Prefs.enabled, 885 isEnabled: Prefs.enabled,
886 whitelistFilter: null, 886 whitelistFilter: null,
887 disabledFilters: [], 887 disabledFilters: [],
888 disabledSubscriptions: [], 888 disabledSubscriptions: [],
889 ownFilters: [], 889 ownFilters: [],
890 numSubscriptions: 0, 890 numSubscriptions: 0,
891 numAppliedFilters: Infinity, 891 numAppliedFilters: Infinity,
892 892
893 subscriptionFilter: function(s) 893 subscriptionFilter: function(s)
894 { 894 {
895 if (s instanceof DownloadableSubscription && s.url != Prefs.subscriptions_ex ceptionsurl 895 if (s instanceof DownloadableSubscription &&
896 && s.url != Prefs.subscriptions_antiadblockurl) 896 s.url != Prefs.subscriptions_exceptionsurl &&
Wladimir Palant 2014/07/30 05:44:35 Please try to keep the lines shorter than 80 chara
saroyanm 2014/07/30 06:11:58 Thanks, done.
897 s.url != Prefs.subscriptions_antiadblockurl)
898 {
897 return subscriptionsDataSource.subscriptionFilter(s); 899 return subscriptionsDataSource.subscriptionFilter(s);
900 }
898 else 901 else
899 return false; 902 return false;
900 }, 903 },
901 904
902 collectData: function(wnd, windowURI, callback) 905 collectData: function(wnd, windowURI, callback)
903 { 906 {
904 this.contentWnd = wnd; 907 this.contentWnd = wnd;
905 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); 908 this.whitelistFilter = Policy.isWindowWhitelisted(wnd);
906 909
907 if (!this.whitelistFilter && this.isEnabled) 910 if (!this.whitelistFilter && this.isEnabled)
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 1574
1572 function censorURL(url) 1575 function censorURL(url)
1573 { 1576 {
1574 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); 1577 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*");
1575 } 1578 }
1576 1579
1577 function encodeHTML(str) 1580 function encodeHTML(str)
1578 { 1581 {
1579 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;"); 1582 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;");
1580 } 1583 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld