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

Unified Diff: Source/modules/imagebitmap/ImageBitmapFactories.cpp

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove redundant include Created 6 years, 10 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: Source/modules/imagebitmap/ImageBitmapFactories.cpp
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
index eae94095b4a11d2a4ac9e33c00446941b17c99ac..81630a233c28e022a746ba6375ab1a69ca193cad 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

Powered by Google App Engine
This is Rietveld 408576698