Changeset 199068 in webkit
- Timestamp:
- Apr 5, 2016 12:40:07 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199062 r199068 1 2016-04-05 Simon Fraser <simon.fraser@apple.com> 2 3 Add a "notifyutil" callback for dumping the RenderLayer tree, and move the registration to Page code 4 https://bugs.webkit.org/show_bug.cgi?id=156224 5 6 Reviewed by Zalan Bujtas. 7 8 Make it possible to run: 9 notifyutil -p com.apple.WebKit.showLayerTree 10 on the command line and have it dump out layer trees for all live documents, in 11 debug builds. 12 13 Move callback registration from RenderObject's constructor to Page. 14 15 * page/mac/PageMac.mm: 16 (WebCore::Page::platformInitialize): 17 * rendering/RenderObject.cpp: 18 (WebCore::printLayerTreeForLiveDocuments): 19 (WebCore::RenderObject::RenderObject): Deleted. 20 * rendering/RenderObject.h: 21 1 22 2016-04-05 Antoine Quint <graouts@apple.com> 2 23 -
trunk/Source/WebCore/page/mac/PageMac.mm
r194472 r199068 33 33 #import "FrameLoader.h" 34 34 #import "FrameTree.h" 35 #import "Logging.h" 35 36 #import "MainFrame.h" 37 #import "RenderObject.h" 36 38 37 39 #if PLATFORM(IOS) … … 51 53 #else 52 54 addSchedulePair(SchedulePair::create([NSRunLoop currentRunLoop], kCFRunLoopCommonModes)); 55 #endif 56 57 #if ENABLE(TREE_DEBUGGING) 58 static std::once_flag onceFlag; 59 std::call_once(onceFlag, [] { 60 registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments); 61 registerNotifyCallback("com.apple.WebKit.showLayerTree", printLayerTreeForLiveDocuments); 62 }); 53 63 #endif 54 64 } -
trunk/Source/WebCore/rendering/RenderObject.cpp
r198701 r199068 44 44 #include "HTMLTableElement.h" 45 45 #include "HitTestResult.h" 46 #include "Logging.h"47 46 #include "LogicalSelectionOffsetCaches.h" 48 47 #include "MainFrame.h" … … 85 84 86 85 #ifndef NDEBUG 87 void printRenderTreeForLiveDocuments();88 86 89 87 RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(RenderObject* renderObject, bool isForbidden) … … 129 127 #ifndef NDEBUG 130 128 renderObjectCounter.increment(); 131 static std::once_flag onceFlag;132 std::call_once(onceFlag, [] {133 registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments);134 });135 129 #endif 136 130 } … … 2278 2272 } 2279 2273 2280 #ifndef NDEBUG 2274 #if ENABLE(TREE_DEBUGGING) 2275 2281 2276 void printRenderTreeForLiveDocuments() 2282 2277 { … … 2290 2285 } 2291 2286 } 2287 2288 void printLayerTreeForLiveDocuments() 2289 { 2290 for (const auto* document : Document::allDocuments()) { 2291 if (!document->renderView() || document->inPageCache()) 2292 continue; 2293 if (document->frame() && document->frame()->isMainFrame()) 2294 fprintf(stderr, "----------------------main frame--------------------------\n"); 2295 fprintf(stderr, "%s", document->url().string().utf8().data()); 2296 showLayerTree(document->renderView()); 2297 } 2298 } 2299 2300 #endif // ENABLE(TREE_DEBUGGING) 2301 2302 } // namespace WebCore 2303 2304 #if ENABLE(TREE_DEBUGGING) 2305 2306 void showNodeTree(const WebCore::RenderObject* object) 2307 { 2308 if (!object) 2309 return; 2310 object->showNodeTreeForThis(); 2311 } 2312 2313 void showLineTree(const WebCore::RenderObject* object) 2314 { 2315 if (!object) 2316 return; 2317 object->showLineTreeForThis(); 2318 } 2319 2320 void showRenderTree(const WebCore::RenderObject* object) 2321 { 2322 if (!object) 2323 return; 2324 object->showRenderTreeForThis(); 2325 } 2326 2292 2327 #endif 2293 } // namespace WebCore2294 2295 #if ENABLE(TREE_DEBUGGING)2296 2297 void showNodeTree(const WebCore::RenderObject* object)2298 {2299 if (!object)2300 return;2301 object->showNodeTreeForThis();2302 }2303 2304 void showLineTree(const WebCore::RenderObject* object)2305 {2306 if (!object)2307 return;2308 object->showLineTreeForThis();2309 }2310 2311 void showRenderTree(const WebCore::RenderObject* object)2312 {2313 if (!object)2314 return;2315 object->showRenderTreeForThis();2316 }2317 2318 #endif -
trunk/Source/WebCore/rendering/RenderObject.h
r198998 r199068 1153 1153 } 1154 1154 1155 #if ENABLE(TREE_DEBUGGING) 1156 void printRenderTreeForLiveDocuments(); 1157 void printLayerTreeForLiveDocuments(); 1158 #endif 1159 1155 1160 } // namespace WebCore 1156 1161
Note: See TracChangeset
for help on using the changeset viewer.