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

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

Issue 49613005: Have TreeScrope::adoptIfNeeded() take a reference instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/TreeScope.cpp ('k') | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScopeAdopter.h
diff --git a/Source/core/dom/TreeScopeAdopter.h b/Source/core/dom/TreeScopeAdopter.h
index a83d178482ac68bd7d6f3d0f2906163ac1abeebd..17742ba25532b0f9ad92bbb93e48828a40c9c0c3 100644
--- a/Source/core/dom/TreeScopeAdopter.h
+++ b/Source/core/dom/TreeScopeAdopter.h
@@ -33,7 +33,7 @@ class TreeScope;
class TreeScopeAdopter {
public:
- explicit TreeScopeAdopter(Node* toAdopt, TreeScope* newScope);
+ TreeScopeAdopter(Node& toAdopt, TreeScope& newScope);
void execute() const { moveTreeToNewScope(m_toAdopt); }
bool needsScopeChange() const { return m_oldScope != m_newScope; }
@@ -45,23 +45,21 @@ public:
#endif
private:
- void updateTreeScope(Node*) const;
- void moveTreeToNewScope(Node*) const;
- void moveTreeToNewDocument(Node*, Document* oldDocument, Document* newDocument) const;
- void moveNodeToNewDocument(Node*, Document* oldDocument, Document* newDocument) const;
+ void updateTreeScope(Node&) const;
+ void moveTreeToNewScope(Node&) const;
+ void moveTreeToNewDocument(Node&, Document& oldDocument, Document* newDocument) const;
+ void moveNodeToNewDocument(Node&, Document& oldDocument, Document* newDocument) const;
- Node* m_toAdopt;
- TreeScope* m_newScope;
- TreeScope* m_oldScope;
+ Node& m_toAdopt;
+ TreeScope& m_newScope;
+ TreeScope& m_oldScope;
};
-// FIXME: Should take |TreeScope&| instead of |TreeScope*|.
-inline TreeScopeAdopter::TreeScopeAdopter(Node* toAdopt, TreeScope* newScope)
+inline TreeScopeAdopter::TreeScopeAdopter(Node& toAdopt, TreeScope& newScope)
: m_toAdopt(toAdopt)
, m_newScope(newScope)
- , m_oldScope(&toAdopt->treeScope())
+ , m_oldScope(toAdopt.treeScope())
{
- ASSERT(newScope);
}
}
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/dom/TreeScopeAdopter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698