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/dom/Range.cpp

Issue 2401523002: Replace ASSERT family with DCHECK and so on in core/dom/. (Closed)
Patch Set: Created 4 years, 2 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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no)
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
5 * (C) 2001 Peter Kelly (pmk@post.com) 5 * (C) 2001 Peter Kelly (pmk@post.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 return compareBoundaryPoints(m_start, sourceRange->m_start, 355 return compareBoundaryPoints(m_start, sourceRange->m_start,
356 exceptionState); 356 exceptionState);
357 case kStartToEnd: 357 case kStartToEnd:
358 return compareBoundaryPoints(m_end, sourceRange->m_start, exceptionState); 358 return compareBoundaryPoints(m_end, sourceRange->m_start, exceptionState);
359 case kEndToEnd: 359 case kEndToEnd:
360 return compareBoundaryPoints(m_end, sourceRange->m_end, exceptionState); 360 return compareBoundaryPoints(m_end, sourceRange->m_end, exceptionState);
361 case kEndToStart: 361 case kEndToStart:
362 return compareBoundaryPoints(m_start, sourceRange->m_end, exceptionState); 362 return compareBoundaryPoints(m_start, sourceRange->m_end, exceptionState);
363 } 363 }
364 364
365 ASSERT_NOT_REACHED(); 365 NOTREACHED();
366 return 0; 366 return 0;
367 } 367 }
368 368
369 short Range::compareBoundaryPoints(Node* containerA, 369 short Range::compareBoundaryPoints(Node* containerA,
370 int offsetA, 370 int offsetA,
371 Node* containerB, 371 Node* containerB,
372 int offsetB, 372 int offsetB,
373 ExceptionState& exceptionState) { 373 ExceptionState& exceptionState) {
374 bool disconnected = false; 374 bool disconnected = false;
375 short result = comparePositionsInDOMTree(containerA, offsetA, containerB, 375 short result = comparePositionsInDOMTree(containerA, offsetA, containerB,
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 if (!offset) 1100 if (!offset)
1101 return nullptr; 1101 return nullptr;
1102 Node* childBefore = NodeTraversal::childAt(*n, offset - 1); 1102 Node* childBefore = NodeTraversal::childAt(*n, offset - 1);
1103 if (!childBefore) 1103 if (!childBefore)
1104 exceptionState.throwDOMException( 1104 exceptionState.throwDOMException(
1105 IndexSizeError, 1105 IndexSizeError,
1106 "There is no child at offset " + String::number(offset) + "."); 1106 "There is no child at offset " + String::number(offset) + ".");
1107 return childBefore; 1107 return childBefore;
1108 } 1108 }
1109 } 1109 }
1110 ASSERT_NOT_REACHED(); 1110 NOTREACHED();
1111 return nullptr; 1111 return nullptr;
1112 } 1112 }
1113 1113
1114 void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const { 1114 void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const {
1115 if (!n) { 1115 if (!n) {
1116 // FIXME: Generated bindings code never calls with null, and neither should 1116 // FIXME: Generated bindings code never calls with null, and neither should
1117 // other callers! 1117 // other callers!
1118 exceptionState.throwTypeError("The node provided is null."); 1118 exceptionState.throwTypeError("The node provided is null.");
1119 return; 1119 return;
1120 } 1120 }
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 .data() 1771 .data()
1772 << "start offset: " << range->startOffset() 1772 << "start offset: " << range->startOffset()
1773 << ", end offset: " << range->endOffset(); 1773 << ", end offset: " << range->endOffset();
1774 } else { 1774 } else {
1775 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " 1775 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are "
1776 "invalid."; 1776 "invalid.";
1777 } 1777 }
1778 } 1778 }
1779 1779
1780 #endif 1780 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/PseudoElementData.h ('k') | third_party/WebKit/Source/core/dom/RawDataDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698