Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp |
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
index 5300a5d0160a53e00b0ed81d1e8f228031a5a9e5..96b7ddfb9d6408d95c1cdd571e71f8d7b79e9777 100644 |
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
@@ -270,16 +270,15 @@ ImageBitmapFactories& ImageBitmapFactories::from(EventTarget& eventTarget) |
return fromInternal(*window); |
ASSERT(eventTarget.executionContext()->isWorkerGlobalScope()); |
- return fromInternal(*toWorkerGlobalScope(eventTarget.executionContext())); |
+ return WorkerGlobalScopeImageBitmapFactories::fromInternal(*toWorkerGlobalScope(eventTarget.executionContext())); |
} |
-template <class T> |
-ImageBitmapFactories& ImageBitmapFactories::fromInternal(T& object) |
+ImageBitmapFactories& ImageBitmapFactories::fromInternal(DOMWindow& object) |
{ |
- ImageBitmapFactories* supplement = static_cast<ImageBitmapFactories*>(Supplement<T>::from(object, supplementName())); |
+ ImageBitmapFactories* supplement = static_cast<ImageBitmapFactories*>(Supplement<DOMWindow>::from(object, supplementName())); |
if (!supplement) { |
supplement = new ImageBitmapFactories(); |
- Supplement<T>::provideTo(object, supplementName(), adoptPtr(supplement)); |
+ Supplement<DOMWindow>::provideTo(object, supplementName(), adoptPtr(supplement)); |
} |
return *supplement; |
} |
@@ -354,4 +353,18 @@ void ImageBitmapFactories::ImageBitmapLoader::didFail(FileError::ErrorCode) |
rejectPromise(); |
} |
+ImageBitmapFactories& WorkerGlobalScopeImageBitmapFactories::fromInternal(WorkerGlobalScope& object) |
+{ |
+ WorkerGlobalScopeImageBitmapFactories* supplement = static_cast<WorkerGlobalScopeImageBitmapFactories*>(WillBeHeapSupplement<WorkerGlobalScope>::from(object, ImageBitmapFactories::supplementName())); |
+ if (!supplement) { |
+ supplement = new WorkerGlobalScopeImageBitmapFactories(); |
+ WillBeHeapSupplement<WorkerGlobalScope>::provideTo(object, ImageBitmapFactories::supplementName(), adoptPtrWillBeNoop(supplement)); |
+ } |
+ return *supplement; |
+} |
+ |
+void WorkerGlobalScopeImageBitmapFactories::trace(Visitor*) |
+{ |
+} |
+ |
} // namespace WebCore |