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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2003593003: Make CustomElementsRegistry lazily initialize script state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Does not use a separate representation of initialized state. Created 4 years, 7 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/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index d5aff08f188620899017ecf54c28193de8f0e6b0..bbd13d770af3152a9f1097581f4829a5f20709f6 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1331,13 +1331,18 @@ void LocalDOMWindow::cancelIdleCallback(int id)
document->cancelIdleCallback(id);
}
-CustomElementsRegistry* LocalDOMWindow::customElements(ScriptState* scriptState) const
+CustomElementsRegistry* LocalDOMWindow::customElementsForBindings(ScriptState* scriptState) const
{
if (!scriptState->world().isMainWorld())
return nullptr;
+ return &customElements();
+}
+
+CustomElementsRegistry& LocalDOMWindow::customElements() const
+{
if (!m_customElements)
- m_customElements = CustomElementsRegistry::create(scriptState, document()->registrationContext());
- return m_customElements.get();
+ m_customElements = CustomElementsRegistry::create(document()->registrationContext());
+ return *m_customElements.get();
}
void LocalDOMWindow::addedEventListener(const AtomicString& eventType, RegisteredEventListener& registeredListener)

Powered by Google App Engine
This is Rietveld 408576698