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

Side by Side Diff: Source/core/svg/SVGDocument.h

Issue 14839007: Devirtualize Document class type checking (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Try again Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/PluginDocument.cpp ('k') | Source/core/svg/SVGDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void dispatchScrollEvent(); 44 void dispatchScrollEvent();
45 45
46 bool zoomAndPanEnabled() const; 46 bool zoomAndPanEnabled() const;
47 47
48 void startPan(const FloatPoint& start); 48 void startPan(const FloatPoint& start);
49 void updatePan(const FloatPoint& pos) const; 49 void updatePan(const FloatPoint& pos) const;
50 50
51 private: 51 private:
52 SVGDocument(Frame*, const KURL&); 52 SVGDocument(Frame*, const KURL&);
53 53
54 virtual bool isSVGDocument() const { return true; }
55
56 virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const; 54 virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const;
57 55
58 FloatPoint m_translate; 56 FloatPoint m_translate;
59 }; 57 };
60 58
61 inline SVGDocument* toSVGDocument(Document* document) 59 inline SVGDocument* toSVGDocument(Document* document)
62 { 60 {
63 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument()); 61 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument());
64 return static_cast<SVGDocument*>(document); 62 return static_cast<SVGDocument*>(document);
65 } 63 }
66 64
67 inline const SVGDocument* toSVGDocument(const Document* document) 65 inline const SVGDocument* toSVGDocument(const Document* document)
68 { 66 {
69 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument()); 67 ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument());
70 return static_cast<const SVGDocument*>(document); 68 return static_cast<const SVGDocument*>(document);
71 } 69 }
72 70
73 // This will catch anyone doing an unnecessary cast. 71 // This will catch anyone doing an unnecessary cast.
74 void toSVGDocument(const SVGDocument*); 72 void toSVGDocument(const SVGDocument*);
75 73
76 } // namespace WebCore 74 } // namespace WebCore
77 75
78 #endif // ENABLE(SVG) 76 #endif // ENABLE(SVG)
79 #endif // SVGDocument_h 77 #endif // SVGDocument_h
80 78
81 // vim:ts=4:noet 79 // vim:ts=4:noet
OLDNEW
« no previous file with comments | « Source/core/html/PluginDocument.cpp ('k') | Source/core/svg/SVGDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698