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

Unified Diff: Source/core/dom/DOMImplementation.cpp

Issue 65043011: Have DOMImplementation take the Document argument by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 1 month 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 | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMImplementation.cpp
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp
index 61cc4378278444cdb2b07fcb64f86cf3213b3cc3..83885b3bf10f9d2f46ba4d3d4526b052b8891ba8 100644
--- a/Source/core/dom/DOMImplementation.cpp
+++ b/Source/core/dom/DOMImplementation.cpp
@@ -161,7 +161,7 @@ static bool isSupportedSVG11Feature(const String& feature, const String& version
&& svgFeatures.contains(feature.right(feature.length() - 35));
}
-DOMImplementation::DOMImplementation(Document* document)
+DOMImplementation::DOMImplementation(Document& document)
: m_document(document)
{
ScriptWrappable::init(this);
@@ -185,7 +185,7 @@ PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const String& qua
if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
return 0;
- return DocumentType::create(m_document, qualifiedName, publicId, systemId);
+ return DocumentType::create(&m_document, qualifiedName, publicId, systemId);
}
DOMImplementation* DOMImplementation::getInterface(const String& /*feature*/)
@@ -197,17 +197,17 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR
const String& qualifiedName, DocumentType* doctype, ExceptionState& exceptionState)
{
RefPtr<Document> doc;
- DocumentInit init = DocumentInit::fromContext(m_document->contextDocument());
+ DocumentInit init = DocumentInit::fromContext(m_document.contextDocument());
if (namespaceURI == SVGNames::svgNamespaceURI) {
doc = SVGDocument::create(init);
} else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) {
- doc = Document::createXHTML(init.withRegistrationContext(m_document->registrationContext()));
+ doc = Document::createXHTML(init.withRegistrationContext(m_document.registrationContext()));
} else {
doc = Document::create(init);
}
- doc->setSecurityOrigin(m_document->securityOrigin()->isolatedCopy());
- doc->setContextFeatures(m_document->contextFeatures());
+ doc->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy());
+ doc->setContextFeatures(m_document.contextFeatures());
RefPtr<Node> documentElement;
if (!qualifiedName.isEmpty()) {
@@ -307,15 +307,15 @@ bool DOMImplementation::isTextMIMEType(const String& mimeType)
PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title)
{
- DocumentInit init = DocumentInit::fromContext(m_document->contextDocument())
- .withRegistrationContext(m_document->registrationContext());
+ DocumentInit init = DocumentInit::fromContext(m_document.contextDocument())
+ .withRegistrationContext(m_document.registrationContext());
RefPtr<HTMLDocument> d = HTMLDocument::create(init);
d->open();
d->write("<!doctype html><html><body></body></html>");
if (!title.isNull())
d->setTitle(title);
- d->setSecurityOrigin(m_document->securityOrigin()->isolatedCopy());
- d->setContextFeatures(m_document->contextFeatures());
+ d->setSecurityOrigin(m_document.securityOrigin()->isolatedCopy());
+ d->setContextFeatures(m_document.contextFeatures());
return d.release();
}
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698