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

Unified Diff: Source/core/dom/shadow/ShadowRoot.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/TreeScopeAdopter.cpp ('k') | Source/core/html/HTMLTemplateElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/ShadowRoot.h
diff --git a/Source/core/dom/shadow/ShadowRoot.h b/Source/core/dom/shadow/ShadowRoot.h
index 738c7bebc2b8d443ebc7427b388e148621690201..df0b5186c308974e025cf4ffc724ccedeb9959da 100644
--- a/Source/core/dom/shadow/ShadowRoot.h
+++ b/Source/core/dom/shadow/ShadowRoot.h
@@ -166,6 +166,12 @@ inline ShadowRoot* toShadowRoot(Node* node)
return const_cast<ShadowRoot*>(toShadowRoot(static_cast<const Node*>(node)));
}
+inline ShadowRoot& toShadowRoot(Node& node)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(node.isShadowRoot());
+ return static_cast<ShadowRoot&>(node);
+}
+
inline const ShadowRoot& toShadowRoot(const Node& node)
{
ASSERT_WITH_SECURITY_IMPLICATION(node.isShadowRoot());
« no previous file with comments | « Source/core/dom/TreeScopeAdopter.cpp ('k') | Source/core/html/HTMLTemplateElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698