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

Unified Diff: chrome/renderer/resources/extensions/file_system_custom_bindings.js

Issue 2794043002: [Extensions Bindings] Move safeCallbackApply to exception handler (Closed)
Patch Set: Created 3 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/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.
« no previous file with comments | « chrome/renderer/resources/extensions/file_entry_binding_util.js ('k') | extensions/renderer/resources/binding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698