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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 if (ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element.get())) { | 210 if (ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element.get())) { |
211 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); | 211 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); |
212 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrem
enter(m_document); | 212 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrem
enter(m_document); |
213 if (errorOccurred) { | 213 if (errorOccurred) { |
214 TRACE_EVENT_WITH_FLOW1("blink", "HTMLScriptRunner ExecuteScriptFaile
d", element.get(), TRACE_EVENT_FLAG_FLOW_IN, | 214 TRACE_EVENT_WITH_FLOW1("blink", "HTMLScriptRunner ExecuteScriptFaile
d", element.get(), TRACE_EVENT_FLAG_FLOW_IN, |
215 "data", getTraceArgsForScriptElement(element.get(), scriptStartP
osition)); | 215 "data", getTraceArgsForScriptElement(element.get(), scriptStartP
osition)); |
216 scriptLoader->dispatchErrorEvent(); | 216 scriptLoader->dispatchErrorEvent(); |
217 } else { | 217 } else { |
218 ASSERT(isExecutingScript()); | 218 ASSERT(isExecutingScript()); |
219 if (scriptParserBlockingTime > 0.0) { | 219 if (scriptParserBlockingTime > 0.0) { |
220 DocumentParserTiming::from(*m_document).recordParserBlockedOnScr
iptLoadDuration(monotonicallyIncreasingTime() - scriptParserBlockingTime); | 220 DocumentParserTiming::from(*m_document).recordParserBlockedOnScr
iptLoadDuration(monotonicallyIncreasingTime() - scriptParserBlockingTime, script
Loader->wasCreatedDuringDocumentWrite()); |
221 } | 221 } |
222 if (!doExecuteScript(element.get(), sourceCode, scriptStartPosition)
) { | 222 if (!doExecuteScript(element.get(), sourceCode, scriptStartPosition)
) { |
223 scriptLoader->dispatchErrorEvent(); | 223 scriptLoader->dispatchErrorEvent(); |
224 } else { | 224 } else { |
225 element->dispatchEvent(Event::create(EventTypeNames::load)); | 225 element->dispatchEvent(Event::create(EventTypeNames::load)); |
226 } | 226 } |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 ASSERT(!isExecutingScript()); | 230 ASSERT(!isExecutingScript()); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 DEFINE_TRACE(HTMLScriptRunner) | 447 DEFINE_TRACE(HTMLScriptRunner) |
448 { | 448 { |
449 visitor->trace(m_document); | 449 visitor->trace(m_document); |
450 visitor->trace(m_host); | 450 visitor->trace(m_host); |
451 visitor->trace(m_parserBlockingScript); | 451 visitor->trace(m_parserBlockingScript); |
452 visitor->trace(m_scriptsToExecuteAfterParsing); | 452 visitor->trace(m_scriptsToExecuteAfterParsing); |
453 } | 453 } |
454 | 454 |
455 } // namespace blink | 455 } // namespace blink |
OLD | NEW |