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

Unified Diff: Source/core/frame/ImageBitmapTest.cpp

Issue 292763002: Oilpan: simplify ImageBitmapTest heap clearing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmapTest.cpp
diff --git a/Source/core/frame/ImageBitmapTest.cpp b/Source/core/frame/ImageBitmapTest.cpp
index fecdbca702074224c7fe378703f0d61e91d0742c..73bea955f84ebbbf01818bc7e36e5ace10125cee 100644
--- a/Source/core/frame/ImageBitmapTest.cpp
+++ b/Source/core/frame/ImageBitmapTest.cpp
@@ -146,7 +146,7 @@ TEST_F(ImageBitmapTest, ImageBitmapLiveResourcePriority)
ASSERT_EQ(memoryCache()->priority(imageExteriorCrop->cachedImage()), MemoryCacheLiveResourcePriorityLow);
ASSERT_EQ(memoryCache()->priority(imageOutsideCrop->cachedImage()), MemoryCacheLiveResourcePriorityLow);
- RefPtrWillBeRawPtr<ImageBitmap> imageBitmapInteriorCrop = ImageBitmap::create(imageInteriorCrop.get(), IntRect(m_bitmap.width() / 2, m_bitmap.height() / 2, m_bitmap.width(), m_bitmap.height()));
+ RefPtrWillBePersistent<ImageBitmap> imageBitmapInteriorCrop = ImageBitmap::create(imageInteriorCrop.get(), IntRect(m_bitmap.width() / 2, m_bitmap.height() / 2, m_bitmap.width(), m_bitmap.height()));
{
RefPtrWillBeRawPtr<ImageBitmap> imageBitmapNoCrop = ImageBitmap::create(imageNoCrop.get(), IntRect(0, 0, m_bitmap.width(), m_bitmap.height()));
RefPtrWillBeRawPtr<ImageBitmap> imageBitmapInteriorCrop2 = ImageBitmap::create(imageInteriorCrop.get(), IntRect(m_bitmap.width() / 2, m_bitmap.height() / 2, m_bitmap.width(), m_bitmap.height()));
@@ -161,14 +161,8 @@ TEST_F(ImageBitmapTest, ImageBitmapLiveResourcePriority)
// ImageBitmaps that do not contain any of the source image do not elevate CacheLiveResourcePriority.
ASSERT_EQ(memoryCache()->priority(imageOutsideCrop->cachedImage()), MemoryCacheLiveResourcePriorityLow);
- // Stub out references to the ImageBitmaps created and force a
- // garbage collection to have the ImageBitmaps be collected and
- // destructed.
- imageBitmapNoCrop = nullptr;
- imageBitmapInteriorCrop2 = nullptr;
- imageBitmapExteriorCrop = nullptr;
- imageBitmapOutsideCrop = nullptr;
- Heap::collectGarbage(ThreadState::HeapPointersOnStack);
+ // Force a garbage collection to sweep out the local ImageBitmaps.
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
haraken 2014/05/19 13:28:02 hmm, I'm not quite sure if this change addresses t
sof 2014/05/19 13:31:30 The only object reference we care about is a Persi
wibling-chromium 2014/05/19 13:34:36 As I understand it the assumption was that doing a
haraken 2014/05/19 13:39:29 Sorry, you're right. It might work. I thought tha
Mads Ager (chromium) 2014/05/19 13:52:46 Consider moving this to right after the block inst
sof 2014/05/19 14:12:57 ok, done that (also had to do some ALLOW_UNUSED de
}
// CacheLiveResourcePriroity should return to CacheLiveResourcePriorityLow when no ImageBitmaps reference the image.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698