browser(webkit): do not crash when opening web inspector (#3631)

This commit is contained in:
Yury Semikhatsky 2020-08-26 08:55:18 -07:00 committed by GitHub
parent f9eeb2984a
commit 80cf7e9fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -1,2 +1,2 @@
1333
Changed: yurys@chromium.org Tue Aug 25 15:39:47 PDT 2020
1334
Changed: yurys@chromium.org Tue Aug 25 18:01:13 PDT 2020

View File

@ -9999,10 +9999,10 @@ index 0000000000000000000000000000000000000000..f356c613945fd263889bc74166bef2b2
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2c5e2bc04b51b39ae4f3128c86afb29e0042b968
index 0000000000000000000000000000000000000000..8e3989ef7f9947c685dcbe30d58561dab7f5ea5b
--- /dev/null
+++ b/Source/WebKit/UIProcess/InspectorPlaywrightAgent.cpp
@@ -0,0 +1,848 @@
@@ -0,0 +1,855 @@
+/*
+ * Copyright (C) 2019 Microsoft Corporation.
+ *
@ -10043,6 +10043,7 @@ index 0000000000000000000000000000000000000000..2c5e2bc04b51b39ae4f3128c86afb29e
+#include "WebAutomationSession.h"
+#include "WebGeolocationManagerProxy.h"
+#include "WebGeolocationPosition.h"
+#include "WebInspectorUtilities.h"
+#include "WebPageInspectorController.h"
+#include "WebPageInspectorTarget.h"
+#include "WebPageProxy.h"
@ -10327,6 +10328,9 @@ index 0000000000000000000000000000000000000000..2c5e2bc04b51b39ae4f3128c86afb29e
+ if (!m_isEnabled)
+ return;
+
+ if (isInspectorProcessPool(page.process().processPool()))
+ return;
+
+ ASSERT(m_frontendChannel);
+
+ String browserContextID = toBrowserContextIDProtocolString(page.sessionID());
@ -10354,6 +10358,9 @@ index 0000000000000000000000000000000000000000..2c5e2bc04b51b39ae4f3128c86afb29e
+ if (!m_isEnabled)
+ return;
+
+ if (isInspectorProcessPool(page.process().processPool()))
+ return;
+
+ String browserContextID = toBrowserContextIDProtocolString(page.sessionID());
+ BrowserContext* browserContext = getExistingBrowserContext(browserContextID);
+ browserContext->pages.remove(&page);