OLD | NEW |
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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 readFromFile: function(file, decode, listener, callback, timeLineID) | 47 readFromFile: function(file, decode, listener, callback, timeLineID) |
48 { | 48 { |
49 var Utils = require("utils").Utils; | 49 var Utils = require("utils").Utils; |
50 Utils.runAsync(function() | 50 Utils.runAsync(function() |
51 { | 51 { |
52 if ("spec" in file && /^defaults\b/.test(file.spec)) | 52 if ("spec" in file && /^defaults\b/.test(file.spec)) |
53 { | 53 { |
54 // Code attempts to read the default patterns.ini, we don't have that. | 54 // Code attempts to read the default patterns.ini, we don't have that. |
55 // Make sure to execute first-run actions instead. | 55 // Make sure to execute first-run actions instead. |
56 callback(null); | |
57 if (localStorage.currentVersion) | 56 if (localStorage.currentVersion) |
58 seenDataCorruption = true; | 57 seenDataCorruption = true; |
59 delete localStorage.currentVersion; | 58 delete localStorage.currentVersion; |
| 59 callback(null); |
60 return; | 60 return; |
61 } | 61 } |
62 | 62 |
63 var path = this._getFilePath(file); | 63 var path = this._getFilePath(file); |
64 if (!(path in window.localStorage)) | 64 if (!(path in window.localStorage)) |
65 { | 65 { |
66 callback(new Error("File doesn't exist")) | 66 callback(new Error("File doesn't exist")) |
67 return; | 67 return; |
68 } | 68 } |
69 | 69 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 { | 128 { |
129 var path = this._getFilePath(file); | 129 var path = this._getFilePath(file); |
130 callback(null, { | 130 callback(null, { |
131 exists: path in window.localStorage, | 131 exists: path in window.localStorage, |
132 isDirectory: false, | 132 isDirectory: false, |
133 isFile: true, | 133 isFile: true, |
134 lastModified: parseInt(window.localStorage[path + "/lastModified"], 10) ||
0 | 134 lastModified: parseInt(window.localStorage[path + "/lastModified"], 10) ||
0 |
135 }); | 135 }); |
136 } | 136 } |
137 }; | 137 }; |
OLD | NEW |