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 50373b3fef5e5d79480fced8b10b453c85f622df..431ffd21e1299199a81f29a3cd1b398bc3f23f2f 100644 |
--- a/chrome/renderer/resources/extensions/file_system_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/file_system_custom_bindings.js |
@@ -13,6 +13,7 @@ var fileBindings = getFileBindingsForApi('fileSystem'); |
var bindFileEntryCallback = fileBindings.bindFileEntryCallback; |
var entryIdManager = fileBindings.entryIdManager; |
var fileSystemNatives = requireNative('file_system_natives'); |
+var safeCallbackApply = require('uncaught_exception_handler').safeCallbackApply; |
binding.registerCustomHook(function(bindingsAPI) { |
var apiFunctions = bindingsAPI.apiFunctions; |
@@ -50,11 +51,7 @@ binding.registerCustomHook(function(bindingsAPI) { |
function(id, callback) { |
var savedEntry = entryIdManager.getEntryById(id); |
if (savedEntry) { |
- sendRequest.safeCallbackApply( |
- 'fileSystem.isRestorable', |
- {}, |
- callback, |
- [true]); |
+ safeCallbackApply('fileSystem.isRestorable', {}, callback, [true]); |
} else { |
sendRequest.sendRequest( |
this.name, [id, callback], this.definition.parameters); |
@@ -67,11 +64,7 @@ binding.registerCustomHook(function(bindingsAPI) { |
if (savedEntry) { |
// We already have a file entry for this id so pass it to the callback and |
// send a request to the browser to move it to the back of the LRU. |
- sendRequest.safeCallbackApply( |
- 'fileSystem.restoreEntry', |
- {}, |
- callback, |
- [savedEntry]); |
+ safeCallbackApply('fileSystem.restoreEntry', {}, callback, [savedEntry]); |
return [id, false, null]; |
} else { |
// Ask the browser process for a new file entry for this id, to be passed |
@@ -87,11 +80,8 @@ binding.registerCustomHook(function(bindingsAPI) { |
fileSystem = fileSystemNatives.GetIsolatedFileSystem( |
response.file_system_id, response.file_system_path); |
} |
- sendRequest.safeCallbackApply( |
- 'fileSystem.requestFileSystem', |
- request, |
- callback, |
- [fileSystem]); |
+ safeCallbackApply('fileSystem.requestFileSystem', request, callback, |
+ [fileSystem]); |
}); |
// TODO(benwells): Remove these deprecated versions of the functions. |