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

Unified Diff: lib/filterStorage.js

Issue 6726956523454464: Issue 153 - Reimplement io.js based on OS.File API (Closed)
Patch Set: Created March 21, 2014, 1:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgsubstate ('k') | lib/io.js » ('j') | lib/io.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
===================================================================
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -82,16 +82,22 @@ let FilterStorage = exports.FilterStorag
if (!file)
Cu.reportError("Adblock Plus: Failed to resolve filter file location from extensions.adblockplus.patternsfile preference");
this.__defineGetter__("sourceFile", function() file);
return this.sourceFile;
},
/**
+ * Will be set to true if no patterns.ini file exists.
+ * @type Boolean
+ */
+ firstRun: false,
+
+ /**
* Map of properties listed in the filter storage file before the sections
* start. Right now this should be only the format version.
*/
fileProperties: {__proto__: null},
/**
* List of filter subscriptions containing all filters
* @type Array of Subscription
@@ -461,18 +467,21 @@ let FilterStorage = exports.FilterStorag
{
explicitFile = false;
sourceFile = FilterStorage.sourceFile;
let callback = function(e, statData)
{
if (e || !statData.exists)
{
- let {addonRoot} = require("info");
- sourceFile = Services.io.newURI(addonRoot + "defaults/patterns.ini", null, null);
+ this.firstRun = true;
+ this._loading = false;
+ FilterNotifier.triggerListeners("load");
+
+ TimeLine.leave("FilterStorage.loadFromDisk() read callback done");
}
startRead(sourceFile);
}
if (sourceFile)
IO.statFile(sourceFile, callback);
else
callback(true);
« no previous file with comments | « .hgsubstate ('k') | lib/io.js » ('j') | lib/io.js » ('J')

Powered by Google App Engine
This is Rietveld