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