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

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

Issue 212933005: Oilpan: turn DOMWindow into a heap supplementable. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make use of DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED() 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 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
« no previous file with comments | « Source/modules/imagebitmap/ImageBitmapFactories.h ('k') | Source/modules/indexeddb/DOMWindowIndexedDatabase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698