Changeset 286498 in webkit
- Timestamp:
- Dec 3, 2021, 9:45:21 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Inspector/WebInspectorUIProxy.cpp (modified) (5 diffs)
-
UIProcess/Inspector/WebInspectorUIProxy.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r286497 r286498 1 2021-12-03 BJ Burg <bburg@apple.com> 2 3 Web Inspector: Web Inspector^2 crashes after closing if Web Inspector^1 closed first 4 https://bugs.webkit.org/show_bug.cgi?id=233293 5 <rdar://problem/85526508> 6 7 Reviewed by Devin Rousso. 8 9 Cache the inspected page's identifier. During frontend teardown, use the cached indentifier 10 to remove the message receiver that was added to receive messages from the inspected page. 11 12 Other operations using m_inspectedPage should be guarded in case that the inspected 13 page already been closed and destroyed. 14 15 * UIProcess/Inspector/WebInspectorUIProxy.cpp: 16 (WebKit::WebInspectorUIProxy::createFrontendPage): 17 (WebKit::WebInspectorUIProxy::closeFrontendPageAndWindow): 18 * UIProcess/Inspector/WebInspectorUIProxy.h: 19 20 1 21 2021-12-03 BJ Burg <bburg@apple.com> 2 22 -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp
r278253 r286498 1 1 /* 2 * Copyright (C) 2010-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2010-2021 Apple Inc. All rights reserved. 3 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 4 4 * … … 226 226 227 227 m_inspectedPage = &inspectedPage; 228 m_inspectedPageIdentifier = m_inspectedPage->identifier(); 229 228 230 m_inspectedPage->process().addMessageReceiver(Messages::WebInspectorUIProxy::messageReceiverName(), m_inspectedPage->webPageID(), *this); 229 231 … … 420 422 m_inspectedPage->launchInitialProcessIfNecessary(); 421 423 422 m_inspectorPage->process().addMessageReceiver(Messages::WebInspectorUIProxy::messageReceiverName(), m_inspectedPage ->identifier(), *this);424 m_inspectorPage->process().addMessageReceiver(Messages::WebInspectorUIProxy::messageReceiverName(), m_inspectedPageIdentifier, *this); 423 425 424 426 #if ENABLE(INSPECTOR_EXTENSIONS) … … 530 532 531 533 // Notify WebKit client when a local inspector closes so it can clear _WKInspectorDelegate and perform other cleanup. 532 m_inspectedPage->uiClient().willCloseLocalInspector(*m_inspectedPage, *this); 534 if (m_inspectedPage) 535 m_inspectedPage->uiClient().willCloseLocalInspector(*m_inspectedPage, *this); 533 536 534 537 m_isVisible = false; … … 540 543 541 544 m_inspectorPage->send(Messages::WebInspectorUI::SetIsVisible(m_isVisible)); 542 m_inspectorPage->process().removeMessageReceiver(Messages::WebInspectorUIProxy::messageReceiverName(), m_inspectedPage->identifier()); 543 544 if (m_isActiveFrontend) { 545 m_isActiveFrontend = false; 545 m_inspectorPage->process().removeMessageReceiver(Messages::WebInspectorUIProxy::messageReceiverName(), m_inspectedPageIdentifier); 546 547 if (m_inspectedPage && m_isActiveFrontend) 546 548 m_inspectedPage->inspectorController().disconnectFrontend(*this); 547 } 549 550 m_isActiveFrontend = false; 548 551 549 552 if (m_isAttached) -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h
r278253 r286498 1 1 /* 2 * Copyright (C) 2010-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2010-2021 Apple Inc. All rights reserved. 3 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. 4 4 * … … 32 32 #include "MessageReceiver.h" 33 33 #include "WebInspectorUtilities.h" 34 #include "WebPageProxyIdentifier.h" 34 35 #include <JavaScriptCore/InspectorFrontendChannel.h> 35 36 #include <WebCore/FloatRect.h> … … 289 290 WebPageProxy* m_inspectorPage { nullptr }; 290 291 std::unique_ptr<API::InspectorClient> m_inspectorClient; 292 WebPageProxyIdentifier m_inspectedPageIdentifier; 291 293 292 294 #if ENABLE(INSPECTOR_EXTENSIONS)
Note:
See TracChangeset
for help on using the changeset viewer.