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

Side by Side Diff: lib/filesystem/io.js

Issue 6468765319430144: Issue 417 - Reinitializing removed filter lists (Platform) (Closed)
Patch Set: Fixed: Message also appeared on first-run Created May 27, 2014, 12:07 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 listener.process(null); 62 listener.process(null);
63 callback(null); 63 callback(null);
64 }.bind(this)); 64 }.bind(this));
65 return; 65 return;
66 } 66 }
67 67
68 this._getFileEntry(file, false, function(fs, fileEntry) 68 this._getFileEntry(file, false, function(fs, fileEntry)
69 { 69 {
70 fileEntry.file(function(file) 70 fileEntry.file(function(file)
71 { 71 {
72 if (file.size == 0)
73 {
74 callback("File is empty");
75 return;
76 }
77
72 var reader = new FileReader(); 78 var reader = new FileReader();
73 reader.onloadend = function() 79 reader.onloadend = function()
74 { 80 {
75 if (reader.error) 81 if (reader.error)
76 callback(reader.error); 82 callback(reader.error);
77 else 83 else
78 { 84 {
79 var lines = reader.result.split(/[\r\n]+/); 85 var lines = reader.result.split(/[\r\n]+/);
80 for (var i = 0; i < lines.length; i++) 86 for (var i = 0; i < lines.length; i++)
81 listener.process(lines[i]); 87 listener.process(lines[i]);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 exists: true, 204 exists: true,
199 isDirectory: fileEntry.isDirectory, 205 isDirectory: fileEntry.isDirectory,
200 isFile: fileEntry.isFile, 206 isFile: fileEntry.isFile,
201 lastModified: metadata.modificationTime.getTime() 207 lastModified: metadata.modificationTime.getTime()
202 }); 208 });
203 }, callback); 209 }, callback);
204 }, callback); 210 }, callback);
205 }.bind(this)); 211 }.bind(this));
206 } 212 }
207 }; 213 };
OLDNEW
« no previous file with comments | « background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld