Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: Source/devtools/front_end/TempFile.js

Issue 202623004: DevTools: [JSDoc] Fix function bind()-ing against their @this annotations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unneeded code Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/StylesSidebarPane.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TempFile.js
diff --git a/Source/devtools/front_end/TempFile.js b/Source/devtools/front_end/TempFile.js
index 8adae858cb982efb108e05e8db5dcc1d0813985e..a8e08c019657600b13e49dfbaa1b8a5d9fcf576d 100644
--- a/Source/devtools/front_end/TempFile.js
+++ b/Source/devtools/front_end/TempFile.js
@@ -47,7 +47,7 @@ WebInspector.TempFile = function(dirPath, name, callback)
*/
function didInitFs(fs)
{
- fs.root.getDirectory(dirPath, { create: true }, didGetDir.bind(this), boundErrorHandler);
+ fs.root.getDirectory(dirPath, { create: true }, didGetDir.bind(this), errorHandler);
}
/**
@@ -56,7 +56,7 @@ WebInspector.TempFile = function(dirPath, name, callback)
*/
function didGetDir(dir)
{
- dir.getFile(name, { create: true }, didCreateFile.bind(this), boundErrorHandler);
+ dir.getFile(name, { create: true }, didCreateFile.bind(this), errorHandler);
}
/**
@@ -66,7 +66,7 @@ WebInspector.TempFile = function(dirPath, name, callback)
function didCreateFile(fileEntry)
{
this._fileEntry = fileEntry;
- fileEntry.createWriter(didCreateWriter.bind(this), boundErrorHandler);
+ fileEntry.createWriter(didCreateWriter.bind(this), errorHandler);
}
/**
@@ -85,15 +85,17 @@ WebInspector.TempFile = function(dirPath, name, callback)
writer.onerror = null;
callback(this);
}
+
function onTruncateError(e)
{
WebInspector.console.log("Failed to truncate temp file " + e.code + " : " + e.message,
WebInspector.ConsoleMessage.MessageLevel.Error);
callback(null);
}
+
if (writer.length) {
writer.onwrite = didTruncate.bind(this);
- writer.onerror = onTruncateError.bind(this);
+ writer.onerror = onTruncateError;
writer.truncate(0);
} else {
this._writer = writer;
@@ -108,13 +110,12 @@ WebInspector.TempFile = function(dirPath, name, callback)
callback(null);
}
- var boundErrorHandler = errorHandler.bind(this)
/**
* @this {WebInspector.TempFile}
*/
function didClearTempStorage()
{
- window.requestFileSystem(window.TEMPORARY, 10, didInitFs.bind(this), boundErrorHandler);
+ window.requestFileSystem(window.TEMPORARY, 10, didInitFs.bind(this), errorHandler);
}
WebInspector.TempFile._ensureTempStorageCleared(didClearTempStorage.bind(this));
}
@@ -152,7 +153,6 @@ WebInspector.TempFile.prototype = {
{
/**
* @param {!File} file
- * @this {WebInspector.TempFile}
*/
function didGetFile(file)
{
@@ -178,7 +178,7 @@ WebInspector.TempFile.prototype = {
WebInspector.ConsoleMessage.MessageLevel.Error);
callback(null);
}
- this._fileEntry.file(didGetFile.bind(this), didFailToGetFile.bind(this));
+ this._fileEntry.file(didGetFile, didFailToGetFile);
},
/**
@@ -189,20 +189,21 @@ WebInspector.TempFile.prototype = {
{
/**
* @param {!File} file
- * @this {WebInspector.TempFile}
*/
function didGetFile(file)
{
var reader = new WebInspector.ChunkedFileReader(file, 10*1000*1000, delegate);
reader.start(outputStream);
}
+
function didFailToGetFile(error)
{
WebInspector.console.log("Failed to load temp file: " + error.message,
WebInspector.ConsoleMessage.MessageLevel.Error);
outputStream.close();
}
- this._fileEntry.file(didGetFile.bind(this), didFailToGetFile.bind(this));
+
+ this._fileEntry.file(didGetFile, didFailToGetFile);
},
remove: function()
« no previous file with comments | « Source/devtools/front_end/StylesSidebarPane.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698