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

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: Rebased Created 6 years, 9 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 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
« no previous file with comments | « Source/modules/imagebitmap/ImageBitmapFactories.h ('k') | Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698