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

Unified Diff: chrome/renderer/resources/extensions/file_system_custom_bindings.js

Issue 12440030: Use utils.forEach everywhere rather than Array.prototype.forEach to guard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make foreach of an array give numbers Created 7 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
Index: chrome/renderer/resources/extensions/file_system_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/file_system_custom_bindings.js b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
index 6a3443949f7d4007dcfa5589d4d67e5ea3ce67fd..123eabe782e3559ee00beb4dfd8e6a32b7a424e4 100644
--- a/chrome/renderer/resources/extensions/file_system_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js
@@ -6,16 +6,17 @@
var binding = require('binding').Binding.create('fileSystem');
+var entryIdManager = require('entryIdManager');
var fileSystemNatives = requireNative('file_system_natives');
+var forEach = require('utils').forEach;
var GetIsolatedFileSystem = fileSystemNatives.GetIsolatedFileSystem;
var lastError = require('lastError');
-var entryIdManager = require('entryIdManager');
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
var fileSystem = bindingsAPI.compiledApi;
- function bindFileEntryFunction(functionName) {
+ function bindFileEntryFunction(i, functionName) {
apiFunctions.setUpdateArgumentsPostValidate(
functionName, function(fileEntry, callback) {
var fileSystemName = fileEntry.filesystem.name;
@@ -23,10 +24,10 @@ binding.registerCustomHook(function(bindingsAPI) {
return [fileSystemName, relativePath, callback];
});
}
- ['getDisplayPath', 'getWritableEntry', 'isWritableEntry']
- .forEach(bindFileEntryFunction);
+ forEach(['getDisplayPath', 'getWritableEntry', 'isWritableEntry'],
+ bindFileEntryFunction);
- function bindFileEntryCallback(functionName) {
+ function bindFileEntryCallback(i, functionName) {
apiFunctions.setCustomCallback(functionName,
function(name, request, response) {
if (request.callback && response) {
@@ -57,7 +58,7 @@ binding.registerCustomHook(function(bindingsAPI) {
}
});
}
- ['getWritableEntry', 'chooseEntry'].forEach(bindFileEntryCallback);
+ forEach(['getWritableEntry', 'chooseEntry'], bindFileEntryCallback);
apiFunctions.setHandleRequest('getEntryId', function(fileEntry) {
return entryIdManager.getEntryId(fileEntry);

Powered by Google App Engine
This is Rietveld 408576698