| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "core/layout/TracedLayoutObject.h" | 5 #include "core/layout/TracedLayoutObject.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutInline.h" | 7 #include "core/layout/LayoutInline.h" |
| 8 #include "core/layout/LayoutTableCell.h" | 8 #include "core/layout/LayoutTableCell.h" |
| 9 #include "core/layout/LayoutText.h" | 9 #include "core/layout/LayoutText.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| 11 #include <inttypes.h> | 11 #include <inttypes.h> |
| 12 #include <memory> | |
| 13 | 12 |
| 14 namespace blink { | 13 namespace blink { |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 void dumpToTracedValue(const LayoutObject& object, bool traceGeometry, TracedVal
ue* tracedValue) | 17 void dumpToTracedValue(const LayoutObject& object, bool traceGeometry, TracedVal
ue* tracedValue) |
| 19 { | 18 { |
| 20 tracedValue->setString("address", String::format("%" PRIxPTR, reinterpret_ca
st<uintptr_t>(&object))); | 19 tracedValue->setString("address", String::format("%" PRIxPTR, reinterpret_ca
st<uintptr_t>(&object))); |
| 21 tracedValue->setString("name", object.name()); | 20 tracedValue->setString("name", object.name()); |
| 22 if (Node* node = object.node()) { | 21 if (Node* node = object.node()) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 tracedValue->beginDictionary(); | 92 tracedValue->beginDictionary(); |
| 94 dumpToTracedValue(*child, traceGeometry, tracedValue); | 93 dumpToTracedValue(*child, traceGeometry, tracedValue); |
| 95 tracedValue->endDictionary(); | 94 tracedValue->endDictionary(); |
| 96 } | 95 } |
| 97 tracedValue->endArray(); | 96 tracedValue->endArray(); |
| 98 } | 97 } |
| 99 } | 98 } |
| 100 | 99 |
| 101 } // namespace | 100 } // namespace |
| 102 | 101 |
| 103 std::unique_ptr<TracedValue> TracedLayoutObject::create(const LayoutView& view,
bool traceGeometry) | 102 PassOwnPtr<TracedValue> TracedLayoutObject::create(const LayoutView& view, bool
traceGeometry) |
| 104 { | 103 { |
| 105 std::unique_ptr<TracedValue> tracedValue = TracedValue::create(); | 104 OwnPtr<TracedValue> tracedValue = TracedValue::create(); |
| 106 dumpToTracedValue(view, traceGeometry, tracedValue.get()); | 105 dumpToTracedValue(view, traceGeometry, tracedValue.get()); |
| 107 return tracedValue; | 106 return tracedValue; |
| 108 } | 107 } |
| 109 | 108 |
| 110 } // namespace blink | 109 } // namespace blink |
| OLD | NEW |