[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor-browser/esr24] Bug 913805 - Hold a lock on the RasterImage in ScaleRequest so that the srcFrame doesn't go away if we need to discard images to free up memory. r=seth, a=abillings
commit f3f9e0f211c9c179f9f240eafd4bfcbfc903c3d4
Author: George Wright <george@xxxxxxxxxxx>
Date: Fri Jun 6 14:26:21 2014 -0400
Bug 913805 - Hold a lock on the RasterImage in ScaleRequest so that the srcFrame doesn't go away if we need to discard images to free up memory. r=seth, a=abillings
---
image/src/RasterImage.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp
index 42d4232..fdd9654 100644
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -208,6 +208,9 @@ public:
bool success = false;
if (!dstLocked) {
+ // We need to hold a lock onto the RasterImage object itself so that
+ // it (and its associated imgFrames) aren't marked as discardable.
+ bool imgLocked = NS_SUCCEEDED(image->LockImage());
bool srcLocked = NS_SUCCEEDED(srcFrame->LockImageData());
dstLocked = NS_SUCCEEDED(dstFrame->LockImageData());
@@ -216,7 +219,7 @@ public:
success = srcLocked && NS_SUCCEEDED(srcFrame->GetSurface(getter_AddRefs(srcASurf)));
success = success && dstLocked && NS_SUCCEEDED(dstFrame->GetSurface(getter_AddRefs(dstASurf)));
- success = success && srcLocked && dstLocked && srcASurf && dstASurf;
+ success = success && imgLocked && srcLocked && dstLocked && srcASurf && dstASurf;
if (success) {
srcSurface = srcASurf->GetAsImageSurface();
@@ -254,6 +257,7 @@ public:
bool success = false;
if (dstLocked) {
success = NS_SUCCEEDED(dstFrame->UnlockImageData());
+ success = success && NS_SUCCEEDED(image->UnlockImage());
dstLocked = false;
srcData = nullptr;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
- Prev by Author:
[tor-commits] [tor-browser/esr24] Bug 999651, bug 995679, bug 1009952, bug 1011007, bug 991981. r=sfink, r=shu, r=jandem, r=jdm, r=luke, r=bbouvier, r=nmatsakis, r=bz, r=ehsan, r=jgilbert, r=smaug, r=sicking, r=terrence, r=bholley, r=bent, r=efaust, r=jorendorff, a=lmandel
- Next by Author:
[tor-commits] [tor-browser/esr24] Bug 997341 - Modify content/xul/document/test/bug497875-iframe.xul to not connect to mozilla.org. r=smaug, a=test-only
- Previous by thread:
[tor-commits] [tor-browser/esr24] No bug, Automated HSTS preload list update from host bld-linux64-spot-1024 - a=hsts-update
- Next by thread:
[tor-commits] [tor-browser/esr24] Bug 997820 - Properly set the reftest pref on esr24. a=bustage
- Index(es):