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

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

Issue 12287011: Move the chromeHidden.toJSON paranoia out of event.js and into json.js, a new (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fixup Created 7 years, 10 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/send_request.js
diff --git a/chrome/renderer/resources/extensions/send_request.js b/chrome/renderer/resources/extensions/send_request.js
index 5aeb995cb28c76595c3b6c17e5f6cb83cd865749..d689a5b0283d535c74da541cd7a4d2382a187db8 100644
--- a/chrome/renderer/resources/extensions/send_request.js
+++ b/chrome/renderer/resources/extensions/send_request.js
@@ -3,6 +3,7 @@
// found in the LICENSE file.
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
+var json = require('json');
var lastError = require('lastError');
var natives = requireNative('sendRequest');
var validate = require('schemaUtils').validate;
@@ -93,7 +94,7 @@ function sendRequest(functionName, args, argSchemas, optArgs) {
if (optArgs.customCallback) {
request.customCallback = optArgs.customCallback;
}
- // JSON.stringify doesn't support a root object which is undefined.
+ // json.stringify doesn't support a root object which is undefined.
if (request.args === undefined)
request.args = null;
@@ -102,8 +103,7 @@ function sendRequest(functionName, args, argSchemas, optArgs) {
var doStringify = false;
if (optArgs.nativeFunction && !optArgs.noStringify)
doStringify = true;
- var requestArgs = doStringify ?
- chromeHidden.JSON.stringify(request.args) : request.args;
+ var requestArgs = doStringify ? json.stringify(request.args) : request.args;
var nativeFunction = optArgs.nativeFunction || natives.StartRequest;
var requestId = natives.GetNextRequestId();
« no previous file with comments | « chrome/renderer/resources/extensions/miscellaneous_bindings.js ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698