Title: [245726] trunk/Source
Revision
245726
Author
[email protected]
Date
2019-05-23 16:36:36 -0700 (Thu, 23 May 2019)

Log Message

Socket-based RWI should be able to inspect a JSContext
https://bugs.webkit.org/show_bug.cgi?id=198197

Reviewed by Don Olmstead.

Source/_javascript_Core:

* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Just use the debuggableType strings that WebInspectorUI ultimately wants.

Source/WebKit:

* UIProcess/socket/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::inspect):
* UIProcess/socket/RemoteInspectorClient.h:
* UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::inspect):
(WebKit::RemoteInspectorProtocolHandler::targetListChanged):
(WebKit::RemoteInspectorProtocolHandler::platformStartTask):
* UIProcess/socket/RemoteInspectorProtocolHandler.h:
Have the RWI client actually pass the debuggableType to WebInspectorUI.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (245725 => 245726)


--- trunk/Source/_javascript_Core/ChangeLog	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-05-23 23:36:36 UTC (rev 245726)
@@ -1,3 +1,14 @@
+2019-05-23  Ross Kirsling  <[email protected]>
+
+        Socket-based RWI should be able to inspect a JSContext
+        https://bugs.webkit.org/show_bug.cgi?id=198197
+
+        Reviewed by Don Olmstead.
+
+        * inspector/remote/socket/RemoteInspectorSocket.cpp:
+        (Inspector::RemoteInspector::listingForInspectionTarget const):
+        Just use the debuggableType strings that WebInspectorUI ultimately wants.
+
 2019-05-23  Tadeu Zagallo  <[email protected]>
 
         DFG::OSREntry should not perform arity check

Modified: trunk/Source/_javascript_Core/inspector/remote/socket/RemoteInspectorSocket.cpp (245725 => 245726)


--- trunk/Source/_javascript_Core/inspector/remote/socket/RemoteInspectorSocket.cpp	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/_javascript_Core/inspector/remote/socket/RemoteInspectorSocket.cpp	2019-05-23 23:36:36 UTC (rev 245726)
@@ -140,11 +140,11 @@
     targetListing->setInteger("targetID"_s, target.targetIdentifier());
     targetListing->setBoolean("hasLocalDebugger"_s, target.hasLocalDebugger());
     if (target.type() == RemoteInspectionTarget::Type::Web)
-        targetListing->setString("type"_s, "Web"_s);
+        targetListing->setString("type"_s, "web"_s);
     else if (target.type() == RemoteInspectionTarget::Type::_javascript_)
-        targetListing->setString("type"_s, "_javascript_"_s);
+        targetListing->setString("type"_s, "_javascript_"_s);
     else if (target.type() == RemoteInspectionTarget::Type::ServiceWorker)
-        targetListing->setString("type"_s, "ServiceWorker"_s);
+        targetListing->setString("type"_s, "service-worker"_s);
 
     return targetListing;
 }

Modified: trunk/Source/WebKit/ChangeLog (245725 => 245726)


--- trunk/Source/WebKit/ChangeLog	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/WebKit/ChangeLog	2019-05-23 23:36:36 UTC (rev 245726)
@@ -1,3 +1,20 @@
+2019-05-23  Ross Kirsling  <[email protected]>
+
+        Socket-based RWI should be able to inspect a JSContext
+        https://bugs.webkit.org/show_bug.cgi?id=198197
+
+        Reviewed by Don Olmstead.
+
+        * UIProcess/socket/RemoteInspectorClient.cpp:
+        (WebKit::RemoteInspectorClient::inspect):
+        * UIProcess/socket/RemoteInspectorClient.h:
+        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
+        (WebKit::RemoteInspectorProtocolHandler::inspect):
+        (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
+        (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
+        * UIProcess/socket/RemoteInspectorProtocolHandler.h:
+        Have the RWI client actually pass the debuggableType to WebInspectorUI.
+
 2019-05-22  Stephanie Lewis  <[email protected]>
 
         release builds of webkit cannot be used to generate a dyld shared cache

Modified: trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.cpp (245725 => 245726)


--- trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.cpp	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.cpp	2019-05-23 23:36:36 UTC (rev 245726)
@@ -36,11 +36,12 @@
 class RemoteInspectorProxy final : public RemoteWebInspectorProxyClient {
     WTF_MAKE_FAST_ALLOCATED();
 public:
-    RemoteInspectorProxy(RemoteInspectorClient& inspectorClient, ConnectionID connectionID, TargetID targetID)
+    RemoteInspectorProxy(RemoteInspectorClient& inspectorClient, ConnectionID connectionID, TargetID targetID, const String& type)
         : m_proxy(RemoteWebInspectorProxy::create())
         , m_inspectorClient(inspectorClient)
         , m_connectionID(connectionID)
         , m_targetID(targetID)
+        , m_debuggableType(type)
     {
         m_proxy->setClient(this);
     }
@@ -53,7 +54,7 @@
 
     void load()
     {
-        m_proxy->load("web", "");
+        m_proxy->load(m_debuggableType, String());
     }
 
     void show()
@@ -81,6 +82,7 @@
     RemoteInspectorClient& m_inspectorClient;
     ConnectionID m_connectionID;
     TargetID m_targetID;
+    String m_debuggableType;
 };
 
 RemoteInspectorClient::RemoteInspectorClient(const char* address, unsigned port, RemoteInspectorObserver& observer)
@@ -138,10 +140,10 @@
 {
 }
 
-void RemoteInspectorClient::inspect(ConnectionID connectionID, TargetID targetID)
+void RemoteInspectorClient::inspect(ConnectionID connectionID, TargetID targetID, const String& type)
 {
-    auto addResult = m_inspectorProxyMap.ensure(std::make_pair(connectionID, targetID), [this, connectionID, targetID] {
-        return std::make_unique<RemoteInspectorProxy>(*this, connectionID, targetID);
+    auto addResult = m_inspectorProxyMap.ensure(std::make_pair(connectionID, targetID), [this, connectionID, targetID, &type] {
+        return std::make_unique<RemoteInspectorProxy>(*this, connectionID, targetID, type);
     });
 
     if (!addResult.isNewEntry) {

Modified: trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.h (245725 => 245726)


--- trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.h	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/WebKit/UIProcess/socket/RemoteInspectorClient.h	2019-05-23 23:36:36 UTC (rev 245726)
@@ -64,7 +64,7 @@
 
     const HashMap<ConnectionID, Vector<Target>>& targets() const { return m_targets; }
 
-    void inspect(ConnectionID, TargetID);
+    void inspect(ConnectionID, TargetID, const String&);
     void sendMessageToBackend(ConnectionID, TargetID, const String&);
     void closeFromFrontend(ConnectionID, TargetID);
 

Modified: trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.cpp (245725 => 245726)


--- trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.cpp	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.cpp	2019-05-23 23:36:36 UTC (rev 245726)
@@ -52,11 +52,11 @@
     void didPostMessage(WebPageProxy& page, const FrameInfoData&, WebCore::SerializedScriptValue& serializedScriptValue) override
     {
         auto tokens = serializedScriptValue.toString().split(":");
-        if (tokens.size() != 2)
+        if (tokens.size() != 3)
             return;
 
         URL requestURL { { }, page.pageLoadState().url() };
-        m_inspectorProtocolHandler.inspect(requestURL.hostAndPort(), tokens[0].toUIntStrict(), tokens[1].toUIntStrict());
+        m_inspectorProtocolHandler.inspect(requestURL.hostAndPort(), tokens[0].toUIntStrict(), tokens[1].toUIntStrict(), tokens[2]);
     }
 
 private:
@@ -63,14 +63,17 @@
     RemoteInspectorProtocolHandler& m_inspectorProtocolHandler;
 };
 
-void RemoteInspectorProtocolHandler::inspect(const String& hostAndPort, ConnectionID connectionID, TargetID targetID)
+void RemoteInspectorProtocolHandler::inspect(const String& hostAndPort, ConnectionID connectionID, TargetID targetID, const String& type)
 {
     if (auto* client = m_inspectorClients.get(hostAndPort))
-        client->inspect(connectionID, targetID);
+        client->inspect(connectionID, targetID, type);
 }
 
 void RemoteInspectorProtocolHandler::targetListChanged(RemoteInspectorClient&)
 {
+    if (m_page.pageLoadState().isLoading())
+        return;
+
     m_page.reload({ });
 }
 
@@ -118,7 +121,7 @@
                 htmlBuilder.append(makeString(
                     "<tbody><tr>"
                     "<td class=\"data\"><div class=\"targetname\">", target.name, "</div><div class=\"targeturl\">", target.url, "</div></td>"
-                    "<td class=\"input\"><input type=\"button\" value=\"Inspect\" _onclick_=\"window.webkit.messageHandlers.inspector.postMessage('", connectionID, ":", target.id, "');\"></td>"
+                    "<td class=\"input\"><input type=\"button\" value=\"Inspect\" _onclick_=\"window.webkit.messageHandlers.inspector.postMessage('", connectionID, ":", target.id, ":", target.type, "');\"></td>"
                     "</tr></tbody>"
                 ));
             }

Modified: trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.h (245725 => 245726)


--- trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.h	2019-05-23 23:34:20 UTC (rev 245725)
+++ trunk/Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.h	2019-05-23 23:36:36 UTC (rev 245726)
@@ -42,7 +42,7 @@
 public:
     static Ref<RemoteInspectorProtocolHandler> create(WebPageProxy& page) { return adoptRef(*new RemoteInspectorProtocolHandler(page)); }
 
-    void inspect(const String&, ConnectionID, TargetID);
+    void inspect(const String& hostAndPort, ConnectionID, TargetID, const String& type);
 
 private:
     RemoteInspectorProtocolHandler(WebPageProxy& page)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to