Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 03:43:53 +0000 (03:43 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 03:43:53 +0000 (03:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197044

Reviewed by Joseph Pecoraro.

* UIProcess/WebInspectorUtilities.h:
* UIProcess/WebInspectorUtilities.cpp:
(WebKit::trackInspectorPage):
(WebKit::untrackInspectorPage):
Determine the level of the inspector page by looking to see if the page being inspected is
in the inspector page map. If so, we must be inspecting an inspector page and should use
that inspector page's inspection level as the value to increment.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createFrontendPage):
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp
Source/WebKit/UIProcess/WebInspectorProxy.cpp
Source/WebKit/UIProcess/WebInspectorUtilities.cpp
Source/WebKit/UIProcess/WebInspectorUtilities.h

index 809d501..630e48b 100644 (file)
@@ -1,3 +1,23 @@
+2019-04-17  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
+        https://bugs.webkit.org/show_bug.cgi?id=197044
+
+        Reviewed by Joseph Pecoraro.
+
+        * UIProcess/WebInspectorUtilities.h:
+        * UIProcess/WebInspectorUtilities.cpp:
+        (WebKit::trackInspectorPage):
+        (WebKit::untrackInspectorPage):
+        Determine the level of the inspector page by looking to see if the page being inspected is
+        in the inspector page map. If so, we must be inspecting an inspector page and should use
+        that inspector page's inspection level as the value to increment.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::createFrontendPage):
+        * UIProcess/RemoteWebInspectorProxy.cpp:
+        (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
+
 2019-04-17  Tim Horton  <timothy_horton@apple.com>
 
         Adopt different scroll view flashing SPI
 2019-04-17  Tim Horton  <timothy_horton@apple.com>
 
         Adopt different scroll view flashing SPI
index dbe2ac0..87b224e 100644 (file)
@@ -150,7 +150,7 @@ void RemoteWebInspectorProxy::createFrontendPageAndWindow()
 
     m_inspectorPage = platformCreateFrontendPageAndWindow();
 
 
     m_inspectorPage = platformCreateFrontendPageAndWindow();
 
-    trackInspectorPage(m_inspectorPage);
+    trackInspectorPage(m_inspectorPage, nullptr);
 
     m_inspectorPage->process().addMessageReceiver(Messages::RemoteWebInspectorProxy::messageReceiverName(), m_inspectorPage->pageID(), *this);
     m_inspectorPage->process().assumeReadAccessToBaseURL(*m_inspectorPage, WebInspectorProxy::inspectorBaseURL());
 
     m_inspectorPage->process().addMessageReceiver(Messages::RemoteWebInspectorProxy::messageReceiverName(), m_inspectorPage->pageID(), *this);
     m_inspectorPage->process().assumeReadAccessToBaseURL(*m_inspectorPage, WebInspectorProxy::inspectorBaseURL());
index 56dca05..12bb261 100644 (file)
@@ -389,7 +389,7 @@ void WebInspectorProxy::createFrontendPage()
     if (!m_inspectorPage)
         return;
 
     if (!m_inspectorPage)
         return;
 
-    trackInspectorPage(m_inspectorPage);
+    trackInspectorPage(m_inspectorPage, m_inspectedPage);
 
     m_inspectorPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->pageID(), *this);
     m_inspectorPage->process().assumeReadAccessToBaseURL(*m_inspectorPage, WebInspectorProxy::inspectorBaseURL());
 
     m_inspectorPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->pageID(), *this);
     m_inspectorPage->process().assumeReadAccessToBaseURL(*m_inspectorPage, WebInspectorProxy::inspectorBaseURL());
index 07b9bc6..e5b1433 100644 (file)
@@ -61,14 +61,14 @@ String inspectorPageGroupIdentifierForPage(WebPageProxy* page)
     return makeString("__WebInspectorPageGroupLevel", inspectorLevelForPage(page), "__");
 }
 
     return makeString("__WebInspectorPageGroupLevel", inspectorLevelForPage(page), "__");
 }
 
-void trackInspectorPage(WebPageProxy* page)
+void trackInspectorPage(WebPageProxy* inspectorPage, WebPageProxy* inspectedPage)
 {
 {
-    pageLevelMap().set(page, inspectorLevelForPage(page));
+    pageLevelMap().set(inspectorPage, inspectorLevelForPage(inspectedPage));
 }
 
 }
 
-void untrackInspectorPage(WebPageProxy* page)
+void untrackInspectorPage(WebPageProxy* inspectorPage)
 {
 {
-    pageLevelMap().remove(page);
+    pageLevelMap().remove(inspectorPage);
 }
 
 static WebProcessPool* s_mainInspectorProcessPool;
 }
 
 static WebProcessPool* s_mainInspectorProcessPool;
index ec34570..c19ea75 100644 (file)
@@ -36,8 +36,8 @@ class WebProcessPool;
 // inspector level by setting a per-level page group identifier.
 unsigned inspectorLevelForPage(WebPageProxy*);
 String inspectorPageGroupIdentifierForPage(WebPageProxy*);
 // inspector level by setting a per-level page group identifier.
 unsigned inspectorLevelForPage(WebPageProxy*);
 String inspectorPageGroupIdentifierForPage(WebPageProxy*);
-void trackInspectorPage(WebPageProxy*);
-void untrackInspectorPage(WebPageProxy*);
+void trackInspectorPage(WebPageProxy* inspectorPage, WebPageProxy* inspectedPage);
+void untrackInspectorPage(WebPageProxy* inspectorPage);
 
 WebProcessPool& inspectorProcessPool(unsigned inspectionLevel);
 bool isInspectorProcessPool(WebProcessPool&);
 
 WebProcessPool& inspectorProcessPool(unsigned inspectionLevel);
 bool isInspectorProcessPool(WebProcessPool&);