Chromium Code Reviews| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 356 void HTMLParserScriptRunner::pendingScriptFinished( | 356 void HTMLParserScriptRunner::pendingScriptFinished( |
| 357 PendingScript* pendingScript) { | 357 PendingScript* pendingScript) { |
| 358 // Handle cancellations of parser-blocking script loads without | 358 // Handle cancellations of parser-blocking script loads without |
| 359 // notifying the host (i.e., parser) if these were initiated by nested | 359 // notifying the host (i.e., parser) if these were initiated by nested |
| 360 // document.write()s. The cancellation may have been triggered by | 360 // document.write()s. The cancellation may have been triggered by |
| 361 // script execution to signal an abrupt stop (e.g., window.close().) | 361 // script execution to signal an abrupt stop (e.g., window.close().) |
| 362 // | 362 // |
| 363 // The parser is unprepared to be told, and doesn't need to be. | 363 // The parser is unprepared to be told, and doesn't need to be. |
| 364 if (isExecutingScript() && pendingScript->resource()->wasCanceled()) { | 364 if (isExecutingScript() && pendingScript->resource()->wasCanceled()) { |
| 365 pendingScript->dispose(); | 365 pendingScript->dispose(); |
| 366 | |
| 367 // TODO(hiroshige): According to the comment above, | |
| 368 // this block is intended to process |m_parserBlockingScript|. | |
| 369 // If this CHECK() should fail, implement the case where | |
| 370 // |m_parserBlockingScript == m_scriptsToExecuteAfterParsing.first()|. | |
|
kouhei (in TOK)
2017/02/28 00:41:48
I'm not sure if we should do that per se. I'd rath
hiroshige
2017/02/28 00:48:55
|m_parserBlockingScript| and |m_scriptsToExecuteAf
| |
| 371 CHECK_EQ(pendingScript, parserBlockingScript()); | |
| 372 m_parserBlockingScript = nullptr; | |
| 366 return; | 373 return; |
| 367 } | 374 } |
| 368 | 375 |
| 369 // If the script was blocked as part of document.write intervention, | 376 // If the script was blocked as part of document.write intervention, |
| 370 // then send an asynchronous GET request with an interventions header. | 377 // then send an asynchronous GET request with an interventions header. |
| 371 possiblyFetchBlockedDocWriteScript(pendingScript); | 378 possiblyFetchBlockedDocWriteScript(pendingScript); |
| 372 | 379 |
| 373 m_host->notifyScriptLoaded(pendingScript); | 380 m_host->notifyScriptLoaded(pendingScript); |
| 374 } | 381 } |
| 375 | 382 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 | 683 |
| 677 DEFINE_TRACE(HTMLParserScriptRunner) { | 684 DEFINE_TRACE(HTMLParserScriptRunner) { |
| 678 visitor->trace(m_document); | 685 visitor->trace(m_document); |
| 679 visitor->trace(m_host); | 686 visitor->trace(m_host); |
| 680 visitor->trace(m_parserBlockingScript); | 687 visitor->trace(m_parserBlockingScript); |
| 681 visitor->trace(m_scriptsToExecuteAfterParsing); | 688 visitor->trace(m_scriptsToExecuteAfterParsing); |
| 682 PendingScriptClient::trace(visitor); | 689 PendingScriptClient::trace(visitor); |
| 683 } | 690 } |
| 684 | 691 |
| 685 } // namespace blink | 692 } // namespace blink |
| OLD | NEW |