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

Unified Diff: Source/core/html/parser/HTMLScriptRunner.cpp

Issue 562653005: Fix WebCore.Scripts.ParsingBlocking.TimeBetweenLoadedAndCompiled UMA some more. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLScriptRunner.cpp
diff --git a/Source/core/html/parser/HTMLScriptRunner.cpp b/Source/core/html/parser/HTMLScriptRunner.cpp
index 4e1da540a73b334182b6a95a4fcf32e75c74037a..9d0355475049aec0b75f859d257eac49dac10cbf 100644
--- a/Source/core/html/parser/HTMLScriptRunner.cpp
+++ b/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -250,12 +250,17 @@ void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
ASSERT(m_parserBlockingScript.resource());
- m_parserBlockingScriptAlreadyLoaded = m_parserBlockingScript.resource()->isLoaded();
+ // Exclude already loaded resources (from memory cache) and reloads from the
+ // computation of
+ // WebCore.Scripts.ParsingBlocking.TimeBetweenLoadedAndCompiled (done after
+ // the script is compiled).
+ m_parserBlockingScriptAlreadyLoaded = m_parserBlockingScript.resource()->isLoaded() || m_parserBlockingScript.resource()->resourceToRevalidate();
blink::Platform::current()->histogramEnumeration("WebCore.Scripts.ParsingBlocking.AlreadyLoaded", m_parserBlockingScriptAlreadyLoaded ? 1 : 0, 2);
+
// We only care about a load callback if resource is not already
// in the cache. Callers will attempt to run the m_parserBlockingScript
// if possible before returning control to the parser.
- if (!m_parserBlockingScriptAlreadyLoaded)
+ if (!m_parserBlockingScript.resource()->isLoaded())
m_parserBlockingScript.watchForLoad(this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698