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

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

Issue 107073003: Introduce DEFINE_DOCUMENT_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « no previous file | Source/core/html/HTMLDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.h
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 2c064035ac5c807604ac82cc352518b34eb0ac6d..861c304b69e311fae0ec8d23cabc8619fe25e64f 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -1347,6 +1347,9 @@ inline const Document* toDocument(const ExecutionContext* executionContext)
DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode());
+#define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \
+ DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), document.is##thisType())
+
// All these varations are needed to avoid ambiguous overloads with the Node and TreeScope versions.
inline bool operator==(const Document& a, const Document& b) { return &a == &b; }
inline bool operator==(const Document& a, const Document* b) { return &a == b; }
« no previous file with comments | « no previous file | Source/core/html/HTMLDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698