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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more progress Created 7 years, 11 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
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 bindings for the syncFileSystem API. 5 // Custom bindings for the syncFileSystem API.
6 6
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var Bindings = require('schema_binding_generator').Bindings;
8 var bindings = new Bindings('syncFileSystem');
9
8 var syncFileSystemNatives = requireNative('sync_file_system'); 10 var syncFileSystemNatives = requireNative('sync_file_system');
9 11
10 chromeHidden.registerCustomHook('syncFileSystem', function(bindingsAPI) { 12 bindings.registerCustomHook('syncFileSystem', function(bindingsAPI) {
11 var apiFunctions = bindingsAPI.apiFunctions; 13 var apiFunctions = bindingsAPI.apiFunctions;
12 14
13 // Functions which take in an [instanceOf=FileEntry]. 15 // Functions which take in an [instanceOf=FileEntry].
14 function bindFileEntryFunction(functionName) { 16 function bindFileEntryFunction(functionName) {
15 apiFunctions.setUpdateArgumentsPostValidate( 17 apiFunctions.setUpdateArgumentsPostValidate(
16 functionName, function(entry, callback) { 18 functionName, function(entry, callback) {
17 var fileSystemUrl = entry.toURL(); 19 var fileSystemUrl = entry.toURL();
18 return [fileSystemUrl, callback]; 20 return [fileSystemUrl, callback];
19 }); 21 });
20 } 22 }
(...skipping 17 matching lines...) Expand all
38 var result = null; 40 var result = null;
39 if (response) { 41 if (response) {
40 result = syncFileSystemNatives.GetSyncFileSystemObject( 42 result = syncFileSystemNatives.GetSyncFileSystemObject(
41 response.name, response.root); 43 response.name, response.root);
42 } 44 }
43 if (request.callback) 45 if (request.callback)
44 request.callback(result); 46 request.callback(result);
45 request.callback = null; 47 request.callback = null;
46 }); 48 });
47 }); 49 });
50
51 exports.bindings = bindings.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698