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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPolyElement.cpp

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: static_cast<unsigned>(1) > 1u Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 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 30 matching lines...) Expand all
41 41
42 Path SVGPolyElement::asPathFromPoints() const { 42 Path SVGPolyElement::asPathFromPoints() const {
43 Path path; 43 Path path;
44 44
45 SVGPointList* pointsValue = points()->currentValue(); 45 SVGPointList* pointsValue = points()->currentValue();
46 if (pointsValue->isEmpty()) 46 if (pointsValue->isEmpty())
47 return path; 47 return path;
48 48
49 SVGPointList::ConstIterator it = pointsValue->begin(); 49 SVGPointList::ConstIterator it = pointsValue->begin();
50 SVGPointList::ConstIterator itEnd = pointsValue->end(); 50 SVGPointList::ConstIterator itEnd = pointsValue->end();
51 ASSERT(it != itEnd); 51 DCHECK(it != itEnd);
tkent 2017/03/14 22:33:14 Use DCHECK_NE if possible.
mrunal 2017/03/14 23:52:14 It throws an error, ../../base/logging.h:659:3: er
52 path.moveTo(it->value()); 52 path.moveTo(it->value());
53 ++it; 53 ++it;
54 54
55 for (; it != itEnd; ++it) 55 for (; it != itEnd; ++it)
56 path.addLineTo(it->value()); 56 path.addLineTo(it->value());
57 57
58 return path; 58 return path;
59 } 59 }
60 60
61 void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) { 61 void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) {
62 if (attrName == SVGNames::pointsAttr) { 62 if (attrName == SVGNames::pointsAttr) {
63 SVGElement::InvalidationGuard invalidationGuard(this); 63 SVGElement::InvalidationGuard invalidationGuard(this);
64 64
65 LayoutSVGShape* layoutObject = toLayoutSVGShape(this->layoutObject()); 65 LayoutSVGShape* layoutObject = toLayoutSVGShape(this->layoutObject());
66 if (!layoutObject) 66 if (!layoutObject)
67 return; 67 return;
68 68
69 layoutObject->setNeedsShapeUpdate(); 69 layoutObject->setNeedsShapeUpdate();
70 markForLayoutAndParentResourceInvalidation(layoutObject); 70 markForLayoutAndParentResourceInvalidation(layoutObject);
71 return; 71 return;
72 } 72 }
73 73
74 SVGGeometryElement::svgAttributeChanged(attrName); 74 SVGGeometryElement::svgAttributeChanged(attrName);
75 } 75 }
76 76
77 } // namespace blink 77 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698