Changeset 259597 in webkit
- Timestamp:
- Apr 6, 2020, 2:59:37 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/Frame.cpp (modified) (2 diffs)
-
WebCore/page/Frame.h (modified) (1 diff)
-
WebCore/page/FrameView.cpp (modified) (4 diffs)
-
WebCore/page/FrameView.h (modified) (1 diff)
-
WebCore/platform/ScrollView.cpp (modified) (5 diffs)
-
WebCore/platform/ScrollView.h (modified) (1 diff)
-
WebCore/platform/ScrollableArea.cpp (modified) (1 diff)
-
WebCore/platform/ScrollableArea.h (modified) (3 diffs)
-
WebCore/platform/win/PopupMenuWin.cpp (modified) (2 diffs)
-
WebCore/platform/win/PopupMenuWin.h (modified) (1 diff)
-
WebCore/rendering/RenderLayer.cpp (modified) (3 diffs)
-
WebCore/rendering/RenderLayer.h (modified) (1 diff)
-
WebCore/rendering/RenderLayerCompositor.cpp (modified) (1 diff)
-
WebCore/rendering/RenderListBox.cpp (modified) (1 diff)
-
WebCore/rendering/RenderListBox.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp (modified) (2 diffs)
-
WebKit/UIProcess/win/WebPopupMenuProxyWin.h (modified) (1 diff)
-
WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (modified) (1 diff)
-
WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r259595 r259597 1 2020-04-06 Simon Fraser <simon.fraser@apple.com> 2 3 Make ScrollableArea TextStream-loggable 4 https://bugs.webkit.org/show_bug.cgi?id=210042 5 6 Reviewed by Darin Adler. 7 8 ScrollableArea is a pure virtual base class, so has to dump via a virtual function, 9 so add debugDescription() and implement it in derived classes. 10 11 Make the common pattern be that operator<<(TextStream&, ...) calls debugDescription. 12 13 * page/Frame.cpp: 14 (WebCore::Frame::debugDescription const): 15 (WebCore::operator<<): 16 * page/Frame.h: 17 * page/FrameView.cpp: 18 (WebCore::FrameView::debugDescription const): 19 (WebCore::operator<<): 20 * page/FrameView.h: 21 * platform/ScrollView.cpp: 22 (WebCore::ScrollView::debugDescription const): 23 * platform/ScrollView.h: 24 * platform/ScrollableArea.cpp: 25 (WebCore::operator<<): 26 * platform/ScrollableArea.h: 27 * rendering/RenderLayer.cpp: 28 (WebCore::RenderLayer::debugDescription const): 29 (WebCore::RenderLayer::calculateClipRects const): 30 * rendering/RenderLayer.h: 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::updateCompositingLayers): 33 * rendering/RenderListBox.cpp: 34 (WebCore::RenderListBox::debugDescription const): 35 * rendering/RenderListBox.h: 36 1 37 2020-04-06 Jack Lee <shihchieh_lee@apple.com> 2 38 -
trunk/Source/WebCore/page/Frame.cpp
r259523 r259597 104 104 #include "runtime_root.h" 105 105 #include <JavaScriptCore/RegularExpression.h> 106 #include <wtf/HexNumber.h> 106 107 #include <wtf/RefCountedLeakCounter.h> 107 108 #include <wtf/StdLibExtras.h> … … 1059 1060 } 1060 1061 1062 String Frame::debugDescription() const 1063 { 1064 StringBuilder builder; 1065 1066 builder.append("Frame 0x"_s, hex(reinterpret_cast<uintptr_t>(this), Lowercase)); 1067 if (isMainFrame()) 1068 builder.append(" (main frame)"_s); 1069 1070 if (auto document = this->document()) 1071 builder.append(' ', document->documentURI()); 1072 1073 return builder.toString(); 1074 } 1075 1061 1076 TextStream& operator<<(TextStream& ts, const Frame& frame) 1062 1077 { 1063 ts << "Frame " << &frame << " view " << frame.view() << " (is main frame " << frame.isMainFrame() << ") " << (frame.document() ? frame.document()->documentURI() : emptyString());1078 ts << frame.debugDescription(); 1064 1079 return ts; 1065 1080 } -
trunk/Source/WebCore/page/Frame.h
r259335 r259597 191 191 bool requestDOMPasteAccess(); 192 192 193 String debugDescription() const; 194 193 195 // ======== All public functions below this point are candidates to move out of Frame into another class. ======== 194 196 -
trunk/Source/WebCore/page/FrameView.cpp
r259575 r259597 104 104 #include "VisualViewport.h" 105 105 #include "WheelEventTestMonitor.h" 106 #include <wtf/text/TextStream.h> 107 106 #include <wtf/HexNumber.h> 108 107 #include <wtf/IsoMallocInlines.h> 109 108 #include <wtf/MemoryPressureHandler.h> … … 111 110 #include <wtf/SetForScope.h> 112 111 #include <wtf/SystemTracing.h> 112 #include <wtf/text/TextStream.h> 113 113 114 114 #if USE(COORDINATED_GRAPHICS) … … 1424 1424 if (frame().isMainFrame()) 1425 1425 builder.appendLiteral("Main"); 1426 builder.appendLiteral("FrameView: "); 1427 builder.append(message); 1426 builder.append("FrameView: ", message); 1428 1427 document->addConsoleMessage(MessageSource::Other, MessageLevel::Debug, builder.toString()); 1428 } 1429 1430 String FrameView::debugDescription() const 1431 { 1432 return makeString("FrameView 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase), ' ', frame().debugDescription()); 1429 1433 } 1430 1434 … … 5459 5463 TextStream& operator<<(TextStream& ts, const FrameView& view) 5460 5464 { 5461 ts << "FrameView " << &view << " frame " << view.frame();5465 ts << view.debugDescription(); 5462 5466 return ts; 5463 5467 } -
trunk/Source/WebCore/page/FrameView.h
r259335 r259597 665 665 bool inUpdateEmbeddedObjects() const { return m_inUpdateEmbeddedObjects; } 666 666 667 String debugDescription() const final; 668 667 669 protected: 668 670 bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) final; -
trunk/Source/WebCore/platform/ScrollView.cpp
r256911 r259597 36 36 #include "Scrollbar.h" 37 37 #include "ScrollbarTheme.h" 38 #include <wtf/HexNumber.h> 38 39 #include <wtf/StdLibExtras.h> 39 40 #include <wtf/text/TextStream.h> … … 1533 1534 } 1534 1535 1536 String ScrollView::debugDescription() const 1537 { 1538 return makeString("ScrollView 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)); 1539 } 1540 1535 1541 #if !PLATFORM(COCOA) 1536 1542 … … 1543 1549 } 1544 1550 1545 #endif1546 1547 #if !PLATFORM(COCOA)1548 1549 1551 void ScrollView::platformSetScrollbarsSuppressed(bool) 1550 1552 { … … 1558 1560 { 1559 1561 } 1560 1561 #endif1562 1563 #if !PLATFORM(COCOA)1564 1562 1565 1563 void ScrollView::platformSetScrollbarModes() … … 1653 1651 } 1654 1652 1655 #endif 1656 1657 } 1653 #endif // !PLATFORM(COCOA) 1654 1655 } -
trunk/Source/WebCore/platform/ScrollView.h
r259333 r259597 450 450 451 451 bool isScrollView() const final { return true; } 452 String debugDescription() const override; 452 453 453 454 void init(); -
trunk/Source/WebCore/platform/ScrollableArea.cpp
r255957 r259597 770 770 } 771 771 772 TextStream& operator<<(TextStream& ts, const ScrollableArea& scrollableArea) 773 { 774 ts << scrollableArea.debugDescription(); 775 return ts; 776 } 777 772 778 } // namespace WebCore -
trunk/Source/WebCore/platform/ScrollableArea.h
r259333 r259597 32 32 #include <wtf/WeakPtr.h> 33 33 34 namespace WTF { 35 class TextStream; 36 } 37 34 38 namespace WebCore { 35 39 … … 346 350 347 351 virtual bool shouldPlaceBlockDirectionScrollbarOnLeft() const = 0; 352 353 virtual String debugDescription() const = 0; 348 354 349 355 protected: … … 415 421 }; 416 422 423 WTF::TextStream& operator<<(WTF::TextStream&, const ScrollableArea&); 424 417 425 } // namespace WebCore -
trunk/Source/WebCore/platform/win/PopupMenuWin.cpp
r246488 r259597 50 50 #include "TextRun.h" 51 51 #include "WebCoreInstanceHandle.h" 52 #include <wtf/HexNumber.h> 52 53 #include <wtf/WindowsExtras.h> 54 #include <wtf/text/StringBuilder.h> 53 55 54 56 #include <windows.h> … … 1083 1085 } 1084 1086 1087 String PopupMenuWin::debugDescription() const 1088 { 1089 return makeString("PopupMenuWin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)); 1090 } 1091 1085 1092 AccessiblePopupMenu::AccessiblePopupMenu(const PopupMenuWin& popupMenu) 1086 1093 : m_popupMenu(popupMenu) -
trunk/Source/WebCore/platform/win/PopupMenuWin.h
r246488 r259597 49 49 50 50 static LPCWSTR popupClassName(); 51 52 String debugDescription() const final; 51 53 52 54 private: -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r259557 r259597 128 128 #include "WheelEventTestMonitor.h" 129 129 #include <stdio.h> 130 #include <wtf/HexNumber.h> 130 131 #include <wtf/MonotonicTime.h> 131 132 #include <wtf/StdLibExtras.h> … … 3626 3627 } 3627 3628 3629 String RenderLayer::debugDescription() const 3630 { 3631 StringBuilder builder; 3632 builder.append("RenderLayer 0x"_s, hex(reinterpret_cast<uintptr_t>(this), Lowercase), ' ', size().width(), 'x', size().height()); 3633 3634 if (transform()) 3635 builder.append(" has transform"_s); 3636 3637 if (hasFilter()) 3638 builder.append(" has filter"_s); 3639 3640 if (hasBackdropFilter()) 3641 builder.append(" has backdrop filter"_s); 3642 3643 if (hasBlendMode()) 3644 builder.append(" has blend mode"_s); 3645 3646 if (isolatesBlending()) 3647 builder.append(" isolates blending"_s); 3648 3649 if (isComposited()) { 3650 // Oh for better StringBuilder/TextStream integration. 3651 TextStream stream; 3652 stream << *backing(); 3653 builder.append(stream.release()); 3654 } 3655 3656 return builder.toString(); 3657 } 3658 3628 3659 int RenderLayer::verticalScrollbarWidth(OverlayScrollbarSizeRelevancy relevancy) const 3629 3660 { … … 7012 7043 TextStream& operator<<(TextStream& ts, const RenderLayer& layer) 7013 7044 { 7014 ts << "RenderLayer " << &layer << " " << layer.size(); 7015 if (layer.transform()) 7016 ts << " has transform"; 7017 if (layer.hasFilter()) 7018 ts << " has filter"; 7019 if (layer.hasBackdropFilter()) 7020 ts << " has backdrop filter"; 7021 if (layer.hasBlendMode()) 7022 ts << " has blend mode"; 7023 if (layer.isolatesBlending()) 7024 ts << " isolates blending"; 7025 if (layer.isComposited()) 7026 ts << " " << *layer.backing(); 7045 ts << layer.debugDescription(); 7027 7046 return ts; 7028 7047 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r259333 r259597 927 927 void invalidateEventRegion(); 928 928 929 String debugDescription() const final; 930 929 931 private: 930 932 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r259015 r259597 711 711 bool RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot) 712 712 { 713 LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " updateCompositingLayers " << updateType << " contentLayersCount " << m_contentLayersCount);713 LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " [" << m_renderView.frameView() << "] updateCompositingLayers " << updateType << " contentLayersCount " << m_contentLayersCount); 714 714 715 715 TraceScope tracingScope(CompositingUpdateStart, CompositingUpdateEnd); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r259445 r259597 911 911 } 912 912 913 String RenderListBox::debugDescription() const 914 { 915 return RenderObject::debugDescription(); 916 } 917 913 918 Ref<Scrollbar> RenderListBox::createScrollbar() 914 919 { -
trunk/Source/WebCore/rendering/RenderListBox.h
r259333 r259597 142 142 bool usesMockScrollAnimator() const final; 143 143 void logMockScrollAnimatorMessage(const String&) const final; 144 String debugDescription() const final; 144 145 145 146 // NOTE: This should only be called by the overridden setScrollOffset from ScrollableArea. -
trunk/Source/WebKit/ChangeLog
r259591 r259597 1 2020-04-06 Simon Fraser <simon.fraser@apple.com> 2 3 Make ScrollableArea TextStream-loggable 4 https://bugs.webkit.org/show_bug.cgi?id=210042 5 6 Reviewed by Darin Adler. 7 8 ScrollableArea is a pure virtual base class, so has to dump via a virtual function, 9 so add debugDescription() and implement it in derived classes. 10 11 Make the common pattern be that operator<<(TextStream&, ...) calls debugDescription. 12 13 * UIProcess/win/WebPopupMenuProxyWin.cpp: 14 (WebKit::WebPopupMenuProxyWin::debugDescription const): 15 * UIProcess/win/WebPopupMenuProxyWin.h: 16 * WebProcess/Plugins/PDF/PDFPlugin.h: 17 * WebProcess/Plugins/PDF/PDFPlugin.mm: 18 (WebKit::PDFPlugin::debugDescription const): 19 1 20 2020-04-06 Commit Queue <commit-queue@webkit.org> 2 21 -
trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp
r249921 r259597 42 42 #include <WebCore/WebCoreInstanceHandle.h> 43 43 #include <windowsx.h> 44 #include <wtf/HexNumber.h> 45 #include <wtf/text/StringBuilder.h> 44 46 45 47 #if USE(DIRECT2D) … … 1034 1036 } 1035 1037 #endif 1038 1039 String WebPopupMenuProxyWin::debugDescription() const 1040 { 1041 return makeString("WebPopupMenuProxyWin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)); 1042 } 1043 1036 1044 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h
r249921 r259597 59 59 60 60 void hide() { hidePopupMenu(); } 61 62 String debugDescription() const final; 61 63 62 64 private: -
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
r259333 r259597 247 247 bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const final; 248 248 bool shouldPlaceBlockDirectionScrollbarOnLeft() const final { return false; } 249 String debugDescription() const final; 249 250 250 251 // PDFPlugin functions. -
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
r258477 r259597 90 90 #import <pal/spi/cg/CoreGraphicsSPI.h> 91 91 #import <pal/spi/mac/NSMenuSPI.h> 92 #import <wtf/HexNumber.h> 92 93 #import <wtf/UUID.h> 93 94 #import <wtf/WTFSemaphore.h> … … 1282 1283 1283 1284 return point; 1285 } 1286 1287 String PDFPlugin::debugDescription() const 1288 { 1289 return makeString("PDFPlugin 0x", hex(reinterpret_cast<uintptr_t>(this), Lowercase)); 1284 1290 } 1285 1291
Note:
See TracChangeset
for help on using the changeset viewer.