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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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()) | 100 if (isLoaded()) |
101 static_cast<FontResourceClient*>(c)->fontLoaded(this); | 101 c->notifyFinished(this); |
Kunihiko Sakamoto
2016/04/18 08:18:59
This is called by above Resource::didAddClient(),
Takashi Toyoshima
2016/04/18 12:42:03
Done.
| |
102 if (m_loadLimitState == ShortLimitExceeded || m_loadLimitState == LongLimitE xceeded) | 102 if (m_loadLimitState == ShortLimitExceeded || m_loadLimitState == LongLimitE xceeded) |
103 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); | 103 static_cast<FontResourceClient*>(c)->fontLoadShortLimitExceeded(this); |
104 if (m_loadLimitState == LongLimitExceeded) | 104 if (m_loadLimitState == LongLimitExceeded) |
105 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this); | 105 static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this); |
106 } | 106 } |
107 | 107 |
108 void FontResource::startLoadLimitTimersIfNeeded() | 108 void FontResource::startLoadLimitTimersIfNeeded() |
109 { | 109 { |
110 ASSERT(!stillNeedsLoad()); | 110 ASSERT(!stillNeedsLoad()); |
111 if (isLoaded() || m_fontLoadLongLimitTimer.isActive()) | 111 if (isLoaded() || m_fontLoadLongLimitTimer.isActive()) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 void FontResource::allClientsAndObserversRemoved() | 166 void FontResource::allClientsAndObserversRemoved() |
167 { | 167 { |
168 m_fontData.clear(); | 168 m_fontData.clear(); |
169 Resource::allClientsAndObserversRemoved(); | 169 Resource::allClientsAndObserversRemoved(); |
170 } | 170 } |
171 | 171 |
172 void FontResource::checkNotify() | 172 void FontResource::checkNotify() |
173 { | 173 { |
174 m_fontLoadShortLimitTimer.stop(); | 174 m_fontLoadShortLimitTimer.stop(); |
175 m_fontLoadLongLimitTimer.stop(); | 175 m_fontLoadLongLimitTimer.stop(); |
176 ResourceClientWalker<FontResourceClient> w(m_clients); | 176 |
177 while (FontResourceClient* c = w.next()) | 177 Resource::checkNotify(); |
178 c->fontLoaded(this); | |
179 } | 178 } |
180 | 179 |
181 } // namespace blink | 180 } // namespace blink |
OLD | NEW |