Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp |
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
index fb6723d7312834a5af4ec218135d874e23ec111d..3e16e272e3422e3f7f346fb38af827eabb7f7e17 100644 |
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp |
@@ -276,15 +276,16 @@ ImageBitmapFactories& ImageBitmapFactories::from(EventTarget& eventTarget) |
return fromInternal(*window); |
ASSERT(eventTarget.executionContext()->isWorkerGlobalScope()); |
- return WorkerGlobalScopeImageBitmapFactories::fromInternal(*toWorkerGlobalScope(eventTarget.executionContext())); |
+ return ImageBitmapFactories::fromInternal(*toWorkerGlobalScope(eventTarget.executionContext())); |
} |
-ImageBitmapFactories& ImageBitmapFactories::fromInternal(DOMWindow& object) |
+template<class GlobalObject> |
+ImageBitmapFactories& ImageBitmapFactories::fromInternal(GlobalObject& object) |
{ |
- ImageBitmapFactories* supplement = static_cast<ImageBitmapFactories*>(Supplement<DOMWindow>::from(object, supplementName())); |
+ ImageBitmapFactories* supplement = static_cast<ImageBitmapFactories*>(WillBeHeapSupplement<GlobalObject>::from(object, supplementName())); |
if (!supplement) { |
supplement = new ImageBitmapFactories(); |
- Supplement<DOMWindow>::provideTo(object, supplementName(), adoptPtr(supplement)); |
+ WillBeHeapSupplement<GlobalObject>::provideTo(object, supplementName(), adoptPtrWillBeNoop(supplement)); |
} |
return *supplement; |
} |
@@ -359,18 +360,4 @@ 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 |