From 1232ee381c8a4e3bccf42fde03a7a2c473dc2a0e Mon Sep 17 00:00:00 2001 From: "bent.mozilla@gmail.com" Date: Fri, 28 Sep 2007 11:15:26 -0700 Subject: [PATCH] Bug 397319 - "Add JSAutoRequest to other users of GetArgvPtr". r+sr+a=jst. --- content/canvas/src/nsCanvasRenderingContext2D.cpp | 4 ++++ content/html/content/src/nsHTMLCanvasElement.cpp | 2 ++ security/manager/ssl/src/nsCrypto.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index 46321bb10ec1..e4cbdc110d31 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -2379,6 +2379,8 @@ nsCanvasRenderingContext2D::GetImageData() ncc->GetArgc(&argc); ncc->GetArgvPtr(&argv); + JSAutoRequest ar(ctx); + int32 x, y, w, h; if (!JS_ConvertArguments (ctx, argc, argv, "jjjj", &x, &y, &w, &h)) return NS_ERROR_DOM_SYNTAX_ERR; @@ -2495,6 +2497,8 @@ nsCanvasRenderingContext2D::PutImageData() ncc->GetArgc(&argc); ncc->GetArgvPtr(&argv); + JSAutoRequest ar(ctx); + JSObject *dataObject; int32 x, y; diff --git a/content/html/content/src/nsHTMLCanvasElement.cpp b/content/html/content/src/nsHTMLCanvasElement.cpp index 0dd827f82a44..ef55ba49466f 100644 --- a/content/html/content/src/nsHTMLCanvasElement.cpp +++ b/content/html/content/src/nsHTMLCanvasElement.cpp @@ -317,6 +317,8 @@ nsHTMLCanvasElement::ToDataURL(nsAString& aDataURL) return ToDataURLImpl(NS_LITERAL_STRING("image/png"), EmptyString(), aDataURL); } + JSAutoRequest ar(ctx); + // 1-arg case; convert to given mime type if (argc == 1) { if (!JSVAL_IS_STRING(argv[0])) diff --git a/security/manager/ssl/src/nsCrypto.cpp b/security/manager/ssl/src/nsCrypto.cpp index 4f1cc4483a5b..2632c52c221d 100644 --- a/security/manager/ssl/src/nsCrypto.cpp +++ b/security/manager/ssl/src/nsCrypto.cpp @@ -1950,6 +1950,7 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMFObject** aReturn) JSObject* script_obj = nsnull; nsCOMPtr holder; + JSAutoRequest ar(cx); /* * Get all of the parameters. @@ -2663,6 +2664,8 @@ nsCrypto::SignText(const nsAString& aStringToSign, const nsAString& aCaOption, jsval *argv = nsnull; ncc->GetArgvPtr(&argv); + JSAutoRequest ar(cx); + PRUint32 i; for (i = 2; i < argc; ++i) { JSString *caName = JS_ValueToString(cx, argv[i]);