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

Unified Diff: third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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: third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
index ab533705730aae7ce11f99ae02ea691b80d163ea..eea8f3e3d96791f6c3fc7d70c385e11277b69454 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
+++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
@@ -27,14 +27,14 @@
#define CSSFontFaceSrcValue_h
#include "core/css/CSSValue.h"
-#include "core/fetch/ResourcePtr.h"
+#include "core/fetch/FontResource.h"
+#include "core/fetch/ResourceOwner.h"
#include "platform/weborigin/Referrer.h"
#include "wtf/PassRefPtr.h"
#include "wtf/text/WTFString.h"
namespace blink {
-class FontResource;
class Document;
class CSSFontFaceSrcValue : public CSSValue {
@@ -65,7 +65,11 @@ public:
bool equals(const CSSFontFaceSrcValue&) const;
- DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor); }
+ DEFINE_INLINE_TRACE_AFTER_DISPATCH()
+ {
+ visitor->trace(m_fetched);
+ CSSValue::traceAfterDispatch(visitor);
+ }
private:
CSSFontFaceSrcValue(const String& resource, bool local, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy)
@@ -84,7 +88,26 @@ private:
bool m_isLocal;
ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy;
- ResourcePtr<FontResource> m_fetched;
+
+ class FontResourceHelper : public NoBaseWillBeGarbageCollectedFinalized<FontResourceHelper>, public ResourceOwner<FontResource> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper);
+ public:
+ static PassOwnPtrWillBeRawPtr<FontResourceHelper> create(PassRefPtrWillBeRawPtr<FontResource> resource)
+ {
+ return adoptPtrWillBeNoop(new FontResourceHelper(resource));
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visitor); }
+
+ private:
+ FontResourceHelper(PassRefPtrWillBeRawPtr<FontResource> resource)
+ {
+ setResource(resource);
+ }
+
+ String debugName() const override { return "CSSFontFaceSrcValue::FontResourceHelper"; }
+ };
+ OwnPtrWillBeMember<FontResourceHelper> m_fetched;
};
DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue());
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698