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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 resolveFilePath: function(path) | 50 resolveFilePath: function(path) |
51 { | 51 { |
52 return new FakeFile(path); | 52 return new FakeFile(path); |
53 }, | 53 }, |
54 readFromFile: function(file, decode, listener, callback, timeLineID) | 54 readFromFile: function(file, decode, listener, callback, timeLineID) |
55 { | 55 { |
56 if ("spec" in file && /^defaults\b/.test(file.spec)) | 56 if ("spec" in file && /^defaults\b/.test(file.spec)) |
57 { | 57 { |
58 // Code attempts to read the default patterns.ini, we don't have that. | 58 // Code attempts to read the default patterns.ini, we don't have that. |
59 // Make sure to execute first-run actions instead. | 59 // Make sure to execute first-run actions instead. |
60 callback(null); | 60 var Utils = require("utils").Utils; |
61 if (localStorage.currentVersion) | 61 Utils.runAsync(function() |
62 seenDataCorruption = true; | 62 { |
63 delete localStorage.currentVersion; | 63 if (localStorage.currentVersion) |
| 64 seenDataCorruption = true; |
| 65 callback(null) |
| 66 }); |
64 return; | 67 return; |
65 } | 68 } |
66 | 69 |
67 var path = this._getFilePath(file); | 70 var path = this._getFilePath(file); |
68 var runAsync = require("utils").Utils.runAsync; | 71 var runAsync = require("utils").Utils.runAsync; |
69 | 72 |
70 this._transaction(function(tx) | 73 this._transaction(function(tx) |
71 { | 74 { |
72 tx.executeSql( | 75 tx.executeSql( |
73 "SELECT content FROM files WHERE path = ?", | 76 "SELECT content FROM files WHERE path = ?", |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 exists: true, | 189 exists: true, |
187 isDirectory: false, | 190 isDirectory: false, |
188 isFile: true, | 191 isFile: true, |
189 lastModified: results.rows.item(0).last_modified | 192 lastModified: results.rows.item(0).last_modified |
190 }); | 193 }); |
191 } | 194 } |
192 ); | 195 ); |
193 }); | 196 }); |
194 } | 197 } |
195 }; | 198 }; |
OLD | NEW |