Bug 622470 - "Decode on draw must be enabled for Mobile Fennec" [r=bzbarsky] a=blocking-fennec
authorOleg Romashin <romaxa>
Sat, 29 Jan 2011 02:02:00 -0800
changeset 62607 0706533de7abbaf20b15a649eef01b7a39c0ae89
parent 62606 d73287c7f0fabff682b5c61e8a277b9179b70992
child 62608 8c89810ed6da63c4f366d27a27e50f8c9fec8ea3
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersbzbarsky, blocking-fennec
bugs622470
milestone2.0b12pre
Bug 622470 - "Decode on draw must be enabled for Mobile Fennec" [r=bzbarsky] a=blocking-fennec
content/base/src/nsDocument.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -198,16 +198,17 @@ static NS_DEFINE_CID(kDOMEventGroupCID, 
 // FOR CSP (autogenerated by xpidl)
 #include "nsIContentSecurityPolicy.h"
 #include "nsCSPService.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsHTMLCSSStyleSheet.h"
 
 #include "mozilla/dom/Link.h"
 #include "nsIHTMLDocument.h"
+#include "nsXULAppAPI.h"
 
 using namespace mozilla::dom;
 
 typedef nsTArray<Link*> LinkArray;
 
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gDocumentLeakPRLog;
@@ -8210,16 +8211,21 @@ PLDHashOperator UnlockEnumerator(imgIReq
   aKey->UnlockImage();
   return PL_DHASH_NEXT;
 }
 
 
 nsresult
 nsDocument::SetImageLockingState(PRBool aLocked)
 {
+  if (XRE_GetProcessType() == GeckoProcessType_Content &&
+      !nsContentUtils::GetBoolPref("content.image.allow_locking", PR_TRUE)) {
+    return NS_OK;
+  }
+
   // If there's no change, there's nothing to do.
   if (mLockingImages == aLocked)
     return NS_OK;
 
   // Otherwise, iterate over our images and perform the appropriate action.
   mImageTracker.EnumerateRead(aLocked ? LockEnumerator
                                       : UnlockEnumerator,
                               nsnull);