Changeset 254291 in webkit
- Timestamp:
- Jan 9, 2020 12:52:33 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r254285 r254291 1 2020-01-09 Chris Lord <clord@igalia.com> 2 3 ImageBitmap can't be created in workers in some cases due to main-thread assert in ImageSource 4 https://bugs.webkit.org/show_bug.cgi?id=205850 5 6 Reviewed by Dean Jackson. 7 8 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-in-worker-transfer-expected.txt: Added. 9 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-in-worker-transfer.html: Added. 10 * web-platform-tests/2dcontext/imagebitmap/createImageBitmap-worker.js: Added. 11 1 12 2020-01-09 Pablo Saavedra <psaavedra@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r254288 r254291 1 2020-01-09 Chris Lord <clord@igalia.com> 2 3 ImageBitmap can't be created in workers in some cases due to main-thread assert in ImageSource 4 https://bugs.webkit.org/show_bug.cgi?id=205850 5 6 Reviewed by Dean Jackson. 7 8 Assert that we're destroyed on the creation thread, rather than on the 9 main thread. This is required for ImageBitmap creation in workers in 10 debug builds. 11 12 Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-in-worker-transfer.html 13 14 * platform/graphics/ImageSource.cpp: 15 (WebCore::ImageSource::ImageSource): 16 (WebCore::ImageSource::~ImageSource): 17 (WebCore::ImageSource::startAsyncDecodingQueue): 18 * platform/graphics/ImageSource.h: 19 1 20 2020-01-09 Jer Noble <jer.noble@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/ImageSource.cpp
r249364 r254291 32 32 #include "Logging.h" 33 33 #include <wtf/CheckedArithmetic.h> 34 #include <wtf/MainThread.h>35 #include <wtf/RunLoop.h>36 34 #include <wtf/SystemTracing.h> 37 35 #include <wtf/URL.h> … … 48 46 , m_alphaOption(alphaOption) 49 47 , m_gammaAndColorProfileOption(gammaAndColorProfileOption) 50 { 51 ASSERT(isMainThread()); 48 , m_runLoop(RunLoop::current()) 49 { 52 50 } 53 51 54 52 ImageSource::ImageSource(NativeImagePtr&& nativeImage) 55 { 56 ASSERT(isMainThread()); 57 53 : m_runLoop(RunLoop::current()) 54 { 58 55 m_frameCount = 1; 59 56 m_encodedDataStatus = EncodedDataStatus::Complete; … … 71 68 { 72 69 ASSERT(!hasAsyncDecodingQueue()); 73 ASSERT( isMainThread());70 ASSERT(&m_runLoop == &RunLoop::current()); 74 71 } 75 72 … … 374 371 sleep(minDecodingDuration - (MonotonicTime::now() - startingTime)); 375 372 376 // Update the cached frames on the main thread to avoid updating the MemoryCache from a different thread.377 callOnMainThread([protectedThis = protectedThis.copyRef(), protectedQueue = protectedDecodingQueue.copyRef(), protectedDecoder = protectedDecoder.copyRef(), sourceURL = sourceURL.isolatedCopy(), nativeImage = WTFMove(nativeImage), frameRequest] () mutable {373 // Update the cached frames on the creation thread to avoid updating the MemoryCache from a different thread. 374 protectedThis->m_runLoop.dispatch([protectedThis = protectedThis.copyRef(), protectedQueue = protectedDecodingQueue.copyRef(), protectedDecoder = protectedDecoder.copyRef(), sourceURL = sourceURL.isolatedCopy(), nativeImage = WTFMove(nativeImage), frameRequest] () mutable { 378 375 // The queue may have been closed if after we got the frame NativeImage, stopAsyncDecodingQueue() was called. 379 376 if (protectedQueue.ptr() == protectedThis->m_decodingQueue && protectedDecoder.ptr() == protectedThis->m_decoder) { -
trunk/Source/WebCore/platform/graphics/ImageSource.h
r249364 r254291 30 30 #include <wtf/Forward.h> 31 31 #include <wtf/Optional.h> 32 #include <wtf/RunLoop.h> 32 33 #include <wtf/SynchronizedFixedQueue.h> 33 34 #include <wtf/WeakPtr.h> … … 41 42 class ImageDecoder; 42 43 43 class ImageSource : public ThreadSafeRefCounted<ImageSource , WTF::DestructionThread::Main>, public CanMakeWeakPtr<ImageSource> {44 class ImageSource : public ThreadSafeRefCounted<ImageSource>, public CanMakeWeakPtr<ImageSource> { 44 45 friend class BitmapImage; 45 46 public: … … 201 202 Optional<Color> m_singlePixelSolidColor; 202 203 Optional<SubsamplingLevel> m_maximumSubsamplingLevel; 204 205 RunLoop& m_runLoop; 203 206 }; 204 207
Note: See TracChangeset
for help on using the changeset viewer.