OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 FontResource::~FontResource() | 92 FontResource::~FontResource() |
93 { | 93 { |
94 } | 94 } |
95 | 95 |
96 void FontResource::didAddClient(ResourceClient* c) | 96 void FontResource::didAddClient(ResourceClient* c) |
97 { | 97 { |
98 ASSERT(FontResourceClient::isExpectedType(c)); | 98 ASSERT(FontResourceClient::isExpectedType(c)); |
99 Resource::didAddClient(c); | 99 Resource::didAddClient(c); |
100 if (isLoaded()) | |
101 static_cast<FontResourceClient*>(c)->fontLoaded(this); | |
102 if (m_loadLimitState == ShortLimitExceeded || m_loadLimitState == LongLimitE
xceeded) | 100 if (m_loadLimitState == ShortLimitExceeded || m_loadLimitState == LongLimitE
xceeded) |
103 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); | 101 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); |
104 if (m_loadLimitState == LongLimitExceeded) | 102 if (m_loadLimitState == LongLimitExceeded) |
105 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this); | 103 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this); |
106 } | 104 } |
107 | 105 |
108 void FontResource::startLoadLimitTimersIfNeeded() | 106 void FontResource::startLoadLimitTimersIfNeeded() |
109 { | 107 { |
110 ASSERT(!stillNeedsLoad()); | 108 ASSERT(!stillNeedsLoad()); |
111 if (isLoaded() || m_fontLoadLongLimitTimer.isActive()) | 109 if (isLoaded() || m_fontLoadLongLimitTimer.isActive()) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void FontResource::allClientsAndObserversRemoved() | 164 void FontResource::allClientsAndObserversRemoved() |
167 { | 165 { |
168 m_fontData.clear(); | 166 m_fontData.clear(); |
169 Resource::allClientsAndObserversRemoved(); | 167 Resource::allClientsAndObserversRemoved(); |
170 } | 168 } |
171 | 169 |
172 void FontResource::checkNotify() | 170 void FontResource::checkNotify() |
173 { | 171 { |
174 m_fontLoadShortLimitTimer.stop(); | 172 m_fontLoadShortLimitTimer.stop(); |
175 m_fontLoadLongLimitTimer.stop(); | 173 m_fontLoadLongLimitTimer.stop(); |
176 ResourceClientWalker<FontResourceClient> w(m_clients); | 174 |
177 while (FontResourceClient* c = w.next()) | 175 Resource::checkNotify(); |
178 c->fontLoaded(this); | |
179 } | 176 } |
180 | 177 |
181 } // namespace blink | 178 } // namespace blink |
OLD | NEW |