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

Unified Diff: Source/core/dom/TreeScope.h

Issue 112953007: Make TreeScope::documentScope() return a reference and ensure m_documentScope is never NULL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added FIXMEs Created 6 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 | « Source/core/dom/StyleSheetCollection.h ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScope.h
diff --git a/Source/core/dom/TreeScope.h b/Source/core/dom/TreeScope.h
index 994359d3587dea44b41294716cfa26d06358dd8a..76b143b2e4e93839099e41f8a1eb435356fad7ee 100644
--- a/Source/core/dom/TreeScope.h
+++ b/Source/core/dom/TreeScope.h
@@ -64,7 +64,11 @@ public:
void addElementById(const AtomicString& elementId, Element*);
void removeElementById(const AtomicString& elementId, Element*);
- Document* documentScope() const { return m_documentScope; }
+ Document& documentScope() const
+ {
+ ASSERT(m_documentScope);
+ return *m_documentScope;
+ }
Node* ancestorInThisScope(Node*) const;
@@ -135,12 +139,7 @@ protected:
virtual ~TreeScope();
void destroyTreeScopeData();
- void clearDocumentScope();
- void setDocumentScope(Document* document)
- {
- ASSERT(document);
- m_documentScope = document;
- }
+ void setDocumentScope(Document& document) { m_documentScope = &document; }
bool hasGuardRefCount() const { return m_guardRefCount; }
@@ -149,8 +148,6 @@ protected:
void setBaseURL(const KURL& baseURL) { m_baseURL = baseURL; }
private:
- TreeScope();
-
virtual void dispose() { }
int refCount() const;
« no previous file with comments | « Source/core/dom/StyleSheetCollection.h ('k') | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698