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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGParsingError.h

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible 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) Research In Motion Limited 2011. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
3 * Copyright (C) 2011 Apple, Inc. All rights reserved. 3 * Copyright (C) 2011 Apple, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ParsingFailed, 61 ParsingFailed,
62 }; 62 };
63 63
64 class SVGParsingError { 64 class SVGParsingError {
65 STACK_ALLOCATED(); 65 STACK_ALLOCATED();
66 66
67 public: 67 public:
68 SVGParsingError(SVGParseStatus status = SVGParseStatus::NoError, 68 SVGParsingError(SVGParseStatus status = SVGParseStatus::NoError,
69 size_t locus = 0) 69 size_t locus = 0)
70 : m_status(static_cast<unsigned>(status)), m_locus(checkLocus(locus)) { 70 : m_status(static_cast<unsigned>(status)), m_locus(checkLocus(locus)) {
71 ASSERT(this->status() == status); 71 DCHECK_EQ(this->status(), status);
72 } 72 }
73 73
74 SVGParseStatus status() const { 74 SVGParseStatus status() const {
75 return static_cast<SVGParseStatus>(m_status); 75 return static_cast<SVGParseStatus>(m_status);
76 } 76 }
77 77
78 bool hasLocus() const { return m_locus != kNoLocus; } 78 bool hasLocus() const { return m_locus != kNoLocus; }
79 unsigned locus() const { return m_locus; } 79 unsigned locus() const { return m_locus; }
80 80
81 // Move the locus of this error by |offset|, returning in a new error. 81 // Move the locus of this error by |offset|, returning in a new error.
(...skipping 28 matching lines...) Expand all
110 inline bool operator==(const SVGParsingError& error, SVGParseStatus status) { 110 inline bool operator==(const SVGParsingError& error, SVGParseStatus status) {
111 return error.status() == status; 111 return error.status() == status;
112 } 112 }
113 inline bool operator!=(const SVGParsingError& error, SVGParseStatus status) { 113 inline bool operator!=(const SVGParsingError& error, SVGParseStatus status) {
114 return !(error == status); 114 return !(error == status);
115 } 115 }
116 116
117 } // namespace blink 117 } // namespace blink
118 118
119 #endif // SVGParsingError_h 119 #endif // SVGParsingError_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp ('k') | third_party/WebKit/Source/core/svg/SVGParsingError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698