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

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

Issue 287673004: [fsp] First part of support for reading files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/file_system_provider_internal.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 fileSystemProvider API. 5 // Custom binding for the fileSystemProvider API.
6 6
7 var binding = require('binding').Binding.create('fileSystemProvider'); 7 var binding = require('binding').Binding.create('fileSystemProvider');
8 var fileSystemProviderInternal = 8 var fileSystemProviderInternal =
9 require('binding').Binding.create('fileSystemProviderInternal').generate(); 9 require('binding').Binding.create('fileSystemProviderInternal').generate();
10 var eventBindings = require('event_bindings'); 10 var eventBindings = require('event_bindings');
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 var mode = args[3]; 170 var mode = args[3];
171 var create = args[4]; 171 var create = args[4];
172 var onSuccessCallback = function() { 172 var onSuccessCallback = function() {
173 fileSystemProviderInternal.openFileRequestedSuccess( 173 fileSystemProviderInternal.openFileRequestedSuccess(
174 fileSystemId, requestId); 174 fileSystemId, requestId);
175 }; 175 };
176 var onErrorCallback = function(error) { 176 var onErrorCallback = function(error) {
177 fileSystemProviderInternal.openFileRequestedError( 177 fileSystemProviderInternal.openFileRequestedError(
178 fileSystemId, requestId, error); 178 fileSystemId, requestId, error);
179 } 179 }
180 dispatch([fileSystemId, filePath, mode, create, onSuccessCallback, 180 dispatch([fileSystemId, requestId, filePath, mode, create,
181 onSuccessCallback, onErrorCallback]);
182 });
183
184 eventBindings.registerArgumentMassager(
185 'fileSystemProvider.onCloseFileRequested',
186 function(args, dispatch) {
187 var fileSystemId = args[0];
188 var requestId = args[1];
189 var openRequestId = args[2];
190 var onSuccessCallback = function() {
191 fileSystemProviderInternal.closeFileRequestedSuccess(
192 fileSystemId, requestId);
193 };
194 var onErrorCallback = function(error) {
195 fileSystemProviderInternal.closeFileRequestedError(
196 fileSystemId, requestId, error);
197 }
198 dispatch([fileSystemId, openRequestId, openRequestId, onSuccessCallback,
181 onErrorCallback]); 199 onErrorCallback]);
182 }); 200 });
183 201
202 eventBindings.registerArgumentMassager(
203 'fileSystemProvider.onReadFileRequested',
204 function(args, dispatch) {
205 var fileSystemId = args[0];
206 var requestId = args[1];
207 var openRequestId = args[2];
208 var offset = args[3];
209 var length = args[4];
210 var onSuccessCallback = function(data, hasNext) {
211 fileSystemProviderInternal.readFileRequestedSuccess(
212 fileSystemId, requestId, data, hasNext);
213 };
214 var onErrorCallback = function(error) {
215 fileSystemProviderInternal.readFileRequestedError(
216 fileSystemId, requestId, error);
217 }
218 dispatch([fileSystemId, openRequestId, offset, length, onSuccessCallback,
219 onErrorCallback]);
220 });
221
184 exports.binding = binding.generate(); 222 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/file_system_provider_internal.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698