Title: [223772] trunk/Source/WebKit
- Revision
- 223772
- Author
- bb...@apple.com
- Date
- 2017-10-20 10:28:58 -0700 (Fri, 20 Oct 2017)
Log Message
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=177661
<rdar://problem/34740286>
Reviewed by Joseph Pecoraro.
This patch refactors some Cocoa code pathas.
Rename the timer that closes the WebView so it's more obvious what it is for.
Extract the common code to close the frontend window so its not implemented by
the timer callback.
In later patches, this will be extracted further into platform methods to open/close
the frontend and window, like how it is for RemoteWebInspectorProxy.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
(WebKit::WebInspectorProxy::closeFrontend):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::platformDidClose):
(WebKit::WebInspectorProxy::platformDidCloseForCrash):
(WebKit::WebInspectorProxy::platformInvalidate):
(WebKit::WebInspectorProxy::closeTimerFired): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (223771 => 223772)
--- trunk/Source/WebKit/ChangeLog 2017-10-20 17:28:57 UTC (rev 223771)
+++ trunk/Source/WebKit/ChangeLog 2017-10-20 17:28:58 UTC (rev 223772)
@@ -1,3 +1,31 @@
+2017-10-02 Brian Burg <bb...@apple.com>
+
+ Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=177661
+ <rdar://problem/34740286>
+
+ Reviewed by Joseph Pecoraro.
+
+ This patch refactors some Cocoa code pathas.
+ Rename the timer that closes the WebView so it's more obvious what it is for.
+ Extract the common code to close the frontend window so its not implemented by
+ the timer callback.
+
+ In later patches, this will be extracted further into platform methods to open/close
+ the frontend and window, like how it is for RemoteWebInspectorProxy.
+
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorProxy::WebInspectorProxy):
+ * UIProcess/WebInspectorProxy.h:
+ * UIProcess/mac/WebInspectorProxyMac.mm:
+ (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
+ (WebKit::WebInspectorProxy::closeFrontend):
+ (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+ (WebKit::WebInspectorProxy::platformDidClose):
+ (WebKit::WebInspectorProxy::platformDidCloseForCrash):
+ (WebKit::WebInspectorProxy::platformInvalidate):
+ (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
+
2017-09-30 Brian Burg <bb...@apple.com>
Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
Modified: trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp (223771 => 223772)
--- trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp 2017-10-20 17:28:57 UTC (rev 223771)
+++ trunk/Source/WebKit/UIProcess/WebInspectorProxy.cpp 2017-10-20 17:28:58 UTC (rev 223772)
@@ -63,7 +63,7 @@
WebInspectorProxy::WebInspectorProxy(WebPageProxy* inspectedPage)
: m_inspectedPage(inspectedPage)
#if PLATFORM(MAC) && WK_API_ENABLED
- , m_closeTimer(RunLoop::main(), this, &WebInspectorProxy::closeTimerFired)
+ , m_closeFrontendAfterInactivityTimer(RunLoop::main(), this, &WebInspectorProxy::closeFrontendAfterInactivityTimerFired)
#endif
{
m_inspectedPage->process().addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_inspectedPage->pageID(), *this);
Modified: trunk/Source/WebKit/UIProcess/WebInspectorProxy.h (223771 => 223772)
--- trunk/Source/WebKit/UIProcess/WebInspectorProxy.h 2017-10-20 17:28:57 UTC (rev 223771)
+++ trunk/Source/WebKit/UIProcess/WebInspectorProxy.h 2017-10-20 17:28:58 UTC (rev 223772)
@@ -105,7 +105,8 @@
void setInspectorWindowFrame(WKRect&);
WKRect inspectorWindowFrame();
- void closeTimerFired();
+ void closeFrontend();
+ void closeFrontendAfterInactivityTimerFired();
void attachmentViewDidChange(NSView *oldView, NSView *newView);
#endif
@@ -236,7 +237,7 @@
RetainPtr<NSWindow> m_inspectorWindow;
RetainPtr<WKWebInspectorProxyObjCAdapter> m_objCAdapter;
HashMap<String, RetainPtr<NSURL>> m_suggestedToActualURLMap;
- RunLoop::Timer<WebInspectorProxy> m_closeTimer;
+ RunLoop::Timer<WebInspectorProxy> m_closeFrontendAfterInactivityTimer;
String m_urlString;
#elif PLATFORM(GTK)
std::unique_ptr<WebInspectorProxyClient> m_client;
Modified: trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm (223771 => 223772)
--- trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm 2017-10-20 17:28:57 UTC (rev 223771)
+++ trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm 2017-10-20 17:28:58 UTC (rev 223772)
@@ -164,10 +164,14 @@
return WKRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
}
-void WebInspectorProxy::closeTimerFired()
+void WebInspectorProxy::closeFrontendAfterInactivityTimerFired()
{
+ closeFrontend();
+}
+
+void WebInspectorProxy::closeFrontend()
+{
ASSERT(!m_isAttached || !m_inspectorWindow);
-
if (m_inspectorView) {
m_inspectorView->_page->close();
m_inspectorView = nil;
@@ -268,7 +272,7 @@
{
ASSERT(inspectedPage());
- m_closeTimer.stop();
+ m_closeFrontendAfterInactivityTimer.stop();
if (m_inspectorView) {
ASSERT(m_objCAdapter);
@@ -352,21 +356,21 @@
m_inspectorWindow = nil;
}
- m_closeTimer.startOneShot(webViewCloseTimeout);
+ m_closeFrontendAfterInactivityTimer.startOneShot(webViewCloseTimeout);
}
void WebInspectorProxy::platformDidCloseForCrash()
{
- m_closeTimer.stop();
+ m_closeFrontendAfterInactivityTimer.stop();
- closeTimerFired();
+ closeFrontend();
}
void WebInspectorProxy::platformInvalidate()
{
- m_closeTimer.stop();
+ m_closeFrontendAfterInactivityTimer.stop();
- closeTimerFired();
+ closeFrontend();
}
void WebInspectorProxy::platformHide()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes