| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 // Avoid |CSSSStyleSheet| and |ownerNode| being deleted by scripts that run
via | 398 // Avoid |CSSSStyleSheet| and |ownerNode| being deleted by scripts that run
via |
| 399 // ScriptableDocumentParser::executeScriptsWaitingForResources(). Also prote
ct | 399 // ScriptableDocumentParser::executeScriptsWaitingForResources(). Also prote
ct |
| 400 // the |CSSStyleSheet| from being deleted during iteration via the |sheetLoa
ded| | 400 // the |CSSStyleSheet| from being deleted during iteration via the |sheetLoa
ded| |
| 401 // method. | 401 // method. |
| 402 // | 402 // |
| 403 // When a sheet is loaded it is moved from the set of loading clients | 403 // When a sheet is loaded it is moved from the set of loading clients |
| 404 // to the set of completed clients. We therefore need the copy in order to | 404 // to the set of completed clients. We therefore need the copy in order to |
| 405 // not modify the set while iterating it. | 405 // not modify the set while iterating it. |
| 406 WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > loadingClients; | 406 WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > loadingClients; |
| 407 copyToVector(m_loadingClients, loadingClients); | 407 copyToVector(root->m_loadingClients, loadingClients); |
| 408 | 408 |
| 409 for (unsigned i = 0; i < loadingClients.size(); ++i) { | 409 for (unsigned i = 0; i < loadingClients.size(); ++i) { |
| 410 if (loadingClients[i]->loadCompleted()) | 410 if (loadingClients[i]->loadCompleted()) |
| 411 continue; | 411 continue; |
| 412 | 412 |
| 413 // sheetLoaded might be invoked after its owner node is removed from doc
ument. | 413 // sheetLoaded might be invoked after its owner node is removed from doc
ument. |
| 414 if (RefPtrWillBeRawPtr<Node> ownerNode = loadingClients[i]->ownerNode())
{ | 414 if (RefPtrWillBeRawPtr<Node> ownerNode = loadingClients[i]->ownerNode())
{ |
| 415 if (loadingClients[i]->sheetLoaded()) | 415 if (loadingClients[i]->sheetLoaded()) |
| 416 ownerNode->notifyLoadedSheetAndAllCriticalSubresources(m_didLoad
ErrorOccur); | 416 ownerNode->notifyLoadedSheetAndAllCriticalSubresources(m_didLoad
ErrorOccur); |
| 417 } | 417 } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 visitor->trace(m_ownerRule); | 689 visitor->trace(m_ownerRule); |
| 690 visitor->trace(m_importRules); | 690 visitor->trace(m_importRules); |
| 691 visitor->trace(m_childRules); | 691 visitor->trace(m_childRules); |
| 692 visitor->trace(m_loadingClients); | 692 visitor->trace(m_loadingClients); |
| 693 visitor->trace(m_completedClients); | 693 visitor->trace(m_completedClients); |
| 694 visitor->trace(m_ruleSet); | 694 visitor->trace(m_ruleSet); |
| 695 #endif | 695 #endif |
| 696 } | 696 } |
| 697 | 697 |
| 698 } | 698 } |
| OLD | NEW |