Chromium Code Reviews| Index: chrome/renderer/resources/extensions/send_request.js |
| diff --git a/chrome/renderer/resources/extensions/send_request.js b/chrome/renderer/resources/extensions/send_request.js |
| index 045e270323f8be406bfcf38c8c9518e990dcecc0..2e79b8a42cbde505a4a1ff6a79beb97fd69fe0dd 100644 |
| --- a/chrome/renderer/resources/extensions/send_request.js |
| +++ b/chrome/renderer/resources/extensions/send_request.js |
| @@ -107,8 +107,13 @@ function sendRequest(functionName, args, argSchemas, opt_args) { |
| if (request.args === undefined) |
| request.args = null; |
| - var sargs = opt_args.noStringify ? |
| - request.args : chromeHidden.JSON.stringify(request.args); |
| + // TODO(asargent) - convert all optional native functions to accept raw |
| + // v8 values instead of expecting JSON strings. |
| + var doStringify = false; |
| + if (opt_args.nativeFunction && !opt_args.noStringify) |
|
asargent_no_longer_on_chrome
2012/05/04 22:42:22
FYI, this line fixes browser test failures I was g
|
| + doStringify = true; |
| + var requestArgs = doStringify ? |
| + chromeHidden.JSON.stringify(request.args) : request.args; |
| var nativeFunction = opt_args.nativeFunction || natives.StartRequest; |
| var requestId = natives.GetNextRequestId(); |
| @@ -116,7 +121,7 @@ function sendRequest(functionName, args, argSchemas, opt_args) { |
| requests[requestId] = request; |
| var hasCallback = |
| (request.callback || opt_args.customCallback) ? true : false; |
| - return nativeFunction(functionName, sargs, requestId, hasCallback, |
| + return nativeFunction(functionName, requestArgs, requestId, hasCallback, |
| opt_args.forIOThread); |
| } |