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

Delta Between Two Patch Sets: lib/subscriptionInit.js

Issue 29760565: Issue 6599 - Detect data corruption of storage.local (Closed)
Left Patch Set: Added comment, fixed typo Created April 27, 2018, 4 p.m.
Right Patch Set: Fixed blocked_total optimization logic Created April 27, 2018, 4:55 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 | « lib/prefs.js ('k') | lib/uninstall.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-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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 Promise.all([ 271 Promise.all([
272 FilterNotifier.once("load"), 272 FilterNotifier.once("load"),
273 Prefs.untilLoaded.catch(() => { dataCorrupted = true; }) 273 Prefs.untilLoaded.catch(() => { dataCorrupted = true; })
274 ]).then(detectFirstRun) 274 ]).then(detectFirstRun)
275 .then(getSubscriptions) 275 .then(getSubscriptions)
276 .then(addSubscriptionsAndNotifyUser) 276 .then(addSubscriptionsAndNotifyUser)
277 // We have to require the "uninstall" module on demand, 277 // We have to require the "uninstall" module on demand,
278 // as the "uninstall" module in turn requires this module. 278 // as the "uninstall" module in turn requires this module.
279 .then(() => { require("./uninstall").setUninstallURL() }) 279 .then(() => { require("./uninstall").setUninstallURL(); })
280 .then(initNotifications); 280 .then(initNotifications);
281 281
282 /** 282 /**
283 * Gets a value indicating whether the default filter subscriptions have been 283 * Gets a value indicating whether the default filter subscriptions have been
284 * added again because there weren't any subscriptions even though this wasn't 284 * added again because there weren't any subscriptions even though this wasn't
285 * the first run. 285 * the first run.
286 * 286 *
287 * @return {boolean} 287 * @return {boolean}
288 */ 288 */
289 exports.isReinitialized = () => reinitialized; 289 exports.isReinitialized = () => reinitialized;
290 290
291 /** 291 /**
292 * Gets a value indicating whether a data corruption was detected. 292 * Gets a value indicating whether a data corruption was detected.
293 * 293 *
294 * @return {boolean} 294 * @return {boolean}
295 */ 295 */
296 exports.isDataCorrupted = () => dataCorrupted; 296 exports.isDataCorrupted = () => dataCorrupted;
297 297
298 /** 298 /**
299 * Sets a callback that is called with an array of subscriptions to be added 299 * Sets a callback that is called with an array of subscriptions to be added
300 * during initialization. The callback must return an array of subscriptions 300 * during initialization. The callback must return an array of subscriptions
301 * that will effectively be added. 301 * that will effectively be added.
302 * 302 *
303 * @param {function} callback 303 * @param {function} callback
304 */ 304 */
305 exports.setSubscriptionsCallback = callback => 305 exports.setSubscriptionsCallback = callback =>
306 { 306 {
307 subscriptionsCallback = callback; 307 subscriptionsCallback = callback;
308 }; 308 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld