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

Side by Side Diff: third_party/WebKit/Source/core/layout/FloatingObjects.cpp

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 years, 11 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 &floatingObject); 520 &floatingObject);
521 } 521 }
522 522
523 void FloatingObjects::addPlacedObject(FloatingObject& floatingObject) { 523 void FloatingObjects::addPlacedObject(FloatingObject& floatingObject) {
524 ASSERT(!floatingObject.isInPlacedTree()); 524 ASSERT(!floatingObject.isInPlacedTree());
525 525
526 floatingObject.setIsPlaced(true); 526 floatingObject.setIsPlaced(true);
527 if (m_placedFloatsTree.isInitialized()) 527 if (m_placedFloatsTree.isInitialized())
528 m_placedFloatsTree.add(intervalForFloatingObject(floatingObject)); 528 m_placedFloatsTree.add(intervalForFloatingObject(floatingObject));
529 529
530 #if ENABLE(ASSERT) 530 #if DCHECK_IS_ON()
531 floatingObject.setIsInPlacedTree(true); 531 floatingObject.setIsInPlacedTree(true);
532 #endif 532 #endif
533 markLowestFloatLogicalBottomCacheAsDirty(); 533 markLowestFloatLogicalBottomCacheAsDirty();
534 } 534 }
535 535
536 void FloatingObjects::removePlacedObject(FloatingObject& floatingObject) { 536 void FloatingObjects::removePlacedObject(FloatingObject& floatingObject) {
537 ASSERT(floatingObject.isPlaced() && floatingObject.isInPlacedTree()); 537 ASSERT(floatingObject.isPlaced() && floatingObject.isInPlacedTree());
538 538
539 if (m_placedFloatsTree.isInitialized()) { 539 if (m_placedFloatsTree.isInitialized()) {
540 bool removed = 540 bool removed =
541 m_placedFloatsTree.remove(intervalForFloatingObject(floatingObject)); 541 m_placedFloatsTree.remove(intervalForFloatingObject(floatingObject));
542 DCHECK(removed); 542 DCHECK(removed);
543 } 543 }
544 544
545 floatingObject.setIsPlaced(false); 545 floatingObject.setIsPlaced(false);
546 #if ENABLE(ASSERT) 546 #if DCHECK_IS_ON()
547 floatingObject.setIsInPlacedTree(false); 547 floatingObject.setIsInPlacedTree(false);
548 #endif 548 #endif
549 markLowestFloatLogicalBottomCacheAsDirty(); 549 markLowestFloatLogicalBottomCacheAsDirty();
550 } 550 }
551 551
552 FloatingObject* FloatingObjects::add( 552 FloatingObject* FloatingObjects::add(
553 std::unique_ptr<FloatingObject> floatingObject) { 553 std::unique_ptr<FloatingObject> floatingObject) {
554 FloatingObject* newObject = floatingObject.release(); 554 FloatingObject* newObject = floatingObject.release();
555 increaseObjectsCount(newObject->getType()); 555 increaseObjectsCount(newObject->getType());
556 m_set.add(WTF::wrapUnique(newObject)); 556 m_set.add(WTF::wrapUnique(newObject));
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 const FloatingObject* floatingObject) { 748 const FloatingObject* floatingObject) {
749 return String::format("%p (%gx%g %gx%g)", floatingObject, 749 return String::format("%p (%gx%g %gx%g)", floatingObject,
750 floatingObject->frameRect().x().toFloat(), 750 floatingObject->frameRect().x().toFloat(),
751 floatingObject->frameRect().y().toFloat(), 751 floatingObject->frameRect().y().toFloat(),
752 floatingObject->frameRect().maxX().toFloat(), 752 floatingObject->frameRect().maxX().toFloat(),
753 floatingObject->frameRect().maxY().toFloat()); 753 floatingObject->frameRect().maxY().toFloat());
754 } 754 }
755 #endif 755 #endif
756 756
757 } // namespace blink 757 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698