| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LayoutBoxModel_h | 5 #ifndef LayoutBoxModel_h |
| 6 #define LayoutBoxModel_h | 6 #define LayoutBoxModel_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
| 9 #include "core/layout/api/LayoutItem.h" | 9 #include "core/layout/api/LayoutItem.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class LayoutBoxModelObject; | 13 class LayoutBoxModelObject; |
| 14 | 14 |
| 15 class LayoutBoxModel : public LayoutItem { | 15 class LayoutBoxModel : public LayoutItem { |
| 16 public: | 16 public: |
| 17 explicit LayoutBoxModel(LayoutBoxModelObject* layoutBox) | 17 explicit LayoutBoxModel(LayoutBoxModelObject* layoutBox) |
| 18 : LayoutItem(layoutBox) {} | 18 : LayoutItem(layoutBox) {} |
| 19 | 19 |
| 20 explicit LayoutBoxModel(const LayoutItem& item) : LayoutItem(item) { | 20 explicit LayoutBoxModel(const LayoutItem& item) : LayoutItem(item) { |
| 21 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isBoxModelObject()); | 21 SECURITY_DCHECK(!item || item.isBoxModelObject()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 explicit LayoutBoxModel(std::nullptr_t) : LayoutItem(nullptr) {} | 24 explicit LayoutBoxModel(std::nullptr_t) : LayoutItem(nullptr) {} |
| 25 | 25 |
| 26 LayoutBoxModel() {} | 26 LayoutBoxModel() {} |
| 27 | 27 |
| 28 PaintLayer* layer() const { return toBoxModel()->layer(); } | 28 PaintLayer* layer() const { return toBoxModel()->layer(); } |
| 29 | 29 |
| 30 PaintLayerScrollableArea* getScrollableArea() const { | 30 PaintLayerScrollableArea* getScrollableArea() const { |
| 31 return toBoxModel()->getScrollableArea(); | 31 return toBoxModel()->getScrollableArea(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 44 return toLayoutBoxModelObject(layoutObject()); | 44 return toLayoutBoxModelObject(layoutObject()); |
| 45 } | 45 } |
| 46 const LayoutBoxModelObject* toBoxModel() const { | 46 const LayoutBoxModelObject* toBoxModel() const { |
| 47 return toLayoutBoxModelObject(layoutObject()); | 47 return toLayoutBoxModelObject(layoutObject()); |
| 48 } | 48 } |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace blink | 51 } // namespace blink |
| 52 | 52 |
| 53 #endif // LayoutBoxModel_h | 53 #endif // LayoutBoxModel_h |
| OLD | NEW |