Commit 151a4e46 authored by loislo@chromium.org's avatar loislo@chromium.org

DevTools: wrong event was used as an indicator of finished write operation.

FileWriter calls onwrite as notification about the progress of writing.
So If we call write again from the onwrite event handler FileWriter fails to do that.
Actually we need to use onwriteend callback.

BUG=423843

Review URL: https://codereview.chromium.org/661063002

git-svn-id: svn://svn.chromium.org/blink/trunk@183886 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 38e67406
......@@ -81,7 +81,7 @@ WebInspector.TempFile = function(dirPath, name, callback)
function didTruncate(e)
{
this._writer = writer;
writer.onwrite = null;
writer.onwriteend = null;
writer.onerror = null;
callback(this);
}
......@@ -93,7 +93,7 @@ WebInspector.TempFile = function(dirPath, name, callback)
}
if (writer.length) {
writer.onwrite = didTruncate.bind(this);
writer.onwriteend = didTruncate.bind(this);
writer.onerror = onTruncateError;
writer.truncate(0);
} else {
......@@ -128,10 +128,10 @@ WebInspector.TempFile.prototype = {
var blob = new Blob(strings, {type: 'text/plain'});
this._writer.onerror = function(e)
{
WebInspector.console.error("Failed to write into a temp file: " + e.message);
WebInspector.console.error("Failed to write into a temp file: " + e.target.error.message);
callback(false);
}
this._writer.onwrite = function(e)
this._writer.onwriteend = function(e)
{
callback(true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment