Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / fetch / CSSStyleSheetResource.cpp
old mode 100755 (executable)
new mode 100644 (file)
index be92048..0d431c8
@@ -108,6 +108,22 @@ void CSSStyleSheetResource::checkNotify()
     m_decodedSheetText = String();
 }
 
+bool CSSStyleSheetResource::isSafeToUnlock() const
+{
+    return m_parsedStyleSheetCache;
+}
+
+void CSSStyleSheetResource::destroyDecodedDataIfPossible()
+{
+    if (!isSafeToUnlock())
+        return;
+
+    m_parsedStyleSheetCache->removedFromMemoryCache();
+    m_parsedStyleSheetCache.clear();
+
+    setDecodedSize(0);
+}
+
 bool CSSStyleSheetResource::canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const
 {
     if (errorOccurred())
@@ -132,20 +148,6 @@ bool CSSStyleSheetResource::canUseSheet(bool enforceMIMEType, bool* hasValidMIME
     return typeOK;
 }
 
-void CSSStyleSheetResource::destroyDecodedData()
-{
-    if (!m_parsedStyleSheetCache)
-        return;
-
-    m_parsedStyleSheetCache->removedFromMemoryCache();
-    m_parsedStyleSheetCache.clear();
-
-    setDecodedSize(0);
-
-    if (isSafeToMakePurgeable())
-        makePurgeable(true);
-}
-
 PassRefPtr<StyleSheetContents> CSSStyleSheetResource::restoreParsedStyleSheet(const CSSParserContext& context)
 {
     if (!m_parsedStyleSheetCache)