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

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

Issue 1166123002: Use isolatedCopies for TracedLayoutObject strings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 19 matching lines...) Expand all
30 : m_address((unsigned long) &object) 30 : m_address((unsigned long) &object)
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_isFloating(object.isFloating()) 34 , m_isFloating(object.isFloating())
35 , m_selfNeeds(object.selfNeedsLayout()) 35 , m_selfNeeds(object.selfNeedsLayout())
36 , m_positionedMovement(object.needsPositionedMovementLayout()) 36 , m_positionedMovement(object.needsPositionedMovementLayout())
37 , m_childNeeds(object.normalChildNeedsLayout()) 37 , m_childNeeds(object.normalChildNeedsLayout())
38 , m_posChildNeeds(object.posChildNeedsLayout()) 38 , m_posChildNeeds(object.posChildNeedsLayout())
39 , m_isTableCell(object.isTableCell()) 39 , m_isTableCell(object.isTableCell())
40 , m_name(object.name()) 40 , m_name(String(object.name()).isolatedCopy())
41 , m_absRect(object.absoluteBoundingBoxRect()) 41 , m_absRect(object.absoluteBoundingBoxRect())
42 { 42 {
43 if (Node* node = object.node()) { 43 if (Node* node = object.node()) {
44 m_tag = node->nodeName(); 44 m_tag = String(node->nodeName()).isolatedCopy();
45 if (node->isElementNode()) { 45 if (node->isElementNode()) {
46 Element& element = toElement(*node); 46 Element& element = toElement(*node);
47 if (element.hasID()) 47 if (element.hasID())
48 m_id = element.getIdAttribute(); 48 m_id = String(element.getIdAttribute()).isolatedCopy();
49 if (element.hasClass()) { 49 if (element.hasClass()) {
50 for (size_t i = 0; i < element.classNames().size(); ++i) { 50 for (size_t i = 0; i < element.classNames().size(); ++i) {
51 m_classNames.append(element.classNames()[i]); 51 m_classNames.append(
52 String(element.classNames()[i]).isolatedCopy());
52 } 53 }
53 } 54 }
54 } 55 }
55 } 56 }
56 57
57 // FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are 58 // FIXME: When the fixmes in LayoutTreeAsText::writeLayoutObject() are
58 // fixed, deduplicate it with this. 59 // fixed, deduplicate it with this.
59 if (object.isText()) { 60 if (object.isText()) {
60 m_rect = LayoutRect(toLayoutText(object).linesBoundingBox()); 61 m_rect = LayoutRect(toLayoutText(object).linesBoundingBox());
61 } else if (object.isLayoutInline()) { 62 } else if (object.isLayoutInline()) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 RefPtr<JSONArray> children(JSONArray::create()); 131 RefPtr<JSONArray> children(JSONArray::create());
131 for (const auto& child : m_children) { 132 for (const auto& child : m_children) {
132 children->pushObject(child->toJSON()); 133 children->pushObject(child->toJSON());
133 } 134 }
134 json->setArray("children", children); 135 json->setArray("children", children);
135 } 136 }
136 return json.release(); 137 return json.release();
137 } 138 }
138 139
139 } // namespace blink 140 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698