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 16 matching lines...) Expand all Loading... |
27 #define FontFaceSet_h | 27 #define FontFaceSet_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptPromise.h" | 29 #include "bindings/core/v8/ScriptPromise.h" |
30 #include "core/css/FontFace.h" | 30 #include "core/css/FontFace.h" |
31 #include "core/css/FontFaceSetForEachCallback.h" | 31 #include "core/css/FontFaceSetForEachCallback.h" |
32 #include "core/dom/ActiveDOMObject.h" | 32 #include "core/dom/ActiveDOMObject.h" |
33 #include "core/events/EventListener.h" | 33 #include "core/events/EventListener.h" |
34 #include "core/events/EventTarget.h" | 34 #include "core/events/EventTarget.h" |
35 #include "platform/AsyncMethodRunner.h" | 35 #include "platform/AsyncMethodRunner.h" |
36 #include "platform/RefCountedSupplement.h" | 36 #include "platform/RefCountedSupplement.h" |
| 37 #include "wtf/Allocator.h" |
37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
39 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
40 | 41 |
41 // Mac OS X 10.6 SDK defines check() macro that interfares with our check() meth
od | 42 // Mac OS X 10.6 SDK defines check() macro that interfares with our check() meth
od |
42 #ifdef check | 43 #ifdef check |
43 #undef check | 44 #undef check |
44 #endif | 45 #endif |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 111 |
111 DECLARE_VIRTUAL_TRACE(); | 112 DECLARE_VIRTUAL_TRACE(); |
112 | 113 |
113 private: | 114 private: |
114 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) | 115 static PassRefPtrWillBeRawPtr<FontFaceSet> create(Document& document) |
115 { | 116 { |
116 return adoptRefWillBeNoop(new FontFaceSet(document)); | 117 return adoptRefWillBeNoop(new FontFaceSet(document)); |
117 } | 118 } |
118 | 119 |
119 class FontLoadHistogram { | 120 class FontLoadHistogram { |
| 121 DISALLOW_ALLOCATION(); |
120 public: | 122 public: |
121 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; | 123 enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; |
122 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false
) { } | 124 FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false
) { } |
123 void incrementCount() { m_count++; } | 125 void incrementCount() { m_count++; } |
124 void updateStatus(FontFace*); | 126 void updateStatus(FontFace*); |
125 void record(); | 127 void record(); |
126 | 128 |
127 private: | 129 private: |
128 Status m_status; | 130 Status m_status; |
129 int m_count; | 131 int m_count; |
(...skipping 23 matching lines...) Expand all Loading... |
153 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; | 155 WillBeHeapListHashSet<RefPtrWillBeMember<FontFace>> m_nonCSSConnectedFaces; |
154 | 156 |
155 AsyncMethodRunner<FontFaceSet> m_asyncRunner; | 157 AsyncMethodRunner<FontFaceSet> m_asyncRunner; |
156 | 158 |
157 FontLoadHistogram m_histogram; | 159 FontLoadHistogram m_histogram; |
158 }; | 160 }; |
159 | 161 |
160 } // namespace blink | 162 } // namespace blink |
161 | 163 |
162 #endif // FontFaceSet_h | 164 #endif // FontFaceSet_h |
OLD | NEW |