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

Delta Between Two Patch Sets: lib/downloader.js

Issue 6013081427640320: Issue 537 - Mark first few downloads (Closed)
Left Patch Set: Created Nov. 11, 2014, 5:14 p.m.
Right Patch Set: Created Nov. 11, 2014, 5:41 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/notification.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 <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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 getDownloadUrl: function(/**Downloadable*/ downloadable) /** String*/ 186 getDownloadUrl: function(/**Downloadable*/ downloadable) /** String*/
187 { 187 {
188 let {addonName, addonVersion, application, applicationVersion, platform, pla tformVersion} = require("info"); 188 let {addonName, addonVersion, application, applicationVersion, platform, pla tformVersion} = require("info");
189 let url = downloadable.redirectURL || downloadable.url; 189 let url = downloadable.redirectURL || downloadable.url;
190 if (url.indexOf("?") >= 0) 190 if (url.indexOf("?") >= 0)
191 url += "&"; 191 url += "&";
192 else 192 else
193 url += "?"; 193 url += "?";
194 // We limit the download count to 4+ to keep the request anonymized 194 // We limit the download count to 4+ to keep the request anonymized
195 let downloadCount = downloadable.downloadCount; 195 let downloadCount = downloadable.downloadCount;
196 if (downloadable.downloadCount > 4) 196 if (downloadCount > 4)
Wladimir Palant 2014/11/11 17:28:16 No need to reference downloadable again here, just
Thomas Greiner 2014/11/11 17:53:18 Sorry, I missed that. Done.
197 downloadCount = "4+"; 197 downloadCount = "4+";
198 url += "addonName=" + encodeURIComponent(addonName) + 198 url += "addonName=" + encodeURIComponent(addonName) +
199 "&addonVersion=" + encodeURIComponent(addonVersion) + 199 "&addonVersion=" + encodeURIComponent(addonVersion) +
200 "&application=" + encodeURIComponent(application) + 200 "&application=" + encodeURIComponent(application) +
201 "&applicationVersion=" + encodeURIComponent(applicationVersion) + 201 "&applicationVersion=" + encodeURIComponent(applicationVersion) +
202 "&platform=" + encodeURIComponent(platform) + 202 "&platform=" + encodeURIComponent(platform) +
203 "&platformVersion=" + encodeURIComponent(platformVersion) + 203 "&platformVersion=" + encodeURIComponent(platformVersion) +
204 "&lastVersion=" + encodeURIComponent(downloadable.lastVersion) + 204 "&lastVersion=" + encodeURIComponent(downloadable.lastVersion) +
205 "&downloadCount=" + encodeURIComponent(downloadCount); 205 "&downloadCount=" + encodeURIComponent(downloadCount);
206 return url; 206 return url;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 * @type Integer 385 * @type Integer
386 */ 386 */
387 hardExpiration: 0, 387 hardExpiration: 0,
388 388
389 /** 389 /**
390 * Number indicating how often the object was downloaded. 390 * Number indicating how often the object was downloaded.
391 * @type Integer 391 * @type Integer
392 */ 392 */
393 downloadCount: 0, 393 downloadCount: 0,
394 }; 394 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld