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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp

Issue 2780463002: Introduce blink::Script (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
index d9a16890b989447876e89a6be36536e47119f20a..6b2c3764eafe7678130d9f9001dd76297ac6771c 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
@@ -31,6 +31,7 @@
#include "bindings/core/v8/ScriptSourceCode.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8PerIsolateData.h"
+#include "core/dom/ClassicScript.h"
#include "core/dom/DocumentParserTiming.h"
#include "core/dom/Element.h"
#include "core/dom/IgnoreDestructiveWriteCountIncrementer.h"
@@ -79,14 +80,14 @@ std::unique_ptr<TracedValue> GetTraceArgsForScriptElement(
}
bool DoExecuteScript(ScriptElementBase* element,
- const ScriptSourceCode& source_code,
+ const Script* script,
const TextPosition& text_position) {
ScriptLoader* script_loader = element->Loader();
DCHECK(script_loader);
TRACE_EVENT_WITH_FLOW1("blink", "HTMLParserScriptRunner ExecuteScript",
element, TRACE_EVENT_FLAG_FLOW_IN, "data",
GetTraceArgsForScriptElement(element, text_position));
- return script_loader->ExecuteScript(source_code);
+ return script_loader->ExecuteScript(script);
}
void TraceParserBlockingScript(const PendingScript* pending_script,
@@ -204,7 +205,7 @@ void HTMLParserScriptRunner::ExecutePendingScriptAndDispatchEvent(
PendingScript* pending_script,
ScriptStreamer::Type pending_script_type) {
bool error_occurred = false;
- ScriptSourceCode source_code = pending_script->GetSource(
+ Script* script = pending_script->GetSource(
DocumentURLForScriptExecution(document_), error_occurred);
// Stop watching loads before executeScript to prevent recursion if the script
@@ -263,7 +264,7 @@ void HTMLParserScriptRunner::ExecutePendingScriptAndDispatchEvent(
MonotonicallyIncreasingTime() - script_parser_blocking_time,
script_loader->WasCreatedDuringDocumentWrite());
}
- if (!DoExecuteScript(element, source_code, script_start_position)) {
+ if (!DoExecuteScript(element, script, script_start_position)) {
script_loader->DispatchErrorEvent();
} else {
element->DispatchLoadEvent();
@@ -656,7 +657,8 @@ void HTMLParserScriptRunner::ProcessScriptElementInternal(
ScriptSourceCode source_code(script->textContent(),
DocumentURLForScriptExecution(document_),
script_start_position);
- DoExecuteScript(element, source_code, script_start_position);
+ DoExecuteScript(element, ClassicScript::Create(source_code),
+ script_start_position);
}
} else {
// 2nd Clause of Step 23.
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698