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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp

Issue 1843863002: Avoid crash during PaintController::showDebugData() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 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 "platform/graphics/paint/PaintController.h" 5 #include "platform/graphics/paint/PaintController.h"
6 6
7 #include "platform/NotImplemented.h" 7 #include "platform/NotImplemented.h"
8 #include "platform/TraceEvent.h" 8 #include "platform/TraceEvent.h"
9 #include "platform/graphics/GraphicsLayer.h" 9 #include "platform/graphics/GraphicsLayer.h"
10 #include "platform/graphics/paint/DrawingDisplayItem.h" 10 #include "platform/graphics/paint/DrawingDisplayItem.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 WTF::String PaintController::displayItemListAsDebugString(const DisplayItemList& list) const 556 WTF::String PaintController::displayItemListAsDebugString(const DisplayItemList& list) const
557 { 557 {
558 StringBuilder stringBuilder; 558 StringBuilder stringBuilder;
559 size_t i = 0; 559 size_t i = 0;
560 for (auto it = list.begin(); it != list.end(); ++it, ++i) { 560 for (auto it = list.begin(); it != list.end(); ++it, ++i) {
561 const DisplayItem& displayItem = *it; 561 const DisplayItem& displayItem = *it;
562 if (i) 562 if (i)
563 stringBuilder.append(",\n"); 563 stringBuilder.append(",\n");
564 stringBuilder.append(String::format("{index: %d, ", (int)i)); 564 stringBuilder.append(String::format("{index: %d, ", (int)i));
565 displayItem.dumpPropertiesAsDebugString(stringBuilder); 565 displayItem.dumpPropertiesAsDebugString(stringBuilder);
566 stringBuilder.append(", cacheIsValid: "); 566 if (displayItem.hasValidClient()) {
567 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" : "false"); 567 stringBuilder.append(", cacheIsValid: ");
568 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "tru e" : "false");
569 }
568 stringBuilder.append('}'); 570 stringBuilder.append('}');
569 } 571 }
570 return stringBuilder.toString(); 572 return stringBuilder.toString();
571 } 573 }
572 574
573 void PaintController::showDebugData() const 575 void PaintController::showDebugData() const
574 { 576 {
575 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); 577 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data());
576 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 578 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
577 } 579 }
578 580
579 #endif // ifndef NDEBUG 581 #endif // ifndef NDEBUG
580 582
581 } // namespace blink 583 } // 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