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

Unified Diff: chrome/renderer/resources/extensions/sync_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/sync_file_system_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js b/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
index bcb121931316192e5ba2a794bf6052929670aec2..ae904421e254ba78a16225dcd7126f2c12ee7041 100644
--- a/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js
@@ -8,32 +8,31 @@ var binding = require('binding').Binding.create('syncFileSystem');
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
var fileSystemNatives = requireNative('file_system_natives');
+var forEach = require('utils').forEach;
var syncFileSystemNatives = requireNative('sync_file_system');
binding.registerCustomHook(function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
// Functions which take in an [instanceOf=FileEntry].
- function bindFileEntryFunction(functionName) {
+ function bindFileEntryFunction(i, functionName) {
apiFunctions.setUpdateArgumentsPostValidate(
functionName, function(entry, callback) {
var fileSystemUrl = entry.toURL();
return [fileSystemUrl, callback];
});
}
- ['getFileStatus']
- .forEach(bindFileEntryFunction);
+ forEach(['getFileStatus'], bindFileEntryFunction);
// Functions which take in an [instanceOf=DOMFileSystem].
- function bindFileSystemFunction(functionName) {
+ function bindFileSystemFunction(i, functionName) {
apiFunctions.setUpdateArgumentsPostValidate(
functionName, function(filesystem, callback) {
var fileSystemUrl = filesystem.root.toURL();
return [fileSystemUrl, callback];
});
}
- ['deleteFileSystem', 'getUsageAndQuota']
- .forEach(bindFileSystemFunction);
+ forEach(['deleteFileSystem', 'getUsageAndQuota'], bindFileSystemFunction);
// Functions which return an [instanceOf=DOMFileSystem].
apiFunctions.setCustomCallback('requestFileSystem',
« no previous file with comments | « chrome/renderer/resources/extensions/storage_custom_bindings.js ('k') | chrome/renderer/resources/extensions/tag_watcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698