Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/graphics/paint/DisplayItem.h" | 6 #include "platform/graphics/paint/DisplayItem.h" |
| 7 | 7 |
| 8 namespace blink { | 8 namespace blink { |
| 9 | 9 |
| 10 struct SameSizeAsDisplayItem { | 10 struct SameSizeAsDisplayItem { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 DEBUG_STRING_CASE(BeginSubsequence); | 196 DEBUG_STRING_CASE(BeginSubsequence); |
| 197 DEBUG_STRING_CASE(EndSubsequence); | 197 DEBUG_STRING_CASE(EndSubsequence); |
| 198 DEBUG_STRING_CASE(CachedSubsequence); | 198 DEBUG_STRING_CASE(CachedSubsequence); |
| 199 DEBUG_STRING_CASE(UninitializedType); | 199 DEBUG_STRING_CASE(UninitializedType); |
| 200 DEFAULT_CASE; | 200 DEFAULT_CASE; |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 WTF::String DisplayItem::asDebugString() const | 204 WTF::String DisplayItem::asDebugString() const |
| 205 { | 205 { |
| 206 if (!isValid()) | |
| 207 return "null"; | |
| 208 WTF::StringBuilder stringBuilder; | 206 WTF::StringBuilder stringBuilder; |
| 209 stringBuilder.append('{'); | 207 stringBuilder.append('{'); |
| 210 dumpPropertiesAsDebugString(stringBuilder); | 208 dumpPropertiesAsDebugString(stringBuilder); |
| 211 stringBuilder.append('}'); | 209 stringBuilder.append('}'); |
| 212 return stringBuilder.toString(); | 210 return stringBuilder.toString(); |
| 213 } | 211 } |
| 214 | 212 |
| 215 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const | 213 void DisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringBuilder) const |
| 216 { | 214 { |
| 217 ASSERT(isValid()); | 215 if (!isValid()) { |
| 216 stringBuilder.append("valid: false, originalDebugString: "); | |
| 217 stringBuilder.append(clientDebugString()); | |
|
pdr.
2015/09/03 01:59:20
Can you add quotes around this so it's valid-ish j
Xianzhu
2015/09/03 05:48:44
It's the original display item's debug string whic
| |
| 218 return; | |
| 219 } | |
| 220 | |
| 218 stringBuilder.append(String::format("client: \"%p", client())); | 221 stringBuilder.append(String::format("client: \"%p", client())); |
| 219 if (!clientDebugString().isEmpty()) { | 222 if (!clientDebugString().isEmpty()) { |
| 220 stringBuilder.append(' '); | 223 stringBuilder.append(' '); |
| 221 stringBuilder.append(clientDebugString()); | 224 stringBuilder.append(clientDebugString()); |
| 222 } | 225 } |
| 223 stringBuilder.append("\", type: \""); | 226 stringBuilder.append("\", type: \""); |
| 224 stringBuilder.append(typeAsDebugString(type())); | 227 stringBuilder.append(typeAsDebugString(type())); |
| 225 stringBuilder.append('"'); | 228 stringBuilder.append('"'); |
| 226 if (m_skippedCache) | 229 if (m_skippedCache) |
| 227 stringBuilder.append(", skippedCache: true"); | 230 stringBuilder.append(", skippedCache: true"); |
| 228 if (m_scope) | 231 if (m_scope) |
| 229 stringBuilder.append(String::format(", scope: %d", m_scope)); | 232 stringBuilder.append(String::format(", scope: %d", m_scope)); |
| 230 } | 233 } |
| 231 | 234 |
| 232 #endif | 235 #endif |
| 233 | 236 |
| 234 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |