| 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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |