Changeset 259103 in webkit
- Timestamp:
- Mar 26, 2020 9:20:20 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r259097 r259103 1 2020-03-26 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: Unable to show Web Inspector on empty tabs in Safari 4 https://bugs.webkit.org/show_bug.cgi?id=209639 5 <rdar://problem/60937524> 6 7 Reviewed by Darin Adler. 8 9 Make sure we launch the WebPageProxy's initial process when trying to inspect the 10 page using Web Inspector (i.e. WebInspectorProxy::connect() is called). 11 12 * UIProcess/Inspector/WebInspectorProxy.cpp: 13 (WebKit::WebInspectorProxy::WebInspectorProxy): 14 - Take in a reference instead of a raw pointer as it could never be null. 15 - Store the inspected page and add the message receiver to its process, even 16 if the process is the dummy one (due to delayed process launch). 17 18 (WebKit::WebInspectorProxy::invalidate): 19 Call reset() to avoid code duplication. 20 21 (WebKit::WebInspectorProxy::connect): 22 Launch the page's initial process if necessary before trying to send IPC to that 23 process. 24 25 (WebKit::WebInspectorProxy::updateForNewPageProcess): 26 Take in a reference instead of a raw pointer as it could never be null. 27 28 * UIProcess/Inspector/WebInspectorProxy.h: 29 (WebKit::WebInspectorProxy::create): 30 Take in a reference instead of a raw pointer as it could never be null. 31 32 * UIProcess/WebPageProxy.cpp: 33 (WebKit::WebPageProxy::launchProcess): 34 Call WebInspectorProxy::reset() before launching and connecting to the new process. 35 This is important now that the WebInspectorProxy connect to the dummy process proxy. 36 We need to make sure the WebInspectorProxy disconnects from the dummy process proxy 37 because we connect it to the newly launched process. 38 39 (WebKit::WebPageProxy::finishAttachingToWebProcess): 40 1 41 2020-03-26 Chris Dumez <cdumez@apple.com> 2 42 -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp
r258245 r259103 67 67 const unsigned WebInspectorProxy::initialWindowHeight = 650; 68 68 69 WebInspectorProxy::WebInspectorProxy(WebPageProxy* inspectedPage) 69 WebInspectorProxy::WebInspectorProxy(WebPageProxy& inspectedPage) 70 : m_inspectedPage(&inspectedPage) 70 71 #if PLATFORM(MAC) 71 :m_closeFrontendAfterInactivityTimer(RunLoop::main(), this, &WebInspectorProxy::closeFrontendAfterInactivityTimerFired)72 , m_closeFrontendAfterInactivityTimer(RunLoop::main(), this, &WebInspectorProxy::closeFrontendAfterInactivityTimerFired) 72 73 #endif 73 74 { 74 if (inspectedPage && inspectedPage->hasRunningProcess()) { 75 m_inspectedPage = inspectedPage; 76 m_inspectedPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->webPageID(), *this); 77 } 75 m_inspectedPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->webPageID(), *this); 78 76 } 79 77 … … 95 93 void WebInspectorProxy::invalidate() 96 94 { 97 if (m_inspectedPage)98 m_inspectedPage->process().removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->webPageID());99 100 95 closeFrontendPageAndWindow(); 101 96 platformInvalidate(); 102 97 103 m_inspectedPage = nullptr;98 reset(); 104 99 } 105 100 … … 134 129 createFrontendPage(); 135 130 131 m_inspectedPage->launchInitialProcessIfNecessary(); 136 132 m_inspectedPage->send(Messages::WebInspectorInterruptDispatcher::NotifyNeedDebuggerBreak(), 0); 137 133 m_inspectedPage->send(Messages::WebInspector::Show()); … … 214 210 } 215 211 216 void WebInspectorProxy::updateForNewPageProcess(WebPageProxy *inspectedPage)212 void WebInspectorProxy::updateForNewPageProcess(WebPageProxy& inspectedPage) 217 213 { 218 214 ASSERT(!m_inspectedPage); 219 ASSERT(inspectedPage); 220 221 m_inspectedPage = inspectedPage; 215 216 m_inspectedPage = &inspectedPage; 222 217 m_inspectedPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->webPageID(), *this); 223 218 -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorProxy.h
r258245 r259103 81 81 { 82 82 public: 83 static Ref<WebInspectorProxy> create(WebPageProxy *inspectedPage)83 static Ref<WebInspectorProxy> create(WebPageProxy& inspectedPage) 84 84 { 85 85 return adoptRef(*new WebInspectorProxy(inspectedPage)); … … 108 108 109 109 void reset(); 110 void updateForNewPageProcess(WebPageProxy *);110 void updateForNewPageProcess(WebPageProxy&); 111 111 112 112 #if PLATFORM(MAC) … … 182 182 183 183 private: 184 explicit WebInspectorProxy(WebPageProxy *);184 explicit WebInspectorProxy(WebPageProxy&); 185 185 186 186 void createFrontendPage(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r259097 r259103 509 509 m_pageGroup->addPage(this); 510 510 511 m_inspector = WebInspectorProxy::create( this);511 m_inspector = WebInspectorProxy::create(*this); 512 512 513 513 if (hasRunningProcess()) … … 786 786 787 787 RELEASE_LOG_IF_ALLOWED(Loading, "launchProcess:"); 788 789 // In case we are currently connected to the dummy process, we need to make sure the inspector proxy 790 // disconnects from the dummy process first. 791 m_inspector->reset(); 788 792 789 793 m_process->removeWebPage(*this, WebProcessProxy::EndsUsingDataStore::Yes); … … 925 929 initializeWebPage(); 926 930 927 m_inspector->updateForNewPageProcess( this);931 m_inspector->updateForNewPageProcess(*this); 928 932 929 933 #if ENABLE(REMOTE_INSPECTOR) -
trunk/Tools/ChangeLog
r259102 r259103 1 2020-03-26 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION: Unable to show Web Inspector on empty tabs in Safari 4 https://bugs.webkit.org/show_bug.cgi?id=209639 5 <rdar://problem/60937524> 6 7 Reviewed by Darin Adler. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 1 13 2020-03-26 Fujii Hironori <Hironori.Fujii@sony.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r259100 r259103 3967 3967 } 3968 3968 3969 TEST(ProcessSwap, WebInspectorDelayedProcessLaunch) 3970 { 3971 auto processPoolConfiguration = psonProcessPoolConfiguration(); 3972 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 3973 3974 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 3975 [webViewConfiguration setProcessPool:processPool.get()]; 3976 webViewConfiguration.get().preferences._developerExtrasEnabled = YES; 3977 3978 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 3979 3980 EXPECT_EQ(0, [webView _webProcessIdentifier]); 3981 TestWebKitAPI::Util::spinRunLoop(100); 3982 EXPECT_EQ(0, [webView _webProcessIdentifier]); 3983 3984 [[webView _inspector] show]; 3985 EXPECT_TRUE([[webView _inspector] isConnected]); 3986 3987 // Trying to inspect the view should launch a WebProcess. 3988 while (![webView _webProcessIdentifier]) 3989 TestWebKitAPI::Util::spinRunLoop(10); 3990 EXPECT_NE(0, [webView _webProcessIdentifier]); 3991 3992 [[webView _inspector] close]; 3993 } 3994 3969 3995 #endif // !TARGET_OS_IPHONE 3970 3996
Note: See TracChangeset
for help on using the changeset viewer.