| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #endif | 59 #endif |
| 60 } | 60 } |
| 61 | 61 |
| 62 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>) | 62 void DocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder>) |
| 63 { | 63 { |
| 64 ASSERT_NOT_REACHED(); | 64 ASSERT_NOT_REACHED(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 TextResourceDecoder* DocumentParser::decoder() | 67 TextResourceDecoder* DocumentParser::decoder() |
| 68 { | 68 { |
| 69 return 0; | 69 return nullptr; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void DocumentParser::prepareToStopParsing() | 72 void DocumentParser::prepareToStopParsing() |
| 73 { | 73 { |
| 74 ASSERT(m_state == ParsingState); | 74 ASSERT(m_state == ParsingState); |
| 75 m_state = StoppingState; | 75 m_state = StoppingState; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void DocumentParser::stopParsing() | 78 void DocumentParser::stopParsing() |
| 79 { | 79 { |
| 80 m_state = StoppedState; | 80 m_state = StoppedState; |
| 81 | 81 |
| 82 // Clients may be removed while in the loop. Make a snapshot for iteration. | 82 // Clients may be removed while in the loop. Make a snapshot for iteration. |
| 83 WillBeHeapVector<RawPtrWillBeMember<DocumentParserClient> > clientsSnapshot; | 83 WillBeHeapVector<RawPtrWillBeMember<DocumentParserClient>> clientsSnapshot; |
| 84 copyToVector(m_clients, clientsSnapshot); | 84 copyToVector(m_clients, clientsSnapshot); |
| 85 | 85 |
| 86 for (WillBeHeapVector<RawPtrWillBeMember<DocumentParserClient> >::const_iter
ator it = clientsSnapshot.begin(), itEnd = clientsSnapshot.end(); it != itEnd; +
+it) { | 86 for (DocumentParserClient* client : clientsSnapshot) { |
| 87 DocumentParserClient* client = *it; | |
| 88 if (!m_clients.contains(client)) | 87 if (!m_clients.contains(client)) |
| 89 continue; | 88 continue; |
| 90 | 89 |
| 91 client->notifyParserStopped(); | 90 client->notifyParserStopped(); |
| 92 } | 91 } |
| 93 } | 92 } |
| 94 | 93 |
| 95 void DocumentParser::detach() | 94 void DocumentParser::detach() |
| 96 { | 95 { |
| 97 m_state = DetachedState; | 96 m_state = DetachedState; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 111 m_clients.add(client); | 110 m_clients.add(client); |
| 112 } | 111 } |
| 113 | 112 |
| 114 void DocumentParser::removeClient(DocumentParserClient* client) | 113 void DocumentParser::removeClient(DocumentParserClient* client) |
| 115 { | 114 { |
| 116 m_clients.remove(client); | 115 m_clients.remove(client); |
| 117 } | 116 } |
| 118 | 117 |
| 119 }; | 118 }; |
| 120 | 119 |
| OLD | NEW |