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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 ASSERT(!m_token); | 425 ASSERT(!m_token); |
426 ASSERT(!m_lastChunkBeforeScript); | 426 ASSERT(!m_lastChunkBeforeScript); |
427 | 427 |
428 ActiveParserSession session(contextForParsingSession()); | 428 ActiveParserSession session(contextForParsingSession()); |
429 | 429 |
430 OwnPtr<ParsedChunk> chunk(popChunk); | 430 OwnPtr<ParsedChunk> chunk(popChunk); |
431 OwnPtr<CompactHTMLTokenStream> tokens = chunk->tokens.release(); | 431 OwnPtr<CompactHTMLTokenStream> tokens = chunk->tokens.release(); |
432 | 432 |
433 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::startedChun
kWithCheckpoint, m_backgroundParser, chunk->inputCheckpoint)); | 433 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::startedChun
kWithCheckpoint, m_backgroundParser, chunk->inputCheckpoint)); |
434 | 434 |
435 for (XSSInfoStream::const_iterator it = chunk->xssInfos.begin(); it != chunk
->xssInfos.end(); ++it) { | 435 for (const auto& xssInfo : chunk->xssInfos) { |
436 m_textPosition = (*it)->m_textPosition; | 436 m_textPosition = xssInfo->m_textPosition; |
437 m_xssAuditorDelegate.didBlockScript(**it); | 437 m_xssAuditorDelegate.didBlockScript(*xssInfo); |
438 if (isStopped()) | 438 if (isStopped()) |
439 break; | 439 break; |
440 } | 440 } |
441 | 441 |
442 for (Vector<CompactHTMLToken>::const_iterator it = tokens->begin(); it != to
kens->end(); ++it) { | 442 for (Vector<CompactHTMLToken>::const_iterator it = tokens->begin(); it != to
kens->end(); ++it) { |
443 ASSERT(!isWaitingForScripts()); | 443 ASSERT(!isWaitingForScripts()); |
444 | 444 |
445 if (document()->frame() && document()->frame()->navigationScheduler().lo
cationChangePending()) { | 445 if (document()->frame() && document()->frame()->navigationScheduler().lo
cationChangePending()) { |
446 | 446 |
447 // To match main-thread parser behavior (which never checks location
ChangePending on the EOF path) | 447 // To match main-thread parser behavior (which never checks location
ChangePending on the EOF path) |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) | 1047 void HTMLDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
1048 { | 1048 { |
1049 ASSERT(decoder); | 1049 ASSERT(decoder); |
1050 DecodedDataDocumentParser::setDecoder(decoder); | 1050 DecodedDataDocumentParser::setDecoder(decoder); |
1051 | 1051 |
1052 if (m_haveBackgroundParser) | 1052 if (m_haveBackgroundParser) |
1053 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); | 1053 HTMLParserThread::shared()->postTask(bind(&BackgroundHTMLParser::setDeco
der, m_backgroundParser, takeDecoder())); |
1054 } | 1054 } |
1055 | 1055 |
1056 } | 1056 } |
OLD | NEW |