Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp

Issue 1857903002: Record parser blocking time for scripts inserted via doc.write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->createdDuringDocumentWrite());
Charlie Harrison 2016/04/04 19:00:16 You can add my CL as a dependent so trybots, etc c
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698