Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 class Dictionary; | 51 class Dictionary; |
| 52 class Document; | 52 class Document; |
| 53 class ExceptionState; | 53 class ExceptionState; |
| 54 class Font; | 54 class Font; |
| 55 class FontFaceCache; | 55 class FontFaceCache; |
| 56 class FontResource; | 56 class FontResource; |
| 57 class FontsReadyPromiseResolver; | 57 class FontsReadyPromiseResolver; |
| 58 class ExecutionContext; | 58 class ExecutionContext; |
| 59 | 59 |
| 60 #if ENABLE(OILPAN) | 60 #if ENABLE(OILPAN) |
| 61 class FontFaceSet FINAL : public RefCountedGarbageCollected<FontFaceSet>, public HeapSupplement<Document>, public ActiveDOMObject, public EventTargetWithInlineD ata { | 61 class FontFaceSet FINAL : public GarbageCollectedFinalized<FontFaceSet>, public HeapSupplement<Document>, public ActiveDOMObject, public EventTargetWithInlineDa ta { |
| 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); | 62 USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); |
| 63 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedGarbageCollected<FontFaceSet>); | |
| 64 typedef HeapSupplement<Document> SupplementType; | 63 typedef HeapSupplement<Document> SupplementType; |
| 65 #else | 64 #else |
| 66 class FontFaceSet FINAL : public RefCountedSupplement<Document, FontFaceSet>, pu blic ActiveDOMObject, public EventTargetWithInlineData { | 65 class FontFaceSet FINAL : public RefCountedSupplement<Document, FontFaceSet>, pu blic ActiveDOMObject, public EventTargetWithInlineData { |
| 67 DEFINE_EVENT_TARGET_REFCOUNTING(RefCounted<FontFaceSet>); | 66 DEFINE_EVENT_TARGET_REFCOUNTING(RefCounted<FontFaceSet>); |
| 68 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; | 67 typedef RefCountedSupplement<Document, FontFaceSet> SupplementType; |
| 69 #endif | 68 #endif |
| 70 public: | 69 public: |
| 71 virtual ~FontFaceSet(); | 70 virtual ~FontFaceSet(); |
| 72 | 71 |
| 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); | 72 DEFINE_ATTRIBUTE_EVENT_LISTENER(loading); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 | 107 |
| 109 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); | 108 void addFontFacesToFontFaceCache(FontFaceCache*, CSSFontSelector*); |
| 110 | 109 |
| 111 #if ENABLE(OILPAN) | 110 #if ENABLE(OILPAN) |
| 112 virtual void trace(Visitor*) OVERRIDE; | 111 virtual void trace(Visitor*) OVERRIDE; |
| 113 #endif | 112 #endif |
| 114 | 113 |
| 115 private: | 114 private: |
| 116 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) | 115 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) |
| 117 { | 116 { |
| 118 return adoptRefWillBeRefCountedGarbageCollected<FontFaceSet>(new FontFac eSet(document)); | 117 #if ENABLE(OILPAN) |
| 118 return new FontFaceSet(document); | |
|
tkent
2014/06/12 05:04:55
Use adoptRefWillBeNoop
haraken
2014/06/12 05:59:16
Done.
| |
| 119 #else | |
| 120 return adoptRef(new FontFaceSet(document)); | |
| 121 #endif | |
| 119 } | 122 } |
| 120 | 123 |
| 121 class FontLoadHistogram { | 124 class FontLoadHistogram { |
| 122 public: | 125 public: |
| 123 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; | 126 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; |
| 124 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false ) { } | 127 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false ) { } |
| 125 void incrementCount() { m_count++; } | 128 void incrementCount() { m_count++; } |
| 126 void updateStatus(FontFace*); | 129 void updateStatus(FontFace*); |
| 127 void record(); | 130 void record(); |
| 128 | 131 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 157 ListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; | 160 ListHashSet<RefPtrWillBeMember<FontFace> > m_nonCSSConnectedFaces; |
| 158 | 161 |
| 159 AsyncMethodRunner<FontFaceSet> m_asyncRunner; | 162 AsyncMethodRunner<FontFaceSet> m_asyncRunner; |
| 160 | 163 |
| 161 FontLoadHistogram m_histogram; | 164 FontLoadHistogram m_histogram; |
| 162 }; | 165 }; |
| 163 | 166 |
| 164 } // namespace WebCore | 167 } // namespace WebCore |
| 165 | 168 |
| 166 #endif // FontFaceSet_h | 169 #endif // FontFaceSet_h |
| OLD | NEW |