Web Inspector: Remove unused Console.setMonitoringXHREnabled
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 22:23:00 +0000 (22:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 22:23:00 +0000 (22:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178617

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-21
Reviewed by Sam Weinig.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/JSGlobalObjectConsoleAgent.cpp: Removed.
* inspector/agents/JSGlobalObjectConsoleAgent.h: Removed.
* inspector/protocol/Console.json:
Removed files and method.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
This can use the base ConsoleAgent now.

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
(WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
* inspector/WebConsoleAgent.h:
Remove XHR monitoring code.

* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::didFinishLoading):
(WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
* xml/XMLHttpRequest.idl:
Remove now unused state on XHR and ExecState requirement for send().

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

16 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Sources.txt
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h
Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.cpp [deleted file]
Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.h [deleted file]
Source/JavaScriptCore/inspector/protocol/Console.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/WebConsoleAgent.cpp
Source/WebCore/inspector/WebConsoleAgent.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h
Source/WebCore/xml/XMLHttpRequest.idl

index 743c14d..9b22fe8 100644 (file)
@@ -1,3 +1,22 @@
+2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused Console.setMonitoringXHREnabled
+        https://bugs.webkit.org/show_bug.cgi?id=178617
+
+        Reviewed by Sam Weinig.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * inspector/agents/InspectorConsoleAgent.h:
+        * inspector/agents/JSGlobalObjectConsoleAgent.cpp: Removed.
+        * inspector/agents/JSGlobalObjectConsoleAgent.h: Removed.
+        * inspector/protocol/Console.json:
+        Removed files and method.
+
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
+        This can use the base ConsoleAgent now.
+
 2017-10-21  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC] Remove per-host-function CTI stub in 32bit environment
index 5f4cd30..2233c15 100644 (file)
                A5FD007A189B051000633231 /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0078189B051000633231 /* ConsoleMessage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5FD007E189B0B4C00633231 /* ScriptCallStackFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD007C189B0B4C00633231 /* ScriptCallStackFactory.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5FD0082189B191A00633231 /* InspectorConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */; };
                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
                A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; };
                A700874217CBE8EB00C3E643 /* JSMap.h in Headers */ = {isa = PBXBuildFile; fileRef = A700874017CBE8EB00C3E643 /* JSMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5FD007C189B0B4C00633231 /* ScriptCallStackFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCallStackFactory.h; sourceTree = "<group>"; };
                A5FD007F189B191A00633231 /* InspectorConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorConsoleAgent.cpp; sourceTree = "<group>"; };
                A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleAgent.h; sourceTree = "<group>"; };
-               A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectConsoleAgent.cpp; sourceTree = "<group>"; };
-               A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectConsoleAgent.h; sourceTree = "<group>"; };
                A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; };
                A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; };
                A700873B17CBE8D300C3E643 /* MapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapPrototype.cpp; sourceTree = "<group>"; };
                                A50E4B5E18809DD50068A46D /* InspectorRuntimeAgent.h */,
                                A55165D01BDEFDBD003B75C1 /* InspectorScriptProfilerAgent.cpp */,
                                A55165D11BDEFDBD003B75C1 /* InspectorScriptProfilerAgent.h */,
-                               A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */,
-                               A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */,
                                A57D23E71891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp */,
                                A57D23E81891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h */,
                                A50E4B5F18809DD50068A46D /* JSGlobalObjectRuntimeAgent.cpp */,
                                797E07AA1B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h in Headers */,
                                BC18C4210E16F5CD00B34460 /* JSGlobalObject.h in Headers */,
                                996B731D1BDA08EF00331B84 /* JSGlobalObject.lut.h in Headers */,
-                               A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */,
                                A5C3A1A618C0490200C9593A /* JSGlobalObjectConsoleClient.h in Headers */,
                                A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */,
                                A57D23EA1891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h in Headers */,
index 13a875d..5fec842 100644 (file)
@@ -557,7 +557,6 @@ inspector/agents/InspectorDebuggerAgent.cpp
 inspector/agents/InspectorHeapAgent.cpp
 inspector/agents/InspectorRuntimeAgent.cpp
 inspector/agents/InspectorScriptProfilerAgent.cpp
-inspector/agents/JSGlobalObjectConsoleAgent.cpp
 inspector/agents/JSGlobalObjectDebuggerAgent.cpp
 inspector/agents/JSGlobalObjectRuntimeAgent.cpp
 
index 62d9462..d3dcb32 100644 (file)
 #include "InjectedScriptManager.h"
 #include "InspectorAgent.h"
 #include "InspectorBackendDispatcher.h"
+#include "InspectorConsoleAgent.h"
 #include "InspectorFrontendChannel.h"
 #include "InspectorFrontendRouter.h"
 #include "InspectorHeapAgent.h"
 #include "InspectorScriptProfilerAgent.h"
 #include "JSCInlines.h"
 #include "JSGlobalObject.h"
-#include "JSGlobalObjectConsoleAgent.h"
 #include "JSGlobalObjectConsoleClient.h"
 #include "JSGlobalObjectDebuggerAgent.h"
 #include "JSGlobalObjectRuntimeAgent.h"
@@ -83,7 +83,7 @@ JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObj
     auto inspectorAgent = std::make_unique<InspectorAgent>(context);
     auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(context);
     auto heapAgent = std::make_unique<InspectorHeapAgent>(context);
-    auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(context, heapAgent.get());
+    auto consoleAgent = std::make_unique<InspectorConsoleAgent>(context, heapAgent.get());
     auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(context, consoleAgent.get());
     auto scriptProfilerAgent = std::make_unique<InspectorScriptProfilerAgent>(context);
 
index e21a0cf..194aa70 100644 (file)
@@ -61,7 +61,6 @@ public:
     void enable(ErrorString&) override;
     void disable(ErrorString&) override;
     void clearMessages(ErrorString&) override;
-    void setMonitoringXHREnabled(ErrorString&, bool enabled) override = 0;
 
     bool enabled() const { return m_enabled; }
     void reset();
diff --git a/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.cpp b/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.cpp
deleted file mode 100644 (file)
index db88fcc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
- *
- * 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. ``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
- * 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 "JSGlobalObjectConsoleAgent.h"
-
-namespace Inspector {
-
-JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent(AgentContext& context, InspectorHeapAgent* heapAgent)
-    : InspectorConsoleAgent(context, heapAgent)
-{
-}
-
-void JSGlobalObjectConsoleAgent::setMonitoringXHREnabled(ErrorString& errorString, bool)
-{
-    errorString = ASCIILiteral("Not supported for JavaScript context");
-}
-
-} // namespace Inspector
diff --git a/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.h b/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.h
deleted file mode 100644 (file)
index 129182a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
- *
- * 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. ``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
- * 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.
- */
-
-#pragma once
-
-#include "InspectorConsoleAgent.h"
-
-namespace Inspector {
-
-class JSGlobalObjectConsoleAgent final : public InspectorConsoleAgent {
-    WTF_MAKE_NONCOPYABLE(JSGlobalObjectConsoleAgent);
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    JSGlobalObjectConsoleAgent(AgentContext&, InspectorHeapAgent*);
-    virtual ~JSGlobalObjectConsoleAgent() { }
-
-    // FIXME: XHRs and Nodes only makes sense debugging a Web context. Can this be moved to a different agent?
-    void setMonitoringXHREnabled(ErrorString&, bool enabled) override;
-};
-
-} // namespace Inspector
index b4d10ce..32aa798 100644 (file)
         {
             "name": "clearMessages",
             "description": "Clears console messages collected in the browser."
-        },
-        {
-            "name": "setMonitoringXHREnabled",
-            "description": "Toggles monitoring of XMLHttpRequest. If <code>true</code>, console will receive messages upon each XHR issued.",
-            "parameters": [
-                { "name": "enabled", "type": "boolean", "description": "Monitoring enabled state." }
-            ]
         }
     ],
     "events": [
index 1c52da7..393287d 100644 (file)
@@ -1,3 +1,28 @@
+2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove unused Console.setMonitoringXHREnabled
+        https://bugs.webkit.org/show_bug.cgi?id=178617
+
+        Reviewed by Sam Weinig.
+
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
+        * inspector/WebConsoleAgent.cpp:
+        (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
+        (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
+        * inspector/WebConsoleAgent.h:
+        Remove XHR monitoring code.
+
+        * xml/XMLHttpRequest.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+        (WebCore::XMLHttpRequest::didFinishLoading):
+        (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
+        * xml/XMLHttpRequest.idl:
+        Remove now unused state on XHR and ExecState requirement for send().
+
 2017-10-21  Dean Jackson  <dino@apple.com>
 
         createImageBitmap with basic HTMLImageElement
index 3adb1e9..9f44232 100644 (file)
@@ -625,10 +625,8 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen
         consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this.
 }
 
-void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
+void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, std::optional<String> decodedText)
 {
-    if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
-        consoleAgent->didFinishXHRLoading(identifier, url, sendURL, sendLineNumber, sendColumnNumber);
     if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent()) {
         if (decodedText)
             networkAgent->didFinishXHRLoading(identifier, *decodedText);
index 633b5d0..da40e6a 100644 (file)
@@ -186,7 +186,7 @@ public:
     enum class LoadType { Ping, Beacon };
     static void willSendRequestOfType(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType);
 
-    static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
+    static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText);
     static void willLoadXHRSynchronously(ScriptExecutionContext*);
     static void didLoadXHRSynchronously(ScriptExecutionContext*);
     static void scriptImported(ScriptExecutionContext&, unsigned long identifier, const String& sourceString);
@@ -355,7 +355,7 @@ private:
     static void didReceiveDataImpl(InstrumentingAgents&, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     static void didFinishLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*);
     static void didFailLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceError&);
-    static void didFinishXHRLoadingImpl(InstrumentingAgents&, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
+    static void didFinishXHRLoadingImpl(InstrumentingAgents&, unsigned long identifier, std::optional<String> decodedText);
     static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&);
     static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&);
     static void scriptImportedImpl(InstrumentingAgents&, unsigned long identifier, const String& sourceString);
@@ -957,10 +957,10 @@ inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame& frame, uns
         didReceiveResourceResponseImpl(*instrumentingAgents, identifier, &loader, response, nullptr);
 }
 
-inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
+inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText, url, sendURL, sendLineNumber, sendColumnNumber);
+        didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText);
 }
 
 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
index a3badae..08512d4 100644 (file)
@@ -46,11 +46,6 @@ WebConsoleAgent::WebConsoleAgent(AgentContext& context, InspectorHeapAgent* heap
 {
 }
 
-void WebConsoleAgent::setMonitoringXHREnabled(ErrorString&, bool enabled)
-{
-    m_monitoringXHREnabled = enabled;
-}
-
 void WebConsoleAgent::frameWindowDiscarded(DOMWindow* window)
 {
     for (auto& message : m_consoleMessages) {
@@ -65,17 +60,6 @@ void WebConsoleAgent::frameWindowDiscarded(DOMWindow* window)
     static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).discardInjectedScriptsFor(window);
 }
 
-void WebConsoleAgent::didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
-{
-    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
-        return;
-
-    if (m_monitoringXHREnabled) {
-        String message = "XHR finished loading: \"" + url + "\".";
-        addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::Network, MessageType::Log, MessageLevel::Debug, message, sendURL, sendLineNumber, sendColumnNumber, nullptr, requestIdentifier));
-    }
-}
-
 void WebConsoleAgent::didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse& response)
 {
     if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
index 5a3e6dd..3a55755 100644 (file)
@@ -41,16 +41,10 @@ public:
     WebConsoleAgent(Inspector::AgentContext&, Inspector::InspectorHeapAgent*);
     virtual ~WebConsoleAgent() = default;
 
-    void setMonitoringXHREnabled(ErrorString&, bool enabled) final;
-
     void frameWindowDiscarded(DOMWindow*);
 
-    void didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
     void didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse&);
     void didFailLoading(unsigned long requestIdentifier, const ResourceError&);
-
-protected:
-    bool m_monitoringXHREnabled { false };
 };
 
 } // namespace WebCore
index 466f730..b0f83f1 100644 (file)
@@ -43,7 +43,6 @@
 #include "ParsedContentType.h"
 #include "ResourceError.h"
 #include "ResourceRequest.h"
-#include "ScriptController.h"
 #include "SecurityOriginPolicy.h"
 #include "Settings.h"
 #include "SharedBuffer.h"
@@ -54,7 +53,6 @@
 #include "XMLHttpRequestProgressEvent.h"
 #include "XMLHttpRequestUpload.h"
 #include "markup.h"
-#include <interpreter/StackVisitor.h>
 #include <mutex>
 #include <runtime/ArrayBuffer.h>
 #include <runtime/ArrayBufferView.h>
@@ -280,12 +278,6 @@ String XMLHttpRequest::responseURL() const
     return responseURL.string();
 }
 
-void XMLHttpRequest::setLastSendLineAndColumnNumber(unsigned lineNumber, unsigned columnNumber)
-{
-    m_lastSendLineNumber = lineNumber;
-    m_lastSendColumnNumber = columnNumber;
-}
-
 XMLHttpRequestUpload* XMLHttpRequest::upload()
 {
     if (!m_upload)
@@ -433,47 +425,7 @@ std::optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend()
     return std::nullopt;
 }
 
-namespace {
-
-// FIXME: This should be abstracted out, so that any IDL function can be passed the line/column/url tuple.
-
-// FIXME: This should probably use ShadowChicken so that we get the right frame even when it did a tail call.
-// https://bugs.webkit.org/show_bug.cgi?id=155688
-
-class SendFunctor {
-public:
-    SendFunctor() = default;
-
-    unsigned line() const { return m_line; }
-    unsigned column() const { return m_column; }
-    String url() const { return m_url; }
-
-    JSC::StackVisitor::Status operator()(JSC::StackVisitor& visitor) const
-    {
-        if (!m_hasSkippedFirstFrame) {
-            m_hasSkippedFirstFrame = true;
-            return JSC::StackVisitor::Continue;
-        }
-
-        unsigned line = 0;
-        unsigned column = 0;
-        visitor->computeLineAndColumn(line, column);
-        m_line = line;
-        m_column = column;
-        m_url = visitor->sourceURL();
-        return JSC::StackVisitor::Done;
-    }
-
-private:
-    mutable bool m_hasSkippedFirstFrame { false };
-    mutable unsigned m_line { 0 };
-    mutable unsigned m_column { 0 };
-    mutable String m_url;
-};
-
-}
-
-ExceptionOr<void> XMLHttpRequest::send(JSC::ExecState& state, std::optional<SendTypes>&& sendType)
+ExceptionOr<void> XMLHttpRequest::send(std::optional<SendTypes>&& sendType)
 {
     InspectorInstrumentation::willSendXMLHttpRequest(scriptExecutionContext(), url());
 
@@ -491,11 +443,6 @@ ExceptionOr<void> XMLHttpRequest::send(JSC::ExecState& state, std::optional<Send
         );
     }
 
-    SendFunctor functor;
-    state.iterate(functor);
-    setLastSendLineAndColumnNumber(functor.line(), functor.column());
-    setLastSendURL(functor.url());
-
     return result;
 }
 
@@ -992,7 +939,7 @@ void XMLHttpRequest::didFinishLoading(unsigned long identifier)
     std::optional<String> decodedText;
     if (!m_binaryResponseBuilder)
         decodedText = m_responseBuilder.toStringPreserveCapacity();
-    InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), identifier, decodedText, m_url, m_lastSendURL, m_lastSendLineNumber, m_lastSendColumnNumber);
+    InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), identifier, decodedText);
 
     bool hadLoader = m_loader;
     m_loader = nullptr;
index 26c6aa0..cb92544 100644 (file)
@@ -35,7 +35,6 @@
 namespace JSC {
 class ArrayBuffer;
 class ArrayBufferView;
-class ExecState;
 }
 
 namespace WebCore {
@@ -80,7 +79,7 @@ public:
     ExceptionOr<void> open(const String& method, const String& url);
     ExceptionOr<void> open(const String& method, const URL&, bool async);
     ExceptionOr<void> open(const String& method, const String&, bool async, const String& user, const String& password);
-    ExceptionOr<void> send(JSC::ExecState&, std::optional<SendTypes>&&);
+    ExceptionOr<void> send(std::optional<SendTypes>&&);
     void abort();
     ExceptionOr<void> setRequestHeader(const String& name, const String& value);
     ExceptionOr<void> overrideMimeType(const String& override);
@@ -109,9 +108,6 @@ public:
 
     String responseURL() const;
 
-    void setLastSendLineAndColumnNumber(unsigned lineNumber, unsigned columnNumber);
-    void setLastSendURL(const String& url) { m_lastSendURL = url; }
-
     XMLHttpRequestUpload* upload();
     XMLHttpRequestUpload* optionalUpload() const { return m_upload.get(); }
 
@@ -218,9 +214,6 @@ private:
     // Used for progress event tracking.
     long long m_receivedLength { 0 };
 
-    unsigned m_lastSendLineNumber { 0 };
-    unsigned m_lastSendColumnNumber { 0 };
-    String m_lastSendURL;
     std::optional<ExceptionCode> m_exceptionCode;
 
     XMLHttpRequestProgressEventThrottle m_progressEventThrottle;
index 06bd7d3..8c860b9 100644 (file)
@@ -66,7 +66,7 @@ enum XMLHttpRequestResponseType {
     attribute unsigned long timeout;
     attribute boolean withCredentials;
     readonly attribute XMLHttpRequestUpload upload;
-    [CallWith=ScriptState, MayThrowException] void send(optional (Document or BodyInit)? body = null);
+    [MayThrowException] void send(optional (Document or BodyInit)? body = null);
     void abort();
 
     // response