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

Unified Diff: sky/engine/core/dom/DocumentInit.cpp

Issue 841873006: All documents should have a RegistrationContext. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/DocumentInit.h ('k') | sky/engine/core/loader/MojoLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/DocumentInit.cpp
diff --git a/sky/engine/core/dom/DocumentInit.cpp b/sky/engine/core/dom/DocumentInit.cpp
index 80d692292cf03b1c41feda3b18b3f6f665412397..f1da6831077d7ac363c42aa6e9b1d23c92966d90 100644
--- a/sky/engine/core/dom/DocumentInit.cpp
+++ b/sky/engine/core/dom/DocumentInit.cpp
@@ -41,7 +41,6 @@ DocumentInit::DocumentInit(const KURL& url, LocalFrame* frame, WeakPtr<Document>
, m_frame(frame)
, m_contextDocument(contextDocument)
, m_importsController(importsController)
- , m_createNewRegistrationContext(false)
{
}
@@ -51,7 +50,6 @@ DocumentInit::DocumentInit(const DocumentInit& other)
, m_contextDocument(other.m_contextDocument)
, m_importsController(other.m_importsController)
, m_registrationContext(other.m_registrationContext)
- , m_createNewRegistrationContext(other.m_createNewRegistrationContext)
{
}
@@ -79,25 +77,15 @@ Settings* DocumentInit::settings() const
return frameForSecurityContext()->settings();
}
-DocumentInit& DocumentInit::withRegistrationContext(CustomElementRegistrationContext* registrationContext)
+DocumentInit& DocumentInit::withRegistrationContext(CustomElementRegistrationContext& registrationContext)
{
- ASSERT(!m_createNewRegistrationContext && !m_registrationContext);
- m_registrationContext = registrationContext;
+ ASSERT(!m_registrationContext);
+ m_registrationContext = &registrationContext;
return *this;
}
-DocumentInit& DocumentInit::withNewRegistrationContext()
+PassRefPtr<CustomElementRegistrationContext> DocumentInit::registrationContext() const
{
- ASSERT(!m_createNewRegistrationContext && !m_registrationContext);
- m_createNewRegistrationContext = true;
- return *this;
-}
-
-PassRefPtr<CustomElementRegistrationContext> DocumentInit::registrationContext(Document* document) const
-{
- if (m_createNewRegistrationContext)
- return CustomElementRegistrationContext::create();
-
return m_registrationContext.get();
}
« no previous file with comments | « sky/engine/core/dom/DocumentInit.h ('k') | sky/engine/core/loader/MojoLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698