Index: Source/core/css/CSSFontFace.cpp |
diff --git a/Source/core/css/CSSFontFace.cpp b/Source/core/css/CSSFontFace.cpp |
index b83b4594dcf0bb854a79806819a58613c055680a..a9ee32b7b6e57af3e7517657c5a41ed8751dfed6 100644 |
--- a/Source/core/css/CSSFontFace.cpp |
+++ b/Source/core/css/CSSFontFace.cpp |
@@ -28,7 +28,6 @@ |
#include "core/css/CSSFontFaceSource.h" |
#include "core/css/CSSFontSelector.h" |
-#include "core/css/CSSSegmentedFontFace.h" |
#include "core/css/FontLoader.h" |
#include "core/dom/Document.h" |
#include "RuntimeEnabledFeatures.h" |
@@ -37,6 +36,8 @@ |
namespace WebCore { |
+DEFINE_GC_TYPE_MARKER(CSSFontFace); |
+ |
bool CSSFontFace::isLoaded() const |
{ |
size_t size = m_sources.size(); |
@@ -57,19 +58,22 @@ bool CSSFontFace::isValid() const |
return false; |
} |
-void CSSFontFace::addedToSegmentedFontFace(Handle<CSSSegmentedFontFace> segmentedFontFace) |
+// FIXME(oilpan): Move CSSFontFaceSource to the managed heap and remove this. |
+// Then CSSFontFaceSource and CSSFontFace die in the same round of GC, |
+// and thus we don't need to call dispose(). |
+void CSSFontFace::dispose() |
{ |
- m_segmentedFontFaces.add(segmentedFontFace.raw()); |
+ m_sources.clear(); |
} |
-void CSSFontFace::removedFromSegmentedFontFace(Handle<CSSSegmentedFontFace> segmentedFontFace) |
+void CSSFontFace::addedToSegmentedFontFace(Handle<CSSSegmentedFontFace> segmentedFontFace) |
{ |
- m_segmentedFontFaces.remove(segmentedFontFace.raw()); |
+ m_segmentedFontFaces.add(segmentedFontFace); |
} |
void CSSFontFace::addSource(PassOwnPtr<CSSFontFaceSource> source) |
{ |
- source->setFontFace(this); |
+ source->setFontFace(Handle<CSSFontFace>(this)); |
m_sources.append(source); |
} |
@@ -97,9 +101,11 @@ void CSSFontFace::fontLoaded(CSSFontFaceSource* source) |
notifyFontLoader(Error); |
} |
- HashSet<CSSSegmentedFontFace*>::iterator end = m_segmentedFontFaces.end(); |
- for (HashSet<CSSSegmentedFontFace*>::iterator it = m_segmentedFontFaces.begin(); it != end; ++it) |
- (*it)->fontLoaded(this); |
+ HashSet<Member<CSSSegmentedFontFace> >::iterator end = m_segmentedFontFaces.end(); |
+ for (HashSet<Member<CSSSegmentedFontFace> >::iterator it = m_segmentedFontFaces.begin(); it != end; ++it) { |
+ HandleScope scope; |
+ (*it)->fontLoaded(Handle<CSSFontFace>(this)); |
+ } |
} |
PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic) |
@@ -167,4 +173,10 @@ bool CSSFontFace::hasSVGFontFaceSource() const |
} |
#endif |
+void CSSFontFace::accept(Visitor* visitor) const |
+{ |
+ visitor->visit(m_rule); |
+ visitor->visit(m_segmentedFontFaces); |
+} |
+ |
} |