| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/Element.h" | 31 #include "core/dom/Element.h" |
| 32 #include "core/events/Event.h" | 32 #include "core/events/Event.h" |
| 33 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h" | 33 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h" |
| 34 #include "core/dom/ScriptLoader.h" | 34 #include "core/dom/ScriptLoader.h" |
| 35 #include "core/fetch/ScriptResource.h" | 35 #include "core/fetch/ScriptResource.h" |
| 36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/html/parser/HTMLInputStream.h" | 37 #include "core/html/parser/HTMLInputStream.h" |
| 38 #include "core/html/parser/HTMLScriptRunnerHost.h" | 38 #include "core/html/parser/HTMLScriptRunnerHost.h" |
| 39 #include "core/html/parser/NestingLevelIncrementer.h" | 39 #include "core/html/parser/NestingLevelIncrementer.h" |
| 40 #include "platform/Histogram.h" | 40 #include "platform/Histogram.h" |
| 41 #include "platform/NotImplemented.h" |
| 41 #include "platform/TraceEvent.h" | 42 #include "platform/TraceEvent.h" |
| 42 #include "platform/TracedValue.h" | 43 #include "platform/TracedValue.h" |
| 43 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebFrameScheduler.h" | 45 #include "public/platform/WebFrameScheduler.h" |
| 45 #include <inttypes.h> | 46 #include <inttypes.h> |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| 49 namespace { | 50 namespace { |
| 50 | 51 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 m_scriptsToExecuteAfterParsing.append(pendingScript.release()); | 376 m_scriptsToExecuteAfterParsing.append(pendingScript.release()); |
| 376 } | 377 } |
| 377 | 378 |
| 378 bool HTMLScriptRunner::requestPendingScript(PendingScript* pendingScript, Elemen
t* script) const | 379 bool HTMLScriptRunner::requestPendingScript(PendingScript* pendingScript, Elemen
t* script) const |
| 379 { | 380 { |
| 380 ASSERT(!pendingScript->element()); | 381 ASSERT(!pendingScript->element()); |
| 381 pendingScript->setElement(script); | 382 pendingScript->setElement(script); |
| 382 // This should correctly return 0 for empty or invalid srcValues. | 383 // This should correctly return 0 for empty or invalid srcValues. |
| 383 ScriptResource* resource = toScriptLoaderIfPossible(script)->resource(); | 384 ScriptResource* resource = toScriptLoaderIfPossible(script)->resource(); |
| 384 if (!resource) { | 385 if (!resource) { |
| 385 NOTIMPLEMENTED(); // Dispatch error event. | 386 notImplemented(); // Dispatch error event. |
| 386 return false; | 387 return false; |
| 387 } | 388 } |
| 388 pendingScript->setScriptResource(resource); | 389 pendingScript->setScriptResource(resource); |
| 389 return true; | 390 return true; |
| 390 } | 391 } |
| 391 | 392 |
| 392 // Implements the initial steps for 'An end tag whose tag name is "script"' | 393 // Implements the initial steps for 'An end tag whose tag name is "script"' |
| 393 // http://whatwg.org/html#scriptEndTag | 394 // http://whatwg.org/html#scriptEndTag |
| 394 void HTMLScriptRunner::runScript(Element* script, const TextPosition& scriptStar
tPosition) | 395 void HTMLScriptRunner::runScript(Element* script, const TextPosition& scriptStar
tPosition) |
| 395 { | 396 { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 440 |
| 440 DEFINE_TRACE(HTMLScriptRunner) | 441 DEFINE_TRACE(HTMLScriptRunner) |
| 441 { | 442 { |
| 442 visitor->trace(m_document); | 443 visitor->trace(m_document); |
| 443 visitor->trace(m_host); | 444 visitor->trace(m_host); |
| 444 visitor->trace(m_parserBlockingScript); | 445 visitor->trace(m_parserBlockingScript); |
| 445 visitor->trace(m_scriptsToExecuteAfterParsing); | 446 visitor->trace(m_scriptsToExecuteAfterParsing); |
| 446 } | 447 } |
| 447 | 448 |
| 448 } // namespace blink | 449 } // namespace blink |
| OLD | NEW |