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

Side by Side Diff: Source/core/rendering/InlineFlowBox.h

Issue 104593005: Introduce DEFINE_INLINE_BOX_TYPE_CASTS, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineTextBox.h » ('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) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 unsigned m_lineBreakBidiStatusLast : 5; // WTF::Unicode::Direction 343 unsigned m_lineBreakBidiStatusLast : 5; // WTF::Unicode::Direction
344 344
345 // End of RootInlineBox-specific members. 345 // End of RootInlineBox-specific members.
346 346
347 #ifndef NDEBUG 347 #ifndef NDEBUG
348 private: 348 private:
349 unsigned m_hasBadChildList : 1; 349 unsigned m_hasBadChildList : 1;
350 #endif 350 #endif
351 }; 351 };
352 352
353 inline InlineFlowBox* toInlineFlowBox(InlineBox* object) 353 DEFINE_INLINE_BOX_TYPE_CASTS(InlineFlowBox);
354 {
355 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
356 return static_cast<InlineFlowBox*>(object);
357 }
358
359 inline const InlineFlowBox* toInlineFlowBox(const InlineBox* object)
360 {
361 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
362 return static_cast<const InlineFlowBox*>(object);
363 }
364
365 // This will catch anyone doing an unnecessary cast.
366 void toInlineFlowBox(const InlineFlowBox*);
367 354
368 #ifdef NDEBUG 355 #ifdef NDEBUG
369 inline void InlineFlowBox::checkConsistency() const 356 inline void InlineFlowBox::checkConsistency() const
370 { 357 {
371 } 358 }
372 #endif 359 #endif
373 360
374 inline void InlineFlowBox::setHasBadChildList() 361 inline void InlineFlowBox::setHasBadChildList()
375 { 362 {
376 #ifndef NDEBUG 363 #ifndef NDEBUG
377 m_hasBadChildList = true; 364 m_hasBadChildList = true;
378 #endif 365 #endif
379 } 366 }
380 367
381 } // namespace WebCore 368 } // namespace WebCore
382 369
383 #ifndef NDEBUG 370 #ifndef NDEBUG
384 // Outside the WebCore namespace for ease of invocation from gdb. 371 // Outside the WebCore namespace for ease of invocation from gdb.
385 void showTree(const WebCore::InlineFlowBox*); 372 void showTree(const WebCore::InlineFlowBox*);
386 #endif 373 #endif
387 374
388 #endif // InlineFlowBox_h 375 #endif // InlineFlowBox_h
OLDNEW
« no previous file with comments | « Source/core/rendering/InlineBox.h ('k') | Source/core/rendering/InlineTextBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698