Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
[WebKit-https.git] / Source / WebKit / UIProcess / WebInspectorUtilities.cpp
index 3b49ce0..e5b1433 100644 (file)
@@ -61,14 +61,14 @@ String inspectorPageGroupIdentifierForPage(WebPageProxy* 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;
@@ -82,6 +82,8 @@ WebProcessPool& inspectorProcessPool(unsigned inspectionLevel)
     if (!pool) {
         auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
         pool = &WebProcessPool::create(configuration.get()).leakRef();
+        // Do not delay process launch for inspector pages as inspector pages do not know how to transition from a terminated process.
+        pool->disableDelayedWebProcessLaunch();
     }
     return *pool;
 }