Title: [295255] trunk/Source
Revision
295255
Author
drou...@apple.com
Date
2022-06-03 17:30:28 -0700 (Fri, 03 Jun 2022)

Log Message

Web Inspector: remove unused `InspectorFrontendHost` attributes and methods
https://bugs.webkit.org/show_bug.cgi?id=241291

Reviewed by Patrick Angle.

* Source/WebCore/inspector/InspectorFrontendHost.idl:
* Source/WebCore/inspector/InspectorFrontendHost.h:
* Source/WebCore/inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::port const): Deleted.
(WebCore::InspectorFrontendHost::append): Deleted.
(WebCore::InspectorFrontendHost::close): Deleted.

* Source/WebCore/inspector/InspectorFrontendClient.h:

* Source/WebCore/inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::append): Deleted.

* Source/WebKit/WebProcess/Inspector/WebInspectorUI.messages.in:
* Source/WebKit/WebProcess/Inspector/WebInspectorUI.h:
* Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::didSave): Deleted.
(WebKit::WebInspectorUI::append): Deleted.
(WebKit::WebInspectorUI::didAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in:
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h:
* Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::append): Deleted.
(WebKit::WebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp:
(WebKit::fileReplaceContentsCallback):
(WebKit::WebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::platformSave):
(WebKit::WebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp:
(WebKit::WebInspectorUIProxy::platformAppend): Deleted.

* Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.messages.in:
* Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h:
* Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::didSave): Deleted.
(WebKit::RemoteWebInspectorUI::didAppend): Deleted.
(WebKit::RemoteWebInspectorUI::append): Deleted.
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in:
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h:
* Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp:
(WebKit::RemoteWebInspectorUIProxy::append): Deleted.
(WebKit::RemoteWebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp:
(WebKit::remoteFileReplaceContentsCallback):
(WebKit::RemoteWebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm:
(WebKit::RemoteWebInspectorUIProxy::platformSave):
(WebKit::RemoteWebInspectorUIProxy::platformAppend): Deleted.
* Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp:
(WebKit::RemoteWebInspectorUIProxy::platformAppend): Deleted.

* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):
(WebInspectorFrontendClient::append): Deleted.
* Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::append): Deleted.

* Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.savedURL): Deleted.
(InspectorFrontendAPI.appendedToURL): Deleted.

Canonical link: https://commits.webkit.org/251303@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (295254 => 295255)


--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -126,8 +126,6 @@
     virtual bool canSave(SaveMode) = 0;
     virtual void save(Vector<SaveData>&&, bool forceSaveAs) = 0;
 
-    virtual void append(const String& url, const String& content) = 0;
-
     virtual bool canLoad() = 0;
     virtual void load(const String& path, CompletionHandler<void(const String&)>&&) = 0;
 

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (295254 => 295255)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -84,7 +84,6 @@
     void revealFileExternally(const String&) override { }
     bool canSave(InspectorFrontendClient::SaveMode) override { return false; }
     void save(Vector<InspectorFrontendClient::SaveData>&&, bool /* forceSaveAs */) override { }
-    void append(const String&, const String&) override { }
     bool canLoad()  override { return false; }
     void load(const String&, CompletionHandler<void(const String&)>&& completionHandler) override { completionHandler(nullString()); }
 

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (295254 => 295255)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -413,15 +413,6 @@
 #endif
 }
 
-String InspectorFrontendHost::port() const
-{
-#if PLATFORM(GTK)
-    return "gtk"_s;
-#else
-    return "unknown"_s;
-#endif
-}
-
 void InspectorFrontendHost::copyText(const String& text)
 {
     auto pageID = m_frontendPage ? m_frontendPage->mainFrame().pageID() : std::nullopt;
@@ -470,12 +461,6 @@
         m_client->save(WTFMove(saveDatas), forceSaveAs);
 }
 
-void InspectorFrontendHost::append(const String& url, const String& content)
-{
-    if (m_client)
-        m_client->append(url, content);
-}
-
 bool InspectorFrontendHost::canLoad()
 {
     if (m_client)
@@ -532,10 +517,6 @@
     });
 }
 
-void InspectorFrontendHost::close(const String&)
-{
-}
-
 void InspectorFrontendHost::sendMessageToBackend(const String& message)
 {
     if (m_client)

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (295254 => 295255)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -97,7 +97,6 @@
 
     String platform() const;
     String platformVersionName() const;
-    String port() const;
 
     struct DebuggableInfo {
         String debuggableType;
@@ -119,13 +118,9 @@
     bool canSave(SaveMode);
     void save(Vector<SaveData>&&, bool forceSaveAs);
 
-    void append(const String& url, const String& content);
-
     bool canLoad();
     void load(const String& path, Ref<DeferredPromise>&&);
 
-    void close(const String& url);
-
     bool canPickColorFromScreen();
     void pickColorFromScreen(Ref<DeferredPromise>&&);
 

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.idl (295254 => 295255)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.idl	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.idl	2022-06-04 00:30:28 UTC (rev 295255)
@@ -77,17 +77,12 @@
     boolean canSave(SaveMode saveMode);
     undefined save(sequence<SaveData> saveDatas, boolean forceSaveAs);
 
-    undefined append(DOMString url, DOMString content);
-
     boolean canLoad();
     [NewObject] Promise<DOMString> load(DOMString path);
 
-    undefined close(DOMString url);
-
     boolean canPickColorFromScreen();
     [NewObject] Promise<DOMString> pickColorFromScreen();
 
-    readonly attribute DOMString port;
     readonly attribute DOMString platform;
     readonly attribute DOMString platformVersionName;
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js (295254 => 295255)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js	2022-06-04 00:30:28 UTC (rev 295255)
@@ -27,16 +27,6 @@
     _loaded: false,
     _pendingCommands: [],
 
-    savedURL: function(url)
-    {
-        // Not used yet.
-    },
-
-    appendedToURL: function(url)
-    {
-        // Not used yet.
-    },
-
     isTimelineProfilingEnabled: function()
     {
         return WI.timelineManager.isCapturing();

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -149,11 +149,6 @@
     platformSave(WTFMove(saveDatas), forceSaveAs);
 }
 
-void RemoteWebInspectorUIProxy::append(const String& suggestedURL, const String& content)
-{
-    platformAppend(suggestedURL, content);
-}
-
 void RemoteWebInspectorUIProxy::load(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     platformLoad(path, WTFMove(completionHandler));
@@ -247,7 +242,6 @@
 void RemoteWebInspectorUIProxy::platformResetState() { }
 void RemoteWebInspectorUIProxy::platformBringToFront() { }
 void RemoteWebInspectorUIProxy::platformSave(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool /* forceSaveAs */) { }
-void RemoteWebInspectorUIProxy::platformAppend(const String&, const String&) { }
 void RemoteWebInspectorUIProxy::platformLoad(const String&, CompletionHandler<void(const String&)>&& completionHandler) { completionHandler(nullString()); }
 void RemoteWebInspectorUIProxy::platformPickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&& completionHandler) { completionHandler({ }); }
 void RemoteWebInspectorUIProxy::platformSetSheetRect(const FloatRect&) { }

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -133,7 +133,6 @@
     void resetState();
     void bringToFront();
     void save(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs);
-    void append(const String& filename, const String& content);
     void load(const String& path, CompletionHandler<void(const String&)>&&);
     void pickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&&);
     void setSheetRect(const WebCore::FloatRect&);
@@ -153,7 +152,6 @@
     void platformResetState();
     void platformBringToFront();
     void platformSave(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs);
-    void platformAppend(const String& filename, const String& content);
     void platformLoad(const String& path, CompletionHandler<void(const String&)>&&);
     void platformPickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&&);
     void platformSetSheetRect(const WebCore::FloatRect&);

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in	2022-06-04 00:30:28 UTC (rev 295255)
@@ -28,7 +28,6 @@
     BringToFront()
 
     Save(Vector<WebCore::InspectorFrontendClient::SaveData> saveDatas, bool forceSaveAs)
-    Append(String filename, String content)
     Load(String path) -> (String content)
     PickColorFromScreen() -> (std::optional<WebCore::Color> color)
 

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -721,18 +721,6 @@
     platformSave(WTFMove(saveDatas), forceSaveAs);
 }
 
-void WebInspectorUIProxy::append(const String& filename, const String& content)
-{
-    if (!m_inspectedPage->preferences().developerExtrasEnabled())
-        return;
-
-    ASSERT(!filename.isEmpty());
-    if (filename.isEmpty())
-        return;
-
-    platformAppend(filename, content);
-}
-
 void WebInspectorUIProxy::load(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     if (!m_inspectedPage->preferences().developerExtrasEnabled())
@@ -849,11 +837,6 @@
     notImplemented();
 }
 
-void WebInspectorUIProxy::platformAppend(const String& suggestedURL, const String& content)
-{
-    notImplemented();
-}
-
 void WebInspectorUIProxy::platformLoad(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     notImplemented();

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -240,7 +240,6 @@
     void platformStartWindowDrag();
     void platformRevealFileExternally(const String&);
     void platformSave(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs);
-    void platformAppend(const String& filename, const String& content);
     void platformLoad(const String& path, CompletionHandler<void(const String&)>&&);
     void platformPickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&&);
 
@@ -268,7 +267,6 @@
     void setDeveloperPreferenceOverride(WebCore::InspectorClient::DeveloperPreference, std::optional<bool>);
 
     void save(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs);
-    void append(const String& filename, const String& content);
     void load(const String& path, CompletionHandler<void(const String&)>&&);
     void pickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&&);
 

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in	2022-06-04 00:30:28 UTC (rev 295255)
@@ -43,7 +43,6 @@
     SetDeveloperPreferenceOverride(WebCore::InspectorClient::DeveloperPreference developerPreference, std::optional<bool> overrideValue)
 
     Save(Vector<WebCore::InspectorFrontendClient::SaveData> saveDatas, bool forceSaveAs)
-    Append(String filename, String content)
     Load(String path) -> (String content)
     PickColorFromScreen() -> (std::optional<WebCore::Color> color)
 

Modified: trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -109,12 +109,7 @@
 static void remoteFileReplaceContentsCallback(GObject* sourceObject, GAsyncResult* result, gpointer userData)
 {
     GFile* file = G_FILE(sourceObject);
-    if (!g_file_replace_contents_finish(file, result, nullptr, nullptr))
-        return;
-
-    auto* page = static_cast<WebPageProxy*>(userData);
-    GUniquePtr<char> path(g_file_get_path(file));
-    page->send(Messages::RemoteWebInspectorUI::DidSave(String::fromUTF8(path.get())));
+    g_file_replace_contents_finish(file, result, nullptr, nullptr);
 }
 
 void RemoteWebInspectorUIProxy::platformSave(Vector<InspectorFrontendClient::SaveData>&& saveDatas, bool forceSaveAs)
@@ -159,10 +154,6 @@
         G_FILE_CREATE_REPLACE_DESTINATION, nullptr, remoteFileReplaceContentsCallback, m_inspectorPage);
 }
 
-void RemoteWebInspectorUIProxy::platformAppend(const String&, const String&)
-{
-}
-
 void RemoteWebInspectorUIProxy::platformLoad(const String&, CompletionHandler<void(const String&)>&& completionHandler)
 {
     completionHandler(nullString());

Modified: trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -509,12 +509,7 @@
 static void fileReplaceContentsCallback(GObject* sourceObject, GAsyncResult* result, gpointer userData)
 {
     GFile* file = G_FILE(sourceObject);
-    if (!g_file_replace_contents_finish(file, result, nullptr, nullptr))
-        return;
-
-    auto* page = static_cast<WebPageProxy*>(userData);
-    GUniquePtr<char> path(g_file_get_path(file));
-    page->send(Messages::WebInspectorUI::DidSave(String::fromUTF8(path.get())));
+    g_file_replace_contents_finish(file, result, nullptr, nullptr);
 }
 
 void WebInspectorUIProxy::platformSave(Vector<WebCore::InspectorFrontendClient::SaveData>&& saveDatas, bool forceSaveAs)
@@ -563,11 +558,6 @@
         G_FILE_CREATE_REPLACE_DESTINATION, nullptr, fileReplaceContentsCallback, m_inspectorPage);
 }
 
-void WebInspectorUIProxy::platformAppend(const String&, const String&)
-{
-    notImplemented();
-}
-
 void WebInspectorUIProxy::platformLoad(const String&, CompletionHandler<void(const String&)>&& completionHandler)
 {
     notImplemented();

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm	2022-06-04 00:30:28 UTC (rev 295255)
@@ -170,33 +170,9 @@
 
     WebInspectorUIProxy::showSavePanel(m_window.get(), platformURL.get(), WTFMove(saveDatas), forceSaveAs, [urlCommonPrefix, protectedThis = Ref { *this }] (NSURL *actualURL) {
         protectedThis->m_suggestedToActualURLMap.set(urlCommonPrefix.get(), actualURL);
-
-        if (protectedThis->m_inspectorPage)
-            protectedThis->m_inspectorPage->send(Messages::RemoteWebInspectorUI::DidSave(actualURL.absoluteString));
-
     });
 }
 
-void RemoteWebInspectorUIProxy::platformAppend(const String& suggestedURL, const String& content)
-{
-    // FIXME: Share with WebInspectorUIProxyMac.
-
-    ASSERT(!suggestedURL.isEmpty());
-    
-    RetainPtr<NSURL> actualURL = m_suggestedToActualURLMap.get(suggestedURL);
-    // Do not append unless the user has already confirmed this filename in save().
-    if (!actualURL)
-        return;
-
-    NSFileHandle *handle = [NSFileHandle fileHandleForWritingToURL:actualURL.get() error:NULL];
-    [handle seekToEndOfFile];
-    [handle writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
-    [handle closeFile];
-
-    WebPageProxy* inspectorPage = webView()->_page.get();
-    inspectorPage->send(Messages::RemoteWebInspectorUI::DidAppend([actualURL absoluteString]));
-}
-
 void RemoteWebInspectorUIProxy::platformLoad(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     if (auto contents = FileSystem::readEntireFile(path))

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-06-04 00:30:28 UTC (rev 295255)
@@ -672,30 +672,9 @@
 
     WebInspectorUIProxy::showSavePanel(m_inspectorWindow.get(), platformURL.get(), WTFMove(saveDatas), forceSaveAs, [urlCommonPrefix, protectedThis = Ref { *this }] (NSURL *actualURL) {
         protectedThis->m_suggestedToActualURLMap.set(urlCommonPrefix.get(), actualURL);
-
-        if (protectedThis->m_inspectorPage)
-            protectedThis->m_inspectorPage->send(Messages::WebInspectorUI::DidSave([actualURL absoluteString]));
-
     });
 }
 
-void WebInspectorUIProxy::platformAppend(const String& suggestedURL, const String& content)
-{
-    ASSERT(!suggestedURL.isEmpty());
-    
-    RetainPtr<NSURL> actualURL = m_suggestedToActualURLMap.get(suggestedURL);
-    // Do not append unless the user has already confirmed this filename in save().
-    if (!actualURL)
-        return;
-
-    NSFileHandle *handle = [NSFileHandle fileHandleForWritingToURL:actualURL.get() error:NULL];
-    [handle seekToEndOfFile];
-    [handle writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
-    [handle closeFile];
-
-    m_inspectorPage->send(Messages::WebInspectorUI::DidAppend([actualURL absoluteString]));
-}
-
 void WebInspectorUIProxy::platformLoad(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     if (auto contents = FileSystem::readEntireFile(path))

Modified: trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -134,7 +134,6 @@
 void RemoteWebInspectorUIProxy::platformResetState() { }
 void RemoteWebInspectorUIProxy::platformBringToFront() { }
 void RemoteWebInspectorUIProxy::platformSave(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool /* forceSaveAs */) { }
-void RemoteWebInspectorUIProxy::platformAppend(const String&, const String&) { }
 void RemoteWebInspectorUIProxy::platformLoad(const String&, CompletionHandler<void(const String&)>&& completionHandler) { completionHandler(nullString()); }
 void RemoteWebInspectorUIProxy::platformPickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&& completionHandler) { completionHandler({ }); }
 void RemoteWebInspectorUIProxy::platformSetSheetRect(const WebCore::FloatRect&) { }

Modified: trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp (295254 => 295255)


--- trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -418,11 +418,6 @@
     notImplemented();
 }
 
-void WebInspectorUIProxy::platformAppend(const String&, const String&)
-{
-    notImplemented();
-}
-
 void WebInspectorUIProxy::platformLoad(const String&, CompletionHandler<void(const String&)>&& completionHandler)
 {
     notImplemented();

Modified: trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -84,16 +84,6 @@
     m_frontendAPIDispatcher->dispatchCommandWithResultAsync("updateFindString"_s, { JSON::Value::create(findString) });
 }
 
-void RemoteWebInspectorUI::didSave(const String& url)
-{
-    m_frontendAPIDispatcher->dispatchCommandWithResultAsync("savedURL"_s, { JSON::Value::create(url) });
-}
-
-void RemoteWebInspectorUI::didAppend(const String& url)
-{
-    m_frontendAPIDispatcher->dispatchCommandWithResultAsync("appendedToURL"_s, { JSON::Value::create(url) });
-}
-
 void RemoteWebInspectorUI::sendMessageToFrontend(const String& message)
 {
     m_frontendAPIDispatcher->dispatchMessageAsync(message);
@@ -228,11 +218,6 @@
     WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::Save(WTFMove(saveDatas), forceSaveAs), m_page.identifier());
 }
 
-void RemoteWebInspectorUI::append(const String& filename, const String& content)
-{
-    WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::Append(filename, content), m_page.identifier());
-}
-
 void RemoteWebInspectorUI::load(const String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     WebProcess::singleton().parentProcessConnection()->sendWithAsyncReply(Messages::RemoteWebInspectorUIProxy::Load(path), WTFMove(completionHandler), m_page.identifier());

Modified: trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -64,8 +64,6 @@
     // Called by RemoteWebInspectorUI messages
     void initialize(DebuggableInfoData&&, const String& backendCommandsURL);
     void updateFindString(const String&);
-    void didSave(const String& url);
-    void didAppend(const String& url);
     void sendMessageToFrontend(const String&);
     void showConsole();
     void showResources();
@@ -108,7 +106,6 @@
     void openURLExternally(const String& url) override;
     void revealFileExternally(const String& path) override;
     void save(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs) override;
-    void append(const String& url, const String& content) override;
     void load(const String& path, CompletionHandler<void(const String&)>&&) override;
     void pickColorFromScreen(CompletionHandler<void(const std::optional<WebCore::Color>&)>&&) override;
     void inspectedURLChanged(const String&) override;

Modified: trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.messages.in (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.messages.in	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.messages.in	2022-06-04 00:30:28 UTC (rev 295255)
@@ -32,8 +32,5 @@
     ShowConsole()
     ShowResources()
 
-    DidSave(String url)
-    DidAppend(String url)
-
     SendMessageToFrontend(String message)
 }

Modified: trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp	2022-06-04 00:30:28 UTC (rev 295255)
@@ -305,11 +305,6 @@
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::Save(WTFMove(saveDatas), forceSaveAs), m_inspectedPageIdentifier);
 }
 
-void WebInspectorUI::append(const WTF::String& filename, const WTF::String& content)
-{
-    WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::Append(filename, content), m_inspectedPageIdentifier);
-}
-
 void WebInspectorUI::load(const WTF::String& path, CompletionHandler<void(const String&)>&& completionHandler)
 {
     WebProcess::singleton().parentProcessConnection()->sendWithAsyncReply(Messages::WebInspectorUIProxy::Load(path), WTFMove(completionHandler), m_inspectedPageIdentifier);
@@ -425,16 +420,6 @@
     m_frontendAPIDispatcher->dispatchCommandWithResultAsync("setElementSelectionEnabled"_s, { JSON::Value::create(false) });
 }
 
-void WebInspectorUI::didSave(const String& url)
-{
-    m_frontendAPIDispatcher->dispatchCommandWithResultAsync("savedURL"_s, { JSON::Value::create(url) });
-}
-
-void WebInspectorUI::didAppend(const String& url)
-{
-    m_frontendAPIDispatcher->dispatchCommandWithResultAsync("appendedToURL"_s, { JSON::Value::create(url) });
-}
-
 void WebInspectorUI::sendMessageToFrontend(const String& message)
 {
     m_frontendAPIDispatcher->dispatchMessageAsync(message);

Modified: trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -96,9 +96,6 @@
 
     void updateFindString(const String&);
 
-    void didSave(const String& url);
-    void didAppend(const String& url);
-
     void sendMessageToFrontend(const String& message);
     void evaluateInFrontendForTesting(const String& _expression_);
 
@@ -145,8 +142,6 @@
     bool canSave(WebCore::InspectorFrontendClient::SaveMode) override;
     void save(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool forceSaveAs) override;
 
-    void append(const WTF::String& url, const WTF::String& content) override;
-
     bool canLoad() override;
     void load(const WTF::String& path, WTF::CompletionHandler<void(const WTF::String&)>&&) override;
 

Modified: trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.messages.in (295254 => 295255)


--- trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.messages.in	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.messages.in	2022-06-04 00:30:28 UTC (rev 295255)
@@ -47,9 +47,6 @@
     StartElementSelection()
     StopElementSelection()
 
-    DidSave(String url)
-    DidAppend(String url)
-
     SendMessageToFrontend(String message)
     EvaluateInFrontendForTesting(String _expression_)
 }

Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm (295254 => 295255)


--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm	2022-06-04 00:30:28 UTC (rev 295255)
@@ -139,6 +139,5 @@
 void WebInspectorFrontendClient::showCertificate(const CertificateInfo&) { }
 void WebInspectorFrontendClient::updateWindowTitle() const { }
 void WebInspectorFrontendClient::save(Vector<InspectorFrontendClient::SaveData>&&, bool /* forceSaveAs */) { }
-void WebInspectorFrontendClient::append(const String&, const String&) { }
 
 #endif // PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h (295254 => 295255)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h	2022-06-04 00:30:28 UTC (rev 295255)
@@ -158,7 +158,6 @@
 
     bool canSave(WebCore::InspectorFrontendClient::SaveMode) override;
     void save(Vector<WebCore::InspectorFrontendClient::SaveData>&&, bool base64Encoded) override;
-    void append(const String& url, const String& content) override;
 
 #if !PLATFORM(IOS_FAMILY)
     WebView *m_inspectedWebView;

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm (295254 => 295255)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-03 23:59:06 UTC (rev 295254)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm	2022-06-04 00:30:28 UTC (rev 295255)
@@ -435,8 +435,6 @@
             [dataContent writeToURL:actualURL atomically:YES];
         } else
             [contentCopy writeToURL:actualURL atomically:YES encoding:NSUTF8StringEncoding error:NULL];
-
-        core([m_frontendWindowController frontendWebView])->mainFrame().script().executeScriptIgnoringException([NSString stringWithFormat:@"InspectorFrontendAPI.savedURL(\"%@\")", actualURL.absoluteString]);
     };
 
     if (!forceSaveAs) {
@@ -468,23 +466,6 @@
         completionHandler([panel runModal]);
 }
 
-void WebInspectorFrontendClient::append(const String& suggestedURL, const String& content)
-{
-    ASSERT(!suggestedURL.isEmpty());
-
-    RetainPtr<NSURL> actualURL = m_suggestedToActualURLMap.get(suggestedURL);
-    // do not append unless the user has already confirmed this filename in save().
-    if (!actualURL)
-        return;
-
-    NSFileHandle *handle = [NSFileHandle fileHandleForWritingToURL:actualURL.get() error:NULL];
-    [handle seekToEndOfFile];
-    [handle writeData:[content dataUsingEncoding:NSUTF8StringEncoding]];
-    [handle closeFile];
-
-    core([m_frontendWindowController frontendWebView])->mainFrame().script().executeScriptIgnoringException([NSString stringWithFormat:@"InspectorFrontendAPI.appendedToURL(\"%@\")", [actualURL absoluteString]]);
-}
-
 // MARK: -
 
 @implementation WebInspectorWindowController
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to