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

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

Issue 1422773008: Fixing remaining VC++ 2015 64-bit build breaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some CR tweaks Created 5 years, 1 month 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 // 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 "config.h" 5 #include "config.h"
6 #include "core/layout/TracedLayoutObject.h" 6 #include "core/layout/TracedLayoutObject.h"
7 7
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/layout/LayoutTableCell.h" 9 #include "core/layout/LayoutTableCell.h"
10 #include "core/layout/LayoutText.h" 10 #include "core/layout/LayoutText.h"
11 #include "core/layout/LayoutView.h" 11 #include "core/layout/LayoutView.h"
12 #include "platform/JSONValues.h" 12 #include "platform/JSONValues.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(cons t LayoutView& view, bool traceGeometry) 16 PassRefPtr<TraceEvent::ConvertableToTraceFormat> TracedLayoutObject::create(cons t LayoutView& view, bool traceGeometry)
17 { 17 {
18 return adoptRef(new TracedLayoutObject(view, traceGeometry)); 18 return adoptRef(new TracedLayoutObject(view, traceGeometry));
19 } 19 }
20 20
21 String TracedLayoutObject::asTraceFormat() const 21 String TracedLayoutObject::asTraceFormat() const
22 { 22 {
23 StringBuilder builder; 23 StringBuilder builder;
24 RefPtr<JSONObject> json(toJSON()); 24 RefPtr<JSONObject> json(toJSON());
25 json->writeJSON(&builder); 25 json->writeJSON(&builder);
26 return builder.toString(); 26 return builder.toString();
27 } 27 }
28 28
29 TracedLayoutObject::TracedLayoutObject(const LayoutObject& object, bool traceGeo metry) 29 TracedLayoutObject::TracedLayoutObject(const LayoutObject& object, bool traceGeo metry)
30 : m_address((unsigned long) &object) 30 : m_address(reinterpret_cast<uintptr_t>(&object))
Will Harris 2015/11/10 23:01:31 is a cast even needed here now?
brucedawson 2015/11/11 01:09:04 The cast is still needed because we're changing fr
31 , m_isAnonymous(object.isAnonymous()) 31 , m_isAnonymous(object.isAnonymous())
32 , m_isPositioned(object.isOutOfFlowPositioned()) 32 , m_isPositioned(object.isOutOfFlowPositioned())
33 , m_isRelPositioned(object.isRelPositioned()) 33 , m_isRelPositioned(object.isRelPositioned())
34 , m_isStickyPositioned(object.isStickyPositioned()) 34 , m_isStickyPositioned(object.isStickyPositioned())
35 , m_isFloating(object.isFloating()) 35 , m_isFloating(object.isFloating())
36 , m_selfNeeds(object.selfNeedsLayout()) 36 , m_selfNeeds(object.selfNeedsLayout())
37 , m_positionedMovement(object.needsPositionedMovementLayout()) 37 , m_positionedMovement(object.needsPositionedMovementLayout())
38 , m_childNeeds(object.normalChildNeedsLayout()) 38 , m_childNeeds(object.normalChildNeedsLayout())
39 , m_posChildNeeds(object.posChildNeedsLayout()) 39 , m_posChildNeeds(object.posChildNeedsLayout())
40 , m_isTableCell(object.isTableCell()) 40 , m_isTableCell(object.isTableCell())
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 for (LayoutObject* child = object.slowFirstChild(); child; child = child->ne xtSibling()) { 82 for (LayoutObject* child = object.slowFirstChild(); child; child = child->ne xtSibling()) {
83 m_children.append(adoptRef(new TracedLayoutObject(*child, traceGeometry) )); 83 m_children.append(adoptRef(new TracedLayoutObject(*child, traceGeometry) ));
84 } 84 }
85 } 85 }
86 86
87 PassRefPtr<JSONObject> TracedLayoutObject::toJSON() const 87 PassRefPtr<JSONObject> TracedLayoutObject::toJSON() const
88 { 88 {
89 RefPtr<JSONObject> json(JSONObject::create()); 89 RefPtr<JSONObject> json(JSONObject::create());
90 json->setNumber("address", m_address); 90 json->setNumber("address", m_address);
Will Harris 2015/11/10 23:01:30 how does this code compile when m_address is now a
brucedawson 2015/11/11 01:09:04 Converting from uintptr_t to double is totally leg
91 json->setString("name", m_name); 91 json->setString("name", m_name);
92 if (!m_tag.isEmpty()) 92 if (!m_tag.isEmpty())
93 json->setString("tag", m_tag); 93 json->setString("tag", m_tag);
94 if (!m_id.isEmpty()) 94 if (!m_id.isEmpty())
95 json->setString("htmlId", m_id); 95 json->setString("htmlId", m_id);
96 if (m_classNames.size()) { 96 if (m_classNames.size()) {
97 RefPtr<JSONArray> classNames(JSONArray::create()); 97 RefPtr<JSONArray> classNames(JSONArray::create());
98 for (const auto& className : m_classNames) { 98 for (const auto& className : m_classNames) {
99 classNames->pushString(className); 99 classNames->pushString(className);
100 } 100 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 RefPtr<JSONArray> children(JSONArray::create()); 136 RefPtr<JSONArray> children(JSONArray::create());
137 for (const auto& child : m_children) { 137 for (const auto& child : m_children) {
138 children->pushObject(child->toJSON()); 138 children->pushObject(child->toJSON());
139 } 139 }
140 json->setArray("children", children); 140 json->setArray("children", children);
141 } 141 }
142 return json.release(); 142 return json.release();
143 } 143 }
144 144
145 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698