Index: Source/core/html/HTMLCanvasElement.cpp |
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp |
index 227a1476edc32f937410fde7ec2c35da21b8f0f4..eb9387efab7a0bce3ff4292b6e1162de2ad62aa8 100644 |
--- a/Source/core/html/HTMLCanvasElement.cpp |
+++ b/Source/core/html/HTMLCanvasElement.cpp |
@@ -469,14 +469,22 @@ String HTMLCanvasElement::toDataURLInternal(const String& mimeType, const double |
return buffer()->toDataURL(encodingMimeType, quality); |
} |
-String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState) const |
+String HTMLCanvasElement::toDataURL(const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState) const |
{ |
if (!originClean()) { |
exceptionState.throwSecurityError("Tainted canvases may not be exported."); |
return String(); |
} |
- |
- return toDataURLInternal(mimeType, quality, BackBuffer); |
+ double quality; |
+ double* qualityPtr = nullptr; |
+ if (!qualityArgument.isEmpty()) { |
+ v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); |
+ if (v8Value->IsNumber()) { |
+ quality = v8Value.As<v8::Number>()->Value(); |
Jens Widell
2015/02/11 15:13:08
quality = v8Value->NumberValue();
|
+ qualityPtr = &quality; |
+ } |
+ } |
+ return toDataURLInternal(mimeType, qualityPtr, BackBuffer); |
} |
SecurityOrigin* HTMLCanvasElement::securityOrigin() const |