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

Unified Diff: lib/storage/io.js

Issue 5442569823584256: Issue 189 - Implement API changes from #117, #153, #192 in Chrome (Closed)
Patch Set: Created April 14, 2014, 7:31 a.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 | « lib/filesystem/io.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/storage/io.js
===================================================================
--- a/lib/storage/io.js
+++ b/lib/storage/io.js
@@ -39,48 +39,37 @@ var IO = exports.IO =
lineBreak: "\n",
resolveFilePath: function(path)
{
return new FakeFile(path);
},
- readFromFile: function(file, decode, listener, callback, timeLineID)
+ readFromFile: function(file, listener, callback, timeLineID)
{
var Utils = require("utils").Utils;
Utils.runAsync(function()
{
- if ("spec" in file && /^defaults\b/.test(file.spec))
- {
- // Code attempts to read the default patterns.ini, we don't have that.
- // Make sure to execute first-run actions instead.
- if (ext.storage.currentVersion)
- seenDataCorruption = true;
- delete ext.storage.currentVersion;
- callback(null);
- return;
- }
-
var path = this._getFilePath(file);
if (!(path in ext.storage))
{
callback(new Error("File doesn't exist"))
return;
}
var lines = ext.storage[path].split(/[\r\n]+/);
for (var i = 0; i < lines.length; i++)
listener.process(lines[i]);
listener.process(null);
callback(null);
}.bind(this));
},
- writeToFile: function(file, encode, data, callback, timeLineID)
+ writeToFile: function(file, data, callback, timeLineID)
{
var path = this._getFilePath(file);
this._setFileContents(path, data.join(this.lineBreak) + this.lineBreak, Date.now());
var Utils = require("utils").Utils;
Utils.runAsync(callback, null, null);
},
« no previous file with comments | « lib/filesystem/io.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld