Index: third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h |
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h |
index 178a267f26468c7b492235b1cf632cfe44d4cc1a..c20fcef5976d5927619942b0b05de73ae58f7454 100644 |
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h |
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "bindings/core/v8/ScriptPromiseResolver.h" |
#include "core/CoreExport.h" |
#include "core/dom/DOMTypedArray.h" |
#include "core/fileapi/BlobCallback.h" |
@@ -28,9 +29,9 @@ class CORE_EXPORT CanvasAsyncBlobCreator |
const IntSize&, |
BlobCallback*, |
double, |
- Document&); |
- void scheduleAsyncBlobCreation(bool canUseIdlePeriodScheduling, |
- const double& quality = 0.0); |
+ Document*, |
+ ScriptPromiseResolver*); |
+ void scheduleAsyncBlobCreation(const double& quality); |
virtual ~CanvasAsyncBlobCreator(); |
enum MimeType { |
MimeTypePng, |
@@ -50,6 +51,13 @@ class CORE_EXPORT CanvasAsyncBlobCreator |
// types |
IdleTaskCount, // Should not be seen in production |
}; |
+ |
+ enum ToBlobFunctionType { |
+ HTMLCanvasToBlobCallback, |
+ OffscreenCanvasToBlobPromise, |
+ NumberOfToBlobFunctionTypes |
+ }; |
+ |
// Methods are virtual for mocking in unit tests |
virtual void signalTaskSwitchInStartTimeoutEventForTesting() {} |
virtual void signalTaskSwitchInCompleteTimeoutEventForTesting() {} |
@@ -62,7 +70,8 @@ class CORE_EXPORT CanvasAsyncBlobCreator |
const IntSize&, |
BlobCallback*, |
double, |
- Document&); |
+ Document*, |
+ ScriptPromiseResolver*); |
// Methods are virtual for unit testing |
virtual void scheduleInitiatePngEncoding(); |
virtual void scheduleInitiateJpegEncoding(const double&); |
@@ -94,12 +103,19 @@ class CORE_EXPORT CanvasAsyncBlobCreator |
const IntSize m_size; |
size_t m_pixelRowStride; |
const MimeType m_mimeType; |
- Member<BlobCallback> m_callback; |
double m_startTime; |
double m_scheduleInitiateStartTime; |
double m_elapsedTime; |
+ |
+ ToBlobFunctionType m_functionType; |
+ |
+ // Used for HTMLCanvasElement only |
+ Member<BlobCallback> m_callback; |
Member<ParentFrameTaskRunners> m_parentFrameTaskRunner; |
+ // Used for OffscreenCanvas only |
+ Member<ScriptPromiseResolver> m_scriptPromiseResolver; |
+ |
// PNG |
bool initializePngStruct(); |
void |