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

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

Issue 10890002: Make V8ValueConverter.FromV8Value behave similarly to JSON.stringify (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use the actual objects, not empty objects Created 8 years, 3 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/context_menus_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/context_menus_custom_bindings.js b/chrome/renderer/resources/extensions/context_menus_custom_bindings.js
index 9e4016a468b138375d96b4205388cd21bd739f7d..9bc788c2c67210629b8bbc07ffe30e4e8f7b9bd3 100644
--- a/chrome/renderer/resources/extensions/context_menus_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/context_menus_custom_bindings.js
@@ -48,10 +48,14 @@ chromeHidden.registerCustomHook('contextMenus', function(bindingsAPI) {
var args = arguments;
var id = GetNextContextMenuId();
args[0].generatedId = id;
- sendRequest(this.name,
- args,
- this.definition.parameters,
- {customCallback: this.customCallback});
+ var optArgs = {
+ customCallback: this.customCallback,
+ // Functions aren't usually serializable, but the browser needs to know
+ // if there's an onclick handler, so convert it to an object.
+ // TODO(kalman): write this custom binding in such a way that we don't.
+ allowFunctionsInObjects: true
+ };
+ sendRequest(this.name, args, this.definition.parameters, optArgs);
return chromeHidden.contextMenus.getIdFromCreateProperties(args[0]);
});

Powered by Google App Engine
This is Rietveld 408576698