Index: Source/core/css/FontLoader.cpp |
diff --git a/Source/core/css/FontLoader.cpp b/Source/core/css/FontLoader.cpp |
index 98687c059edf64ed801ad11597a7b4add42d6668..7956ccedc58f8df47c084b5eb61e41dcd7891a3f 100644 |
--- a/Source/core/css/FontLoader.cpp |
+++ b/Source/core/css/FontLoader.cpp |
@@ -64,8 +64,8 @@ public: |
return LoadFontCallback::create(numFamilies, onsuccess, onerror); |
} |
- virtual void notifyLoaded(CSSSegmentedFontFace*) OVERRIDE; |
- virtual void notifyError(CSSSegmentedFontFace*) OVERRIDE; |
+ virtual void notifyLoaded(Handle<CSSSegmentedFontFace>) OVERRIDE; |
+ virtual void notifyError(Handle<CSSSegmentedFontFace>) OVERRIDE; |
void loaded(Document*); |
void error(Document*); |
private: |
@@ -103,14 +103,20 @@ void LoadFontCallback::error(Document* document) |
loaded(document); |
} |
-void LoadFontCallback::notifyLoaded(CSSSegmentedFontFace* face) |
+void LoadFontCallback::notifyLoaded(Handle<CSSSegmentedFontFace> face) |
{ |
- loaded(face->fontSelector()->document()); |
+ CSSFontSelector* fontSelector = face->fontSelector(); |
+ if (!fontSelector) |
+ return; |
+ loaded(fontSelector->document()); |
} |
-void LoadFontCallback::notifyError(CSSSegmentedFontFace* face) |
+void LoadFontCallback::notifyError(Handle<CSSSegmentedFontFace> face) |
{ |
- error(face->fontSelector()->document()); |
+ CSSFontSelector* fontSelector = face->fontSelector(); |
+ if (!fontSelector) |
+ return; |
+ error(fontSelector->document()); |
} |
FontLoader::FontLoader(Document* document) |
@@ -275,7 +281,7 @@ void FontLoader::loadFont(const Dictionary& params) |
RefPtr<LoadFontCallback> callback = LoadFontCallback::createFromParams(params, font.family()); |
for (const FontFamily* f = &font.family(); f; f = f->next()) { |
- CSSSegmentedFontFace* face = m_document->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family()); |
+ Handle<CSSSegmentedFontFace> face = m_document->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family()); |
if (!face) { |
if (callback) |
callback->error(m_document); |
@@ -292,7 +298,7 @@ bool FontLoader::checkFont(const String& fontString, const String&) |
if (!resolveFontStyle(fontString, font)) |
return false; |
for (const FontFamily* f = &font.family(); f; f = f->next()) { |
- CSSSegmentedFontFace* face = m_document->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family()); |
+ Handle<CSSSegmentedFontFace> face = m_document->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family()); |
if (!face || !face->checkFont()) |
return false; |
} |