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

Side by Side Diff: chrome/renderer/resources/extensions/sync_file_system_custom_bindings.js

Issue 22639003: Update sync_file_system.idl to use a regular array instead of an EntryArray (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unskip test in the same patch Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/api/sync_file_system.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom binding for the syncFileSystem API. 5 // Custom binding for the syncFileSystem API.
6 6
7 var binding = require('binding').Binding.create('syncFileSystem'); 7 var binding = require('binding').Binding.create('syncFileSystem');
8 8
9 var eventBindings = require('event_bindings'); 9 var eventBindings = require('event_bindings');
10 var fileSystemNatives = requireNative('file_system_natives'); 10 var fileSystemNatives = requireNative('file_system_natives');
11 var syncFileSystemNatives = requireNative('sync_file_system'); 11 var syncFileSystemNatives = requireNative('sync_file_system');
12 12
13 binding.registerCustomHook(function(bindingsAPI) { 13 binding.registerCustomHook(function(bindingsAPI) {
14 var apiFunctions = bindingsAPI.apiFunctions; 14 var apiFunctions = bindingsAPI.apiFunctions;
15 15
16 // Functions which take in an [instanceOf=FileEntry]. 16 // Functions which take in an [instanceOf=FileEntry].
17 function bindFileEntryFunction(functionName) { 17 function bindFileEntryFunction(functionName) {
18 apiFunctions.setUpdateArgumentsPostValidate( 18 apiFunctions.setUpdateArgumentsPostValidate(
19 functionName, function(entry, callback) { 19 functionName, function(entry, callback) {
20 var fileSystemUrl = entry.toURL(); 20 var fileSystemUrl = entry.toURL();
21 return [fileSystemUrl, callback]; 21 return [fileSystemUrl, callback];
22 }); 22 });
23 } 23 }
24 $Array.forEach(['getFileStatus'], bindFileEntryFunction); 24 $Array.forEach(['getFileStatus'], bindFileEntryFunction);
25 25
26 // Functions which take in an [instanceOf=EntryArray]. 26 // Functions which take in a FileEntry array.
27 function bindFileEntryArrayFunction(functionName) { 27 function bindFileEntryArrayFunction(functionName) {
28 apiFunctions.setUpdateArgumentsPostValidate( 28 apiFunctions.setUpdateArgumentsPostValidate(
29 functionName, function(entries, callback) { 29 functionName, function(entries, callback) {
30 var fileSystemUrlArray = []; 30 var fileSystemUrlArray = [];
31 for (var i=0; i < entries.length; i++) { 31 for (var i=0; i < entries.length; i++) {
32 $Array.push(fileSystemUrlArray, entries[i].toURL()); 32 $Array.push(fileSystemUrlArray, entries[i].toURL());
33 } 33 }
34 return [fileSystemUrlArray, callback]; 34 return [fileSystemUrlArray, callback];
35 }); 35 });
36 } 36 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 fileInfo.fileEntry = fileEntry; 100 fileInfo.fileEntry = fileEntry;
101 fileInfo.status = args[1]; 101 fileInfo.status = args[1];
102 if (fileInfo.status == "synced") { 102 if (fileInfo.status == "synced") {
103 fileInfo.action = args[2]; 103 fileInfo.action = args[2];
104 fileInfo.direction = args[3]; 104 fileInfo.direction = args[3];
105 } 105 }
106 dispatch([fileInfo]); 106 dispatch([fileInfo]);
107 }); 107 });
108 108
109 exports.binding = binding.generate(); 109 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/sync_file_system.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698