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

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

Issue 10535030: Allow updateArgumentsPostValidate to support callbacks and added / removed arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit tests Created 8 years, 6 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/storage_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/storage_custom_bindings.js b/chrome/renderer/resources/extensions/storage_custom_bindings.js
index 7d8eaa1ef6307c0f382d329d81941d0bef25be00..ed8368415de94513a580dd946b626632d23bbf25 100644
--- a/chrome/renderer/resources/extensions/storage_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/storage_custom_bindings.js
@@ -5,6 +5,8 @@
// Custom bindings for the storage API.
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
+var normalizeArgumentsAndValidate =
+ require('validateUtils').normalizeArgumentsAndValidate
var sendRequest = require('sendRequest').sendRequest;
chromeHidden.registerCustomType('storage.StorageArea', function() {
@@ -25,7 +27,8 @@ chromeHidden.registerCustomType('storage.StorageArea', function() {
function bindApiFunction(functionName) {
this[functionName] = function() {
var schema = this.parameters[functionName];
- chromeHidden.validate(arguments, schema);
+ var funDef = this.funDefs[functionName];
+ arguments = normalizeArgumentsAndValidate(arguments, funDef);
not at google - send to devlin 2012/06/07 00:17:11 I don't think that overwriting "arguments" is a po
benwells 2012/06/07 01:45:40 Done.
return sendRequest(
'storage.' + functionName,
[namespace].concat(Array.prototype.slice.call(arguments)),

Powered by Google App Engine
This is Rietveld 408576698