Changeset 158976 in webkit
- Timestamp:
- Nov 8, 2013 4:39:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r158967 r158976 1 2013-11-08 Alexandru Chiculita <achicu@adobe.com> 2 3 Web Inspector: It should be possible to debug the Inspector code 4 https://bugs.webkit.org/show_bug.cgi?id=124065 5 6 Reviewed by Timothy Hatcher. 7 8 Added test to check that a second inspector window can be used to debug the first one. 9 10 * inspector-protocol/debugger/nested-inspectors-expected.txt: Added. 11 * inspector-protocol/debugger/nested-inspectors.html: Added. 12 1 13 2013-11-08 Hans Muller <hmuller@adobe.com> 2 14 -
trunk/Source/WebKit2/ChangeLog
r158971 r158976 1 2013-11-08 Alexandru Chiculita <achicu@adobe.com> 2 3 Web Inspector: It should be possible to debug the Inspector code 4 https://bugs.webkit.org/show_bug.cgi?id=124065 5 6 Reviewed by Timothy Hatcher. 7 8 When the script is paused, the debugger will pause all the pages in the same PageGroup. 9 All the Inspector windows were created in the same PageGroup, so pausing one debugger 10 would stop the other too. 11 12 Added WebInspectorPageGroups to manage the PageGroups created for the Inspectors. 13 The WebInspectors will now use the inspection "level" to figure out which PageGroup to use. 14 The inspector that debugs the main page will use "__WebInspectorPageGroupLevel1__", 15 the second inspector (that debugs the first inspector) will use "__WebInspectorPageGroupLevel2__" ... 16 17 * UIProcess/WebInspectorProxy.cpp: 18 (WebKit::WebInspectorPageGroups::shared): 19 (WebKit::WebInspectorPageGroups::inspectorLevel): 20 (WebKit::WebInspectorPageGroups::isInspectorPageGroup): 21 (WebKit::WebInspectorPageGroups::inspectorPageGroupLevel): 22 (WebKit::WebInspectorPageGroups::inspectorPageGroupForLevel): 23 (WebKit::WebInspectorPageGroups::createInspectorPageGroup): 24 (WebKit::WebInspectorProxy::WebInspectorProxy): 25 (WebKit::WebInspectorProxy::inspectorPageGroup): 26 (WebKit::WebInspectorProxy::isInspectorPage): 27 (WebKit::WebInspectorProxy::canAttach): 28 * UIProcess/WebInspectorProxy.h: 29 1 30 2013-11-08 Anders Carlsson <andersca@apple.com> 2 31 -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
r156550 r158976 59 59 const unsigned WebInspectorProxy::minimumAttachedHeight = 250; 60 60 61 static PassRefPtr<WebPageGroup> createInspectorPageGroup() 62 { 63 RefPtr<WebPageGroup> pageGroup = WebPageGroup::create("__WebInspectorPageGroup__", false, false); 61 class WebInspectorPageGroups { 62 public: 63 static WebInspectorPageGroups& shared() 64 { 65 DEFINE_STATIC_LOCAL(WebInspectorPageGroups, instance, ()); 66 return instance; 67 } 68 69 unsigned inspectorLevel(WebPageGroup* inspectedPageGroup) 70 { 71 return isInspectorPageGroup(inspectedPageGroup) ? inspectorPageGroupLevel(inspectedPageGroup) + 1 : 1; 72 } 73 74 bool isInspectorPageGroup(WebPageGroup* group) 75 { 76 return m_pageGroupLevel.contains(group); 77 } 78 79 unsigned inspectorPageGroupLevel(WebPageGroup* group) 80 { 81 ASSERT(isInspectorPageGroup(group)); 82 return m_pageGroupLevel.get(group); 83 } 84 85 WebPageGroup* inspectorPageGroupForLevel(unsigned level) 86 { 87 // The level is the key of the HashMap, so it cannot be 0. 88 ASSERT(level); 89 90 auto iterator = m_pageGroupByLevel.find(level); 91 if (iterator != m_pageGroupByLevel.end()) 92 return iterator->value.get(); 93 94 RefPtr<WebPageGroup> group = createInspectorPageGroup(level); 95 m_pageGroupByLevel.set(level, group.get()); 96 m_pageGroupLevel.set(group.get(), level); 97 return group.get(); 98 } 99 100 private: 101 static PassRefPtr<WebPageGroup> createInspectorPageGroup(unsigned level) 102 { 103 RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(String::format("__WebInspectorPageGroupLevel%u__", level), false, false); 64 104 65 105 #ifndef NDEBUG 66 // Allow developers to inspect the Web Inspector in debug builds. 67 pageGroup->preferences()->setDeveloperExtrasEnabled(true); 68 pageGroup->preferences()->setLogsPageMessagesToSystemConsoleEnabled(true); 69 #endif 70 71 pageGroup->preferences()->setApplicationChromeModeEnabled(true); 72 73 return pageGroup.release(); 74 } 75 76 WebPageGroup* WebInspectorProxy::inspectorPageGroup() 77 { 78 static WebPageGroup* pageGroup = createInspectorPageGroup().leakRef(); 79 return pageGroup; 80 } 106 // Allow developers to inspect the Web Inspector in debug builds. 107 pageGroup->preferences()->setDeveloperExtrasEnabled(true); 108 pageGroup->preferences()->setLogsPageMessagesToSystemConsoleEnabled(true); 109 #endif 110 111 pageGroup->preferences()->setApplicationChromeModeEnabled(true); 112 113 return pageGroup.release(); 114 } 115 116 typedef HashMap<unsigned, RefPtr<WebPageGroup> > PageGroupByLevelMap; 117 typedef HashMap<WebPageGroup*, unsigned> PageGroupLevelMap; 118 119 PageGroupByLevelMap m_pageGroupByLevel; 120 PageGroupLevelMap m_pageGroupLevel; 121 }; 81 122 82 123 WebInspectorProxy::WebInspectorProxy(WebPageProxy* page) … … 99 140 #endif 100 141 { 142 m_level = WebInspectorPageGroups::shared().inspectorLevel(m_page->pageGroup()); 101 143 m_page->process()->addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_page->pageID(), this); 102 144 } … … 104 146 WebInspectorProxy::~WebInspectorProxy() 105 147 { 148 } 149 150 WebPageGroup* WebInspectorProxy::inspectorPageGroup() const 151 { 152 return WebInspectorPageGroups::shared().inspectorPageGroupForLevel(m_level); 106 153 } 107 154 … … 312 359 bool WebInspectorProxy::isInspectorPage(WebPageProxy* page) 313 360 { 314 return page->pageGroup() == inspectorPageGroup();361 return WebInspectorPageGroups::shared().isInspectorPageGroup(page->pageGroup()); 315 362 } 316 363 … … 503 550 504 551 // Don't allow attaching to another inspector -- two inspectors in one window is too much! 505 bool isInspectorPage = m_page->pageGroup() == inspectorPageGroup(); 506 if (isInspectorPage) 552 if (m_level > 0) 507 553 return false; 508 554 -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h
r156354 r158976 191 191 void open(); 192 192 193 static WebPageGroup* inspectorPageGroup();193 WebPageGroup* inspectorPageGroup() const; 194 194 195 195 #if PLATFORM(GTK) || PLATFORM(EFL) … … 217 217 bool m_createdInspectorPage; 218 218 bool m_ignoreFirstBringToFront; 219 220 // The debugger stops all the pages in the same PageGroup. Having 221 // all the inspectors in the same group will make it impossible to debug 222 // the inspector code, so we use the level to make different page groups. 223 unsigned m_level; 219 224 220 225 AttachmentSide m_attachmentSide;
Note: See TracChangeset
for help on using the changeset viewer.