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

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

Issue 2180663002: Replace compileAndRunInternalScript with not internal in DocumentWriteEvaluator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/bindings/core/v8/DocumentWriteEvaluatorTest.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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 document()->loader()->didObserveLoadingBehavior(WebLoadingBehaviorFlag::WebL oadingBehaviorDocumentWriteEvaluator); 1103 document()->loader()->didObserveLoadingBehavior(WebLoadingBehaviorFlag::WebL oadingBehaviorDocumentWriteEvaluator);
1104 if (!RuntimeEnabledFeatures::documentWriteEvaluatorEnabled()) 1104 if (!RuntimeEnabledFeatures::documentWriteEvaluatorEnabled())
1105 return; 1105 return;
1106 TRACE_EVENT0("blink", "HTMLDocumentParser::evaluateAndPreloadScriptForDocume ntWrite"); 1106 TRACE_EVENT0("blink", "HTMLDocumentParser::evaluateAndPreloadScriptForDocume ntWrite");
1107 1107
1108 double initializeStartTime = monotonicallyIncreasingTimeMS(); 1108 double initializeStartTime = monotonicallyIncreasingTimeMS();
1109 bool neededInitialization = m_evaluator->ensureEvaluationContext(); 1109 bool neededInitialization = m_evaluator->ensureEvaluationContext();
1110 double initializationDuration = monotonicallyIncreasingTimeMS() - initialize StartTime; 1110 double initializationDuration = monotonicallyIncreasingTimeMS() - initialize StartTime;
1111 1111
1112 double startTime = monotonicallyIncreasingTimeMS(); 1112 double startTime = monotonicallyIncreasingTimeMS();
1113 String writtenSource = m_evaluator->evaluateAndEmitWrittenSource(source); 1113 String writtenSource = m_evaluator->evaluateAndEmitWrittenSource(source, doc ument());
1114 double duration = monotonicallyIncreasingTimeMS() - startTime; 1114 double duration = monotonicallyIncreasingTimeMS() - startTime;
1115 1115
1116 int currentPreloadCount = document()->loader()->fetcher()->countPreloads(); 1116 int currentPreloadCount = document()->loader()->fetcher()->countPreloads();
1117 std::unique_ptr<HTMLPreloadScanner> scanner = createPreloadScanner(); 1117 std::unique_ptr<HTMLPreloadScanner> scanner = createPreloadScanner();
1118 scanner->appendToEnd(SegmentedString(writtenSource)); 1118 scanner->appendToEnd(SegmentedString(writtenSource));
1119 scanner->scanAndPreload(m_preloader.get(), document()->validBaseElementURL() , nullptr); 1119 scanner->scanAndPreload(m_preloader.get(), document()->validBaseElementURL() , nullptr);
1120 int numPreloads = document()->loader()->fetcher()->countPreloads() - current PreloadCount; 1120 int numPreloads = document()->loader()->fetcher()->countPreloads() - current PreloadCount;
1121 1121
1122 TRACE_EVENT_INSTANT2("blink", "HTMLDocumentParser::evaluateAndPreloadScriptF orDocumentWrite.data", TRACE_EVENT_SCOPE_THREAD, "numPreloads", numPreloads, "sc riptLength", source.length()); 1122 TRACE_EVENT_INSTANT2("blink", "HTMLDocumentParser::evaluateAndPreloadScriptF orDocumentWrite.data", TRACE_EVENT_SCOPE_THREAD, "numPreloads", numPreloads, "sc riptLength", source.length());
1123 1123
(...skipping 26 matching lines...) Expand all
1150 (*WTF::bind(function, std::forward<Ps>(parameters)...))(); 1150 (*WTF::bind(function, std::forward<Ps>(parameters)...))();
1151 return; 1151 return;
1152 case Asynchronous: 1152 case Asynchronous:
1153 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, WTF::bind(function, std:: forward<Ps>(parameters)...)); 1153 m_loadingTaskRunner->postTask(BLINK_FROM_HERE, WTF::bind(function, std:: forward<Ps>(parameters)...));
1154 return; 1154 return;
1155 } 1155 }
1156 NOTREACHED(); 1156 NOTREACHED();
1157 } 1157 }
1158 1158
1159 } // namespace blink 1159 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/DocumentWriteEvaluatorTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698