| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 { | 138 { |
| 139 ASSERT(m_fontData); | 139 ASSERT(m_fontData); |
| 140 return m_fontData->fontPlatformData(size, bold, italic, orientation); | 140 return m_fontData->fontPlatformData(size, bold, italic, orientation); |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool FontResource::isSafeToUnlock() const | 143 bool FontResource::isSafeToUnlock() const |
| 144 { | 144 { |
| 145 return m_data->hasOneRef(); | 145 return m_data->hasOneRef(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void FontResource::fontLoadShortLimitCallback(Timer<FontResource>*) | 148 void FontResource::fontLoadShortLimitCallback(TimerBase*) |
| 149 { | 149 { |
| 150 if (!isLoading()) | 150 if (!isLoading()) |
| 151 return; | 151 return; |
| 152 ASSERT(m_loadLimitState == UnderLimit); | 152 ASSERT(m_loadLimitState == UnderLimit); |
| 153 m_loadLimitState = ShortLimitExceeded; | 153 m_loadLimitState = ShortLimitExceeded; |
| 154 ResourceClientWalker<FontResourceClient> walker(clients()); | 154 ResourceClientWalker<FontResourceClient> walker(clients()); |
| 155 while (FontResourceClient* client = walker.next()) | 155 while (FontResourceClient* client = walker.next()) |
| 156 client->fontLoadShortLimitExceeded(this); | 156 client->fontLoadShortLimitExceeded(this); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void FontResource::fontLoadLongLimitCallback(Timer<FontResource>*) | 159 void FontResource::fontLoadLongLimitCallback(TimerBase*) |
| 160 { | 160 { |
| 161 if (!isLoading()) | 161 if (!isLoading()) |
| 162 return; | 162 return; |
| 163 ASSERT(m_loadLimitState == ShortLimitExceeded); | 163 ASSERT(m_loadLimitState == ShortLimitExceeded); |
| 164 m_loadLimitState = LongLimitExceeded; | 164 m_loadLimitState = LongLimitExceeded; |
| 165 ResourceClientWalker<FontResourceClient> walker(clients()); | 165 ResourceClientWalker<FontResourceClient> walker(clients()); |
| 166 while (FontResourceClient* client = walker.next()) | 166 while (FontResourceClient* client = walker.next()) |
| 167 client->fontLoadLongLimitExceeded(this); | 167 client->fontLoadLongLimitExceeded(this); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void FontResource::allClientsAndObserversRemoved() | 170 void FontResource::allClientsAndObserversRemoved() |
| 171 { | 171 { |
| 172 m_fontData.reset(); | 172 m_fontData.reset(); |
| 173 Resource::allClientsAndObserversRemoved(); | 173 Resource::allClientsAndObserversRemoved(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void FontResource::checkNotify() | 176 void FontResource::checkNotify() |
| 177 { | 177 { |
| 178 m_fontLoadShortLimitTimer.stop(); | 178 m_fontLoadShortLimitTimer.stop(); |
| 179 m_fontLoadLongLimitTimer.stop(); | 179 m_fontLoadLongLimitTimer.stop(); |
| 180 | 180 |
| 181 Resource::checkNotify(); | 181 Resource::checkNotify(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace blink | 184 } // namespace blink |
| OLD | NEW |