summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLContextUtils.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-08-01 08:58:59 +0200
commite7f7100ba6759f30295dbc49f819ebb9c4785298 (patch)
tree939f31b2484c41ec415e9eb56aee1c2934752e65 /dom/canvas/WebGLContextUtils.cpp
parentddb2b976802181e05cb37a94480e9fb42ae6708a (diff)
downloadUXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.gz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.lz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.tar.xz
UXP-e7f7100ba6759f30295dbc49f819ebb9c4785298.zip
Bug 1335296 - Expand about:support WebGL information
Diffstat (limited to 'dom/canvas/WebGLContextUtils.cpp')
-rw-r--r--dom/canvas/WebGLContextUtils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp
index 9c0d34939..3fd32eb30 100644
--- a/dom/canvas/WebGLContextUtils.cpp
+++ b/dom/canvas/WebGLContextUtils.cpp
@@ -874,4 +874,16 @@ InfoFrom(WebGLTexImageFunc func, WebGLTexDimensions dims)
}
}
+JS::Value
+StringValue(JSContext* cx, const nsAString& str, ErrorResult& er)
+{
+ JSString* jsStr = JS_NewUCStringCopyN(cx, str.BeginReading(), str.Length());
+ if (!jsStr) {
+ er.Throw(NS_ERROR_OUT_OF_MEMORY);
+ return JS::NullValue();
+ }
+
+ return JS::StringValue(jsStr);
+}
+
} // namespace mozilla