| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 { | 72 { |
| 73 ASSERT(m_state == ParsingState); | 73 ASSERT(m_state == ParsingState); |
| 74 m_state = StoppingState; | 74 m_state = StoppingState; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void DocumentParser::stopParsing() | 77 void DocumentParser::stopParsing() |
| 78 { | 78 { |
| 79 m_state = StoppedState; | 79 m_state = StoppedState; |
| 80 | 80 |
| 81 // Clients may be removed while in the loop. Make a snapshot for iteration. | 81 // Clients may be removed while in the loop. Make a snapshot for iteration. |
| 82 WillBeHeapVector<RawPtrWillBeMember<DocumentParserClient>> clientsSnapshot; | 82 HeapVector<Member<DocumentParserClient>> clientsSnapshot; |
| 83 copyToVector(m_clients, clientsSnapshot); | 83 copyToVector(m_clients, clientsSnapshot); |
| 84 | 84 |
| 85 for (DocumentParserClient* client : clientsSnapshot) { | 85 for (DocumentParserClient* client : clientsSnapshot) { |
| 86 if (!m_clients.contains(client)) | 86 if (!m_clients.contains(client)) |
| 87 continue; | 87 continue; |
| 88 | 88 |
| 89 client->notifyParserStopped(); | 89 client->notifyParserStopped(); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 108 { | 108 { |
| 109 m_clients.add(client); | 109 m_clients.add(client); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void DocumentParser::removeClient(DocumentParserClient* client) | 112 void DocumentParser::removeClient(DocumentParserClient* client) |
| 113 { | 113 { |
| 114 m_clients.remove(client); | 114 m_clients.remove(client); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |