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

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

Issue 12632004: Revert 186643 - Caused a 10% regression on SunSpider benchmark (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
===================================================================
--- chrome/renderer/resources/extensions/file_system_custom_bindings.js (revision 186747)
+++ chrome/renderer/resources/extensions/file_system_custom_bindings.js (working copy)
@@ -2,19 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Custom binding for the fileSystem API.
+// Custom bindings for the fileSystem API.
-var binding = require('binding').Binding.create('fileSystem');
-
+var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
var fileSystemNatives = requireNative('file_system_natives');
var GetIsolatedFileSystem = fileSystemNatives.GetIsolatedFileSystem;
var lastError = require('lastError');
var entryIdManager = require('entryIdManager');
-binding.registerCustomHook(function(bindingsAPI) {
+chromeHidden.registerCustomHook('fileSystem', function(bindingsAPI) {
var apiFunctions = bindingsAPI.apiFunctions;
- var fileSystem = bindingsAPI.compiledApi;
-
function bindFileEntryFunction(functionName) {
apiFunctions.setUpdateArgumentsPostValidate(
functionName, function(fileEntry, callback) {
@@ -47,12 +44,12 @@
entryIdManager.registerEntry(id, fileEntry);
callback(fileEntry);
}, function(fileError) {
- lastError.run('Error getting fileEntry, code: ' + fileError.code,
- callback);
+ lastError.set('Error getting fileEntry, code: ' + fileError.code);
+ callback();
});
} catch (e) {
- lastError.run('Error in event handler for onLaunched: ' + e.stack,
- callback);
+ lastError.set('Error in event handler for onLaunched: ' + e.stack);
+ callback();
}
}
});
@@ -68,23 +65,21 @@
});
// TODO(benwells): Remove these deprecated versions of the functions.
- fileSystem.getWritableFileEntry = function() {
+ chrome.fileSystem.getWritableFileEntry = function() {
console.log("chrome.fileSystem.getWritableFileEntry is deprecated");
console.log("Please use chrome.fileSystem.getWritableEntry instead");
- fileSystem.getWritableEntry.apply(this, arguments);
+ chrome.fileSystem.getWritableEntry.apply(this, arguments);
};
- fileSystem.isWritableFileEntry = function() {
+ chrome.fileSystem.isWritableFileEntry = function() {
console.log("chrome.fileSystem.isWritableFileEntry is deprecated");
console.log("Please use chrome.fileSystem.isWritableEntry instead");
- fileSystem.isWritableEntry.apply(this, arguments);
+ chrome.fileSystem.isWritableEntry.apply(this, arguments);
};
- fileSystem.chooseFile = function() {
+ chrome.fileSystem.chooseFile = function() {
console.log("chrome.fileSystem.chooseFile is deprecated");
console.log("Please use chrome.fileSystem.chooseEntry instead");
- fileSystem.chooseEntry.apply(this, arguments);
+ chrome.fileSystem.chooseEntry.apply(this, arguments);
};
});
-
-exports.binding = binding.generate();

Powered by Google App Engine
This is Rietveld 408576698