Share WebInspector stubs for ports without local inspection
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2020 20:18:57 +0000 (20:18 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2020 20:18:57 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206267

Reviewed by Alex Christensen.

No new tests. No change in behavior.

Ports that do no allow local inspection of a web page can share a number of stubs
around the Web Inspector. This is the case for iOS, WPE and the PlayStation port.
Make the platform guards specific to actual implementations.

* SourcesWPE.txt:
* UIProcess/RemoteWebInspectorProxy.cpp:
* UIProcess/WebInspectorProxy.cpp:
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
* UIProcess/wpe/WebInspectorProxyWPE.cpp: Removed.
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::localizedStringsURL const):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::canSave):
(WebKit::WebInspectorUI::localizedStringsURL const):
* WebProcess/WebPage/mac/WebInspectorUIMac.mm:
* WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Removed.
* WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254627 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp
Source/WebKit/UIProcess/WebInspectorProxy.cpp
Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm
Source/WebKit/UIProcess/wpe/WebInspectorProxyWPE.cpp [deleted file]
Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp
Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp
Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm
Source/WebKit/WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp [deleted file]
Source/WebKit/WebProcess/WebPage/wpe/WebInspectorWPE.cpp [deleted file]

index a587b57..12c1741 100644 (file)
@@ -1,3 +1,30 @@
+2020-01-15  Don Olmstead  <don.olmstead@sony.com>
+
+        Share WebInspector stubs for ports without local inspection
+        https://bugs.webkit.org/show_bug.cgi?id=206267
+
+        Reviewed by Alex Christensen.
+
+        No new tests. No change in behavior.
+
+        Ports that do no allow local inspection of a web page can share a number of stubs
+        around the Web Inspector. This is the case for iOS, WPE and the PlayStation port.
+        Make the platform guards specific to actual implementations.
+
+        * SourcesWPE.txt:
+        * UIProcess/RemoteWebInspectorProxy.cpp:
+        * UIProcess/WebInspectorProxy.cpp:
+        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
+        * UIProcess/wpe/WebInspectorProxyWPE.cpp: Removed.
+        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
+        (WebKit::RemoteWebInspectorUI::localizedStringsURL const):
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::canSave):
+        (WebKit::WebInspectorUI::localizedStringsURL const):
+        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
+        * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Removed.
+        * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Removed.
+
 2020-01-15  David Kilzer  <ddkilzer@apple.com>
 
         [Cocoa] Create a simulated crash log when the UI Process receives an invalid CoreIPC message
index 8106581..afcfdd9 100644 (file)
@@ -213,7 +213,6 @@ UIProcess/linux/MemoryPressureMonitor.cpp
 UIProcess/soup/WebCookieManagerProxySoup.cpp
 UIProcess/soup/WebProcessPoolSoup.cpp
 
-UIProcess/wpe/WebInspectorProxyWPE.cpp
 UIProcess/wpe/WebPageProxyWPE.cpp
 
 WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp @no-unify
@@ -260,7 +259,6 @@ WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
 
 WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp @no-unify
 
-WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp
 WebProcess/WebPage/wpe/WebPageWPE.cpp
 
 WebProcess/glib/WebProcessGLib.cpp
index 5b0fcb4..2192c29 100644 (file)
@@ -186,7 +186,7 @@ void RemoteWebInspectorProxy::closeFrontendPageAndWindow()
     platformCloseFrontendPageAndWindow();
 }
 
-#if (!ENABLE(REMOTE_INSPECTOR) && !PLATFORM(MAC)) || PLATFORM(WPE)
+#if !ENABLE(REMOTE_INSPECTOR) || (!PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN))
 WebPageProxy* RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow()
 {
     notImplemented();
@@ -202,6 +202,6 @@ void RemoteWebInspectorProxy::platformStartWindowDrag() { }
 void RemoteWebInspectorProxy::platformOpenInNewTab(const String&) { }
 void RemoteWebInspectorProxy::platformShowCertificate(const CertificateInfo&) { }
 void RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow() { }
-#endif
+#endif // !ENABLE(REMOTE_INSPECTOR) || (!PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN))
 
 } // namespace WebKit
index 8b526dd..23d705e 100644 (file)
@@ -636,7 +636,7 @@ bool WebInspectorProxy::shouldOpenAttached()
 
 // Unsupported configurations can use the stubs provided here.
 
-#if PLATFORM(IOS_FAMILY)
+#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
 
 WebPageProxy* WebInspectorProxy::platformCreateFrontendPage()
 {
@@ -781,6 +781,6 @@ void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
     notImplemented();
 }
 
-#endif // PLATFORM(IOS_FAMILY)
+#endif // !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
 
 } // namespace WebKit
index 686a1f1..4abdeb5 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "RemoteWebInspectorProxy.h"
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && ENABLE(REMOTE_INSPECTOR)
 
 #import "RemoteWebInspectorProxyMessages.h"
 #import "RemoteWebInspectorUIMessages.h"
diff --git a/Source/WebKit/UIProcess/wpe/WebInspectorProxyWPE.cpp b/Source/WebKit/UIProcess/wpe/WebInspectorProxyWPE.cpp
deleted file mode 100644 (file)
index 8f8ff3a..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebInspectorProxy.h"
-
-#include <WebCore/CertificateInfo.h>
-#include <WebCore/NotImplemented.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-class FloatRect;
-}
-
-namespace WebKit {
-
-WebPageProxy* WebInspectorProxy::platformCreateFrontendPage()
-{
-    notImplemented();
-    return nullptr;
-}
-
-void WebInspectorProxy::platformCreateFrontendWindow()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformCloseFrontendPageAndWindow()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformDidCloseForCrash()
-{
-}
-
-void WebInspectorProxy::platformInvalidate()
-{
-}
-
-void WebInspectorProxy::platformHide()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformResetState()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformBringToFront()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformBringInspectedPageToFront()
-{
-    notImplemented();
-}
-
-bool WebInspectorProxy::platformIsFront()
-{
-    notImplemented();
-    return false;
-}
-
-void WebInspectorProxy::platformInspectedURLChanged(const String&)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformShowCertificate(const WebCore::CertificateInfo&)
-{
-    notImplemented();
-}
-
-String WebInspectorProxy::inspectorPageURL()
-{
-    return String("resource:///org/webkit/inspector/UserInterface/Main.html");
-}
-
-String WebInspectorProxy::inspectorTestPageURL()
-{
-    return String("resource:///org/webkit/inspector/UserInterface/Test.html");
-}
-
-String WebInspectorProxy::inspectorBaseURL()
-{
-    return String("resource:///org/webkit/inspector/UserInterface/");
-}
-
-DebuggableInfoData WebInspectorProxy::infoForLocalDebuggable()
-{
-    // FIXME <https://webkit.org/b/205538>: this should infer more useful data.
-    return DebuggableInfoData::empty();
-}
-
-unsigned WebInspectorProxy::platformInspectedWindowHeight()
-{
-    notImplemented();
-    return 0;
-}
-
-unsigned WebInspectorProxy::platformInspectedWindowWidth()
-{
-    notImplemented();
-    return 0;
-}
-
-void WebInspectorProxy::platformAttach()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformDetach()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformSetAttachedWindowHeight(unsigned)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformSetAttachedWindowWidth(unsigned)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformSetSheetRect(const WebCore::FloatRect&)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformStartWindowDrag()
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformSave(const String&, const String&, bool, bool)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformAppend(const String&, const String&)
-{
-    notImplemented();
-}
-
-void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
-{
-    notImplemented();
-}
-
-} // namespace WebKit
index 1fa907c..558d8f0 100644 (file)
 #include <WebCore/InspectorController.h>
 #include <WebCore/Settings.h>
 
+#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
+#include <WebCore/NotImplemented.h>
+#endif
+
 namespace WebKit {
 using namespace WebCore;
 
@@ -216,4 +220,12 @@ void RemoteWebInspectorUI::setDiagnosticLoggingAvailable(bool available)
 }
 #endif
 
+#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
+String RemoteWebInspectorUI::localizedStringsURL() const
+{
+    notImplemented();
+    return emptyString();
+}
+#endif // !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
+
 } // namespace WebKit
index 0864461..1faa6f6 100644 (file)
@@ -394,4 +394,18 @@ String WebInspectorUI::targetProductVersion() const
     return m_debuggableInfo.targetProductVersion;
 }
 
+#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
+bool WebInspectorUI::canSave()
+{
+    notImplemented();
+    return false;
+}
+
+String WebInspectorUI::localizedStringsURL() const
+{
+    notImplemented();
+    return emptyString();
+}
+#endif // !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN)
+
 } // namespace WebKit
index 4eee9b2..9e55f3d 100644 (file)
@@ -27,6 +27,8 @@
 #import "WebInspectorUI.h"
 #import "RemoteWebInspectorUI.h"
 
+#if PLATFORM(MAC)
+
 namespace WebKit {
 
 bool WebInspectorUI::canSave()
@@ -58,3 +60,5 @@ String RemoteWebInspectorUI::localizedStringsURL() const
 }
 
 } // namespace WebKit
+
+#endif // PLATFORM(MAC)
diff --git a/Source/WebKit/WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp b/Source/WebKit/WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp
deleted file mode 100644 (file)
index f0ae6c3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebInspectorUI.h"
-
-#include "RemoteWebInspectorUI.h"
-
-namespace WebKit {
-
-bool WebInspectorUI::canSave()
-{
-    return false;
-}
-
-String WebInspectorUI::localizedStringsURL() const
-{
-    return String();
-}
-
-String RemoteWebInspectorUI::localizedStringsURL() const
-{
-    return String();
-}
-
-} // namespace WebKit
diff --git a/Source/WebKit/WebProcess/WebPage/wpe/WebInspectorWPE.cpp b/Source/WebKit/WebProcess/WebPage/wpe/WebInspectorWPE.cpp
deleted file mode 100644 (file)
index c4e0c65..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebInspector.h"
-
-#if ENABLE(INSPECTOR)
-
-namespace WebKit {
-
-bool WebInspector::canSave() const
-{
-    return false;
-}
-
-String WebInspector::localizedStringsURL() const
-{
-    return String();
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(INSPECTOR)