Index: third_party/WebKit/Source/core/dom/ScriptLoaderClient.cpp |
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoaderClient.cpp b/third_party/WebKit/Source/core/dom/ScriptLoaderClient.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..063f1f0fd078559aa24b26714c188edfc4012631 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/dom/ScriptLoaderClient.cpp |
@@ -0,0 +1,33 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/dom/ScriptLoader.h" |
+ |
+#include "core/html/HTMLScriptElement.h" |
+#include "core/svg/SVGScriptElement.h" |
+ |
+namespace blink { |
+ |
+ScriptLoaderClient* ScriptLoaderClient::fromElementIfPossible( |
+ Element* element) { |
+ if (isHTMLScriptElement(*element)) |
+ return toHTMLScriptElement(element); |
+ if (isSVGScriptElement(*element)) |
+ return toSVGScriptElement(element); |
+ return nullptr; |
+} |
+ |
+void ScriptLoaderClient::initializeScriptLoader( |
+ bool parserInserted, |
+ bool alreadyStarted, |
+ bool createdDuringDocumentWrite) { |
+ m_loader = ScriptLoader::create(this, parserInserted, alreadyStarted, |
+ createdDuringDocumentWrite); |
+} |
+ |
+DEFINE_TRACE(ScriptLoaderClient) { |
+ visitor->trace(m_loader); |
+} |
+ |
+} // namespace blink |