Commit 79e2f109 authored by mahesh.kk@samsung.com's avatar mahesh.kk@samsung.com

Make Document::implementation() method return reference

DOMImplementation can not be null and this CL only makes implementation() return
a reference instead of pointer.

Review URL: https://codereview.chromium.org/184813005

git-svn-id: svn://svn.chromium.org/blink/trunk@168436 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9cdd4697
...@@ -676,11 +676,11 @@ void Document::setDoctype(PassRefPtr<DocumentType> docType) ...@@ -676,11 +676,11 @@ void Document::setDoctype(PassRefPtr<DocumentType> docType)
clearStyleResolver(); clearStyleResolver();
} }
DOMImplementation* Document::implementation() DOMImplementation& Document::implementation()
{ {
if (!m_implementation) if (!m_implementation)
m_implementation = DOMImplementation::create(*this); m_implementation = DOMImplementation::create(*this);
return m_implementation.get(); return *m_implementation;
} }
bool Document::hasManifest() const bool Document::hasManifest() const
...@@ -1150,7 +1150,7 @@ void Document::setContentLanguage(const AtomicString& language) ...@@ -1150,7 +1150,7 @@ void Document::setContentLanguage(const AtomicString& language)
void Document::setXMLVersion(const String& version, ExceptionState& exceptionState) void Document::setXMLVersion(const String& version, ExceptionState& exceptionState)
{ {
if (!implementation()->hasFeature("XML", String())) { if (!implementation().hasFeature("XML", String())) {
exceptionState.throwDOMException(NotSupportedError, "This document does not support XML."); exceptionState.throwDOMException(NotSupportedError, "This document does not support XML.");
return; return;
} }
...@@ -1165,7 +1165,7 @@ void Document::setXMLVersion(const String& version, ExceptionState& exceptionSta ...@@ -1165,7 +1165,7 @@ void Document::setXMLVersion(const String& version, ExceptionState& exceptionSta
void Document::setXMLStandalone(bool standalone, ExceptionState& exceptionState) void Document::setXMLStandalone(bool standalone, ExceptionState& exceptionState)
{ {
if (!implementation()->hasFeature("XML", String())) { if (!implementation().hasFeature("XML", String())) {
exceptionState.throwDOMException(NotSupportedError, "This document does not support XML."); exceptionState.throwDOMException(NotSupportedError, "This document does not support XML.");
return; return;
} }
......
...@@ -295,7 +295,7 @@ public: ...@@ -295,7 +295,7 @@ public:
void setDoctype(PassRefPtr<DocumentType>); void setDoctype(PassRefPtr<DocumentType>);
DocumentType* doctype() const { return m_docType.get(); } DocumentType* doctype() const { return m_docType.get(); }
DOMImplementation* implementation(); DOMImplementation& implementation();
Element* documentElement() const Element* documentElement() const
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment