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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1660993002: Revert of Simplify CanvasAsyncBlobCreator by removing ContextObserver and related tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 63d691d071e28e0340a84d5aae3a19f0c0839ca3..2b554b54362aa1de55080ff79e61bf09aad4937e 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -580,7 +580,7 @@
return toDataURLInternal(mimeType, quality, BackBuffer);
}
-void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState)
+void HTMLCanvasElement::toBlob(ScriptState* scriptState, BlobCallback* callback, const String& mimeType, const ScriptValue& qualityArgument, ExceptionState& exceptionState)
{
if (!originClean()) {
exceptionState.throwSecurityError("Tainted canvases may not be exported.");
@@ -609,9 +609,9 @@
// Add a ref to keep image data alive until completion of encoding
RefPtr<DOMUint8ClampedArray> imageDataRef(imageData->data());
- RefPtr<CanvasAsyncBlobCreator> asyncCreatorRef = CanvasAsyncBlobCreator::create(imageDataRef.release(), encodingMimeType, imageData->size(), callback);
-
- if (encodingMimeType == DefaultMimeType) {
+ RefPtr<CanvasAsyncBlobCreator> asyncCreatorRef = CanvasAsyncBlobCreator::create(imageDataRef.release(), encodingMimeType, imageData->size(), callback, scriptState->executionContext());
+
+ if (Platform::current()->isThreadedCompositingEnabled() && (encodingMimeType == DefaultMimeType)) {
asyncCreatorRef->scheduleAsyncBlobCreation(true);
} else {
asyncCreatorRef->scheduleAsyncBlobCreation(false, quality);
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.h ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698