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

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

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use DCHECK, revert RuntimeEnabledFeatures.in. 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 acb4cfcd292594344964e315ca59425eaed2fd62..ca410ef58a8a9013af839fbca1ad794c770e9219 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1324,8 +1324,10 @@ void LocalDOMWindow::cancelIdleCallback(int id)
CustomElementsRegistry* LocalDOMWindow::customElements() const
{
- if (!m_customElements)
- m_customElements = CustomElementsRegistry::create();
+ if (!m_customElements && frame()) {
+ ScriptState* scriptState = ScriptState::forMainWorld(frame());
haraken 2016/05/10 09:04:22 Can you add [CallWith=ScriptState] to Window.custo
dominicc (has gone to gerrit) 2016/05/11 02:31:49 We actually really need to construct that object i
haraken 2016/05/11 06:25:28 It's nasty to manipulate V8 objects in a different
+ m_customElements = CustomElementsRegistry::create(scriptState);
+ }
return m_customElements.get();
}

Powered by Google App Engine
This is Rietveld 408576698