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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 for (XSSInfoStream::const_iterator it = chunk->xssInfos.begin(); it != chunk
->xssInfos.end(); ++it) { | 397 for (XSSInfoStream::const_iterator it = chunk->xssInfos.begin(); it != chunk
->xssInfos.end(); ++it) { |
398 m_textPosition = (*it)->m_textPosition; | 398 m_textPosition = (*it)->m_textPosition; |
399 m_xssAuditorDelegate.didBlockScript(**it); | 399 m_xssAuditorDelegate.didBlockScript(**it); |
400 if (isStopped()) | 400 if (isStopped()) |
401 break; | 401 break; |
402 } | 402 } |
403 | 403 |
404 for (Vector<CompactHTMLToken>::const_iterator it = tokens->begin(); it != to
kens->end(); ++it) { | 404 for (Vector<CompactHTMLToken>::const_iterator it = tokens->begin(); it != to
kens->end(); ++it) { |
405 ASSERT(!isWaitingForScripts()); | 405 ASSERT(!isWaitingForScripts()); |
406 | 406 |
407 m_textPosition = it->textPosition(); | |
408 | |
409 constructTreeFromCompactHTMLToken(*it); | |
410 | |
411 if (isStopped()) | |
412 break; | |
413 | |
414 if (!isParsingFragment() | 407 if (!isParsingFragment() |
415 && document()->frame() && document()->frame()->navigationScheduler()
->locationChangePending()) { | 408 && document()->frame() && document()->frame()->navigationScheduler()
->locationChangePending()) { |
416 | 409 |
417 // To match main-thread parser behavior (which never checks location
ChangePending on the EOF path) | 410 // To match main-thread parser behavior (which never checks location
ChangePending on the EOF path) |
418 // we peek to see if this chunk has an EOF and process it anyway. | 411 // we peek to see if this chunk has an EOF and process it anyway. |
419 if (tokens->last().type() == HTMLToken::EndOfFile) { | 412 if (tokens->last().type() == HTMLToken::EndOfFile) { |
420 ASSERT(m_speculations.isEmpty()); // There should never be any c
hunks after the EOF. | 413 ASSERT(m_speculations.isEmpty()); // There should never be any c
hunks after the EOF. |
421 prepareToStopParsing(); | 414 prepareToStopParsing(); |
422 } | 415 } |
423 break; | 416 break; |
424 } | 417 } |
425 | 418 |
| 419 m_textPosition = it->textPosition(); |
| 420 |
| 421 constructTreeFromCompactHTMLToken(*it); |
| 422 |
| 423 if (isStopped()) |
| 424 break; |
| 425 |
426 if (isWaitingForScripts()) { | 426 if (isWaitingForScripts()) { |
427 ASSERT(it + 1 == tokens->end()); // The </script> is assumed to be t
he last token of this bunch. | 427 ASSERT(it + 1 == tokens->end()); // The </script> is assumed to be t
he last token of this bunch. |
428 runScriptsForPausedTreeBuilder(); | 428 runScriptsForPausedTreeBuilder(); |
429 validateSpeculations(chunk.release()); | 429 validateSpeculations(chunk.release()); |
430 break; | 430 break; |
431 } | 431 } |
432 | 432 |
433 if (it->type() == HTMLToken::EndOfFile) { | 433 if (it->type() == HTMLToken::EndOfFile) { |
434 ASSERT(it + 1 == tokens->end()); // The EOF is assumed to be the las
t token of this bunch. | 434 ASSERT(it + 1 == tokens->end()); // The EOF is assumed to be the las
t token of this bunch. |
435 ASSERT(m_speculations.isEmpty()); // There should never be any chunk
s after the EOF. | 435 ASSERT(m_speculations.isEmpty()); // There should never be any chunk
s after the EOF. |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 m_parserScheduler->suspend(); | 936 m_parserScheduler->suspend(); |
937 } | 937 } |
938 | 938 |
939 void HTMLDocumentParser::resumeScheduledTasks() | 939 void HTMLDocumentParser::resumeScheduledTasks() |
940 { | 940 { |
941 if (m_parserScheduler) | 941 if (m_parserScheduler) |
942 m_parserScheduler->resume(); | 942 m_parserScheduler->resume(); |
943 } | 943 } |
944 | 944 |
945 } | 945 } |
OLD | NEW |