| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 void FontFaceSet::addToLoadingFonts(FontFace* fontFace) { | 227 void FontFaceSet::addToLoadingFonts(FontFace* fontFace) { |
| 228 if (!m_isLoading) { | 228 if (!m_isLoading) { |
| 229 m_isLoading = true; | 229 m_isLoading = true; |
| 230 m_shouldFireLoadingEvent = true; | 230 m_shouldFireLoadingEvent = true; |
| 231 if (m_ready->getState() != ReadyProperty::Pending) | 231 if (m_ready->getState() != ReadyProperty::Pending) |
| 232 m_ready->reset(); | 232 m_ready->reset(); |
| 233 handlePendingEventsAndPromisesSoon(); | 233 handlePendingEventsAndPromisesSoon(); |
| 234 } | 234 } |
| 235 m_loadingFonts.add(fontFace); | 235 m_loadingFonts.insert(fontFace); |
| 236 fontFace->addCallback(this); | 236 fontFace->addCallback(this); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void FontFaceSet::removeFromLoadingFonts(FontFace* fontFace) { | 239 void FontFaceSet::removeFromLoadingFonts(FontFace* fontFace) { |
| 240 m_loadingFonts.remove(fontFace); | 240 m_loadingFonts.remove(fontFace); |
| 241 if (m_loadingFonts.isEmpty()) | 241 if (m_loadingFonts.isEmpty()) |
| 242 handlePendingEventsAndPromisesSoon(); | 242 handlePendingEventsAndPromisesSoon(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 ScriptPromise FontFaceSet::ready(ScriptState* scriptState) { | 245 ScriptPromise FontFaceSet::ready(ScriptState* scriptState) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 visitor->trace(m_failedFonts); | 561 visitor->trace(m_failedFonts); |
| 562 visitor->trace(m_nonCSSConnectedFaces); | 562 visitor->trace(m_nonCSSConnectedFaces); |
| 563 visitor->trace(m_asyncRunner); | 563 visitor->trace(m_asyncRunner); |
| 564 EventTargetWithInlineData::trace(visitor); | 564 EventTargetWithInlineData::trace(visitor); |
| 565 Supplement<Document>::trace(visitor); | 565 Supplement<Document>::trace(visitor); |
| 566 SuspendableObject::trace(visitor); | 566 SuspendableObject::trace(visitor); |
| 567 FontFace::LoadFontCallback::trace(visitor); | 567 FontFace::LoadFontCallback::trace(visitor); |
| 568 } | 568 } |
| 569 | 569 |
| 570 } // namespace blink | 570 } // namespace blink |
| OLD | NEW |