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

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..fb0d9111b1ac2a22bfac100d8a2c3894c87fd9b5 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, predicate) \
tkent 2013/12/09 04:08:17 You don't need to add the second argument. Implem
gyuyoung-inactive 2013/12/09 04:42:28 Oops, I misunderstand your comment. Sorry about it
+ DEFINE_TYPE_CASTS(thisType, Document, document, document->predicate, document.predicate)
+
// 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