Changeset 223820 in webkit
- Timestamp:
- Oct 21, 2017 3:23:00 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r223813 r223820 1 2017-10-21 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Remove unused Console.setMonitoringXHREnabled 4 https://bugs.webkit.org/show_bug.cgi?id=178617 5 6 Reviewed by Sam Weinig. 7 8 * JavaScriptCore.xcodeproj/project.pbxproj: 9 * Sources.txt: 10 * inspector/agents/InspectorConsoleAgent.h: 11 * inspector/agents/JSGlobalObjectConsoleAgent.cpp: Removed. 12 * inspector/agents/JSGlobalObjectConsoleAgent.h: Removed. 13 * inspector/protocol/Console.json: 14 Removed files and method. 15 16 * inspector/JSGlobalObjectInspectorController.cpp: 17 (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController): 18 This can use the base ConsoleAgent now. 19 1 20 2017-10-21 Yusuke Suzuki <utatane.tea@gmail.com> 2 21 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r223738 r223820 1336 1336 A5FD007E189B0B4C00633231 /* ScriptCallStackFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD007C189B0B4C00633231 /* ScriptCallStackFactory.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1337 1337 A5FD0082189B191A00633231 /* InspectorConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1338 A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */; };1339 1338 A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; }; 1340 1339 A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873C17CBE8D300C3E643 /* MapPrototype.h */; }; … … 3958 3957 A5FD007F189B191A00633231 /* InspectorConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorConsoleAgent.cpp; sourceTree = "<group>"; }; 3959 3958 A5FD0080189B191A00633231 /* InspectorConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleAgent.h; sourceTree = "<group>"; }; 3960 A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectConsoleAgent.cpp; sourceTree = "<group>"; };3961 A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectConsoleAgent.h; sourceTree = "<group>"; };3962 3959 A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; }; 3963 3960 A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; }; … … 7561 7558 A55165D01BDEFDBD003B75C1 /* InspectorScriptProfilerAgent.cpp */, 7562 7559 A55165D11BDEFDBD003B75C1 /* InspectorScriptProfilerAgent.h */, 7563 A5FD0083189B1B7E00633231 /* JSGlobalObjectConsoleAgent.cpp */,7564 A5FD0084189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h */,7565 7560 A57D23E71891B0770031C7FA /* JSGlobalObjectDebuggerAgent.cpp */, 7566 7561 A57D23E81891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h */, … … 8765 8760 BC18C4210E16F5CD00B34460 /* JSGlobalObject.h in Headers */, 8766 8761 996B731D1BDA08EF00331B84 /* JSGlobalObject.lut.h in Headers */, 8767 A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */,8768 8762 A5C3A1A618C0490200C9593A /* JSGlobalObjectConsoleClient.h in Headers */, 8769 8763 A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r223738 r223820 558 558 inspector/agents/InspectorRuntimeAgent.cpp 559 559 inspector/agents/InspectorScriptProfilerAgent.cpp 560 inspector/agents/JSGlobalObjectConsoleAgent.cpp561 560 inspector/agents/JSGlobalObjectDebuggerAgent.cpp 562 561 inspector/agents/JSGlobalObjectRuntimeAgent.cpp -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
r218794 r223820 36 36 #include "InspectorAgent.h" 37 37 #include "InspectorBackendDispatcher.h" 38 #include "InspectorConsoleAgent.h" 38 39 #include "InspectorFrontendChannel.h" 39 40 #include "InspectorFrontendRouter.h" … … 42 43 #include "JSCInlines.h" 43 44 #include "JSGlobalObject.h" 44 #include "JSGlobalObjectConsoleAgent.h"45 45 #include "JSGlobalObjectConsoleClient.h" 46 46 #include "JSGlobalObjectDebuggerAgent.h" … … 84 84 auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(context); 85 85 auto heapAgent = std::make_unique<InspectorHeapAgent>(context); 86 auto consoleAgent = std::make_unique< JSGlobalObjectConsoleAgent>(context, heapAgent.get());86 auto consoleAgent = std::make_unique<InspectorConsoleAgent>(context, heapAgent.get()); 87 87 auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(context, consoleAgent.get()); 88 88 auto scriptProfilerAgent = std::make_unique<InspectorScriptProfilerAgent>(context); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h
r222486 r223820 62 62 void disable(ErrorString&) override; 63 63 void clearMessages(ErrorString&) override; 64 void setMonitoringXHREnabled(ErrorString&, bool enabled) override = 0;65 64 66 65 bool enabled() const { return m_enabled; } -
trunk/Source/JavaScriptCore/inspector/protocol/Console.json
r222486 r223820 58 58 "name": "clearMessages", 59 59 "description": "Clears console messages collected in the browser." 60 },61 {62 "name": "setMonitoringXHREnabled",63 "description": "Toggles monitoring of XMLHttpRequest. If <code>true</code>, console will receive messages upon each XHR issued.",64 "parameters": [65 { "name": "enabled", "type": "boolean", "description": "Monitoring enabled state." }66 ]67 60 } 68 61 ], -
trunk/Source/WebCore/ChangeLog
r223819 r223820 1 2017-10-21 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Remove unused Console.setMonitoringXHREnabled 4 https://bugs.webkit.org/show_bug.cgi?id=178617 5 6 Reviewed by Sam Weinig. 7 8 * inspector/InspectorInstrumentation.cpp: 9 (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl): 10 * inspector/InspectorInstrumentation.h: 11 (WebCore::InspectorInstrumentation::didFinishXHRLoading): 12 * inspector/WebConsoleAgent.cpp: 13 (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted. 14 (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted. 15 * inspector/WebConsoleAgent.h: 16 Remove XHR monitoring code. 17 18 * xml/XMLHttpRequest.h: 19 * xml/XMLHttpRequest.cpp: 20 (WebCore::XMLHttpRequest::send): 21 (WebCore::XMLHttpRequest::didFinishLoading): 22 (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted. 23 * xml/XMLHttpRequest.idl: 24 Remove now unused state on XHR and ExecState requirement for send(). 25 1 26 2017-10-21 Dean Jackson <dino@apple.com> 2 27 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r223618 r223820 626 626 } 627 627 628 void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber) 629 { 630 if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent()) 631 consoleAgent->didFinishXHRLoading(identifier, url, sendURL, sendLineNumber, sendColumnNumber); 628 void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, std::optional<String> decodedText) 629 { 632 630 if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent()) { 633 631 if (decodedText) -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r223618 r223820 187 187 static void willSendRequestOfType(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType); 188 188 189 static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText , const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);189 static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText); 190 190 static void willLoadXHRSynchronously(ScriptExecutionContext*); 191 191 static void didLoadXHRSynchronously(ScriptExecutionContext*); … … 356 356 static void didFinishLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const NetworkLoadMetrics&, ResourceLoader*); 357 357 static void didFailLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceError&); 358 static void didFinishXHRLoadingImpl(InstrumentingAgents&, unsigned long identifier, std::optional<String> decodedText , const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);358 static void didFinishXHRLoadingImpl(InstrumentingAgents&, unsigned long identifier, std::optional<String> decodedText); 359 359 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&); 360 360 static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&); … … 958 958 } 959 959 960 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText , const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)961 { 962 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 963 didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText , url, sendURL, sendLineNumber, sendColumnNumber);960 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText) 961 { 962 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) 963 didFinishXHRLoadingImpl(*instrumentingAgents, identifier, decodedText); 964 964 } 965 965 -
trunk/Source/WebCore/inspector/WebConsoleAgent.cpp
r223476 r223820 47 47 } 48 48 49 void WebConsoleAgent::setMonitoringXHREnabled(ErrorString&, bool enabled)50 {51 m_monitoringXHREnabled = enabled;52 }53 54 49 void WebConsoleAgent::frameWindowDiscarded(DOMWindow* window) 55 50 { … … 64 59 65 60 static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).discardInjectedScriptsFor(window); 66 }67 68 void WebConsoleAgent::didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)69 {70 if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())71 return;72 73 if (m_monitoringXHREnabled) {74 String message = "XHR finished loading: \"" + url + "\".";75 addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::Network, MessageType::Log, MessageLevel::Debug, message, sendURL, sendLineNumber, sendColumnNumber, nullptr, requestIdentifier));76 }77 61 } 78 62 -
trunk/Source/WebCore/inspector/WebConsoleAgent.h
r223728 r223820 42 42 virtual ~WebConsoleAgent() = default; 43 43 44 void setMonitoringXHREnabled(ErrorString&, bool enabled) final;45 46 44 void frameWindowDiscarded(DOMWindow*); 47 45 48 void didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);49 46 void didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse&); 50 47 void didFailLoading(unsigned long requestIdentifier, const ResourceError&); 51 52 protected:53 bool m_monitoringXHREnabled { false };54 48 }; 55 49 -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r223217 r223820 44 44 #include "ResourceError.h" 45 45 #include "ResourceRequest.h" 46 #include "ScriptController.h"47 46 #include "SecurityOriginPolicy.h" 48 47 #include "Settings.h" … … 55 54 #include "XMLHttpRequestUpload.h" 56 55 #include "markup.h" 57 #include <interpreter/StackVisitor.h>58 56 #include <mutex> 59 57 #include <runtime/ArrayBuffer.h> … … 281 279 } 282 280 283 void XMLHttpRequest::setLastSendLineAndColumnNumber(unsigned lineNumber, unsigned columnNumber)284 {285 m_lastSendLineNumber = lineNumber;286 m_lastSendColumnNumber = columnNumber;287 }288 289 281 XMLHttpRequestUpload* XMLHttpRequest::upload() 290 282 { … … 434 426 } 435 427 436 namespace { 437 438 // FIXME: This should be abstracted out, so that any IDL function can be passed the line/column/url tuple. 439 440 // FIXME: This should probably use ShadowChicken so that we get the right frame even when it did a tail call. 441 // https://bugs.webkit.org/show_bug.cgi?id=155688 442 443 class SendFunctor { 444 public: 445 SendFunctor() = default; 446 447 unsigned line() const { return m_line; } 448 unsigned column() const { return m_column; } 449 String url() const { return m_url; } 450 451 JSC::StackVisitor::Status operator()(JSC::StackVisitor& visitor) const 452 { 453 if (!m_hasSkippedFirstFrame) { 454 m_hasSkippedFirstFrame = true; 455 return JSC::StackVisitor::Continue; 456 } 457 458 unsigned line = 0; 459 unsigned column = 0; 460 visitor->computeLineAndColumn(line, column); 461 m_line = line; 462 m_column = column; 463 m_url = visitor->sourceURL(); 464 return JSC::StackVisitor::Done; 465 } 466 467 private: 468 mutable bool m_hasSkippedFirstFrame { false }; 469 mutable unsigned m_line { 0 }; 470 mutable unsigned m_column { 0 }; 471 mutable String m_url; 472 }; 473 474 } 475 476 ExceptionOr<void> XMLHttpRequest::send(JSC::ExecState& state, std::optional<SendTypes>&& sendType) 428 ExceptionOr<void> XMLHttpRequest::send(std::optional<SendTypes>&& sendType) 477 429 { 478 430 InspectorInstrumentation::willSendXMLHttpRequest(scriptExecutionContext(), url()); … … 492 444 } 493 445 494 SendFunctor functor;495 state.iterate(functor);496 setLastSendLineAndColumnNumber(functor.line(), functor.column());497 setLastSendURL(functor.url());498 499 446 return result; 500 447 } … … 993 940 if (!m_binaryResponseBuilder) 994 941 decodedText = m_responseBuilder.toStringPreserveCapacity(); 995 InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), identifier, decodedText , m_url, m_lastSendURL, m_lastSendLineNumber, m_lastSendColumnNumber);942 InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), identifier, decodedText); 996 943 997 944 bool hadLoader = m_loader; -
trunk/Source/WebCore/xml/XMLHttpRequest.h
r223217 r223820 36 36 class ArrayBuffer; 37 37 class ArrayBufferView; 38 class ExecState;39 38 } 40 39 … … 81 80 ExceptionOr<void> open(const String& method, const URL&, bool async); 82 81 ExceptionOr<void> open(const String& method, const String&, bool async, const String& user, const String& password); 83 ExceptionOr<void> send( JSC::ExecState&,std::optional<SendTypes>&&);82 ExceptionOr<void> send(std::optional<SendTypes>&&); 84 83 void abort(); 85 84 ExceptionOr<void> setRequestHeader(const String& name, const String& value); … … 110 109 String responseURL() const; 111 110 112 void setLastSendLineAndColumnNumber(unsigned lineNumber, unsigned columnNumber);113 void setLastSendURL(const String& url) { m_lastSendURL = url; }114 115 111 XMLHttpRequestUpload* upload(); 116 112 XMLHttpRequestUpload* optionalUpload() const { return m_upload.get(); } … … 219 215 long long m_receivedLength { 0 }; 220 216 221 unsigned m_lastSendLineNumber { 0 };222 unsigned m_lastSendColumnNumber { 0 };223 String m_lastSendURL;224 217 std::optional<ExceptionCode> m_exceptionCode; 225 218 -
trunk/Source/WebCore/xml/XMLHttpRequest.idl
r222690 r223820 67 67 attribute boolean withCredentials; 68 68 readonly attribute XMLHttpRequestUpload upload; 69 [ CallWith=ScriptState,MayThrowException] void send(optional (Document or BodyInit)? body = null);69 [MayThrowException] void send(optional (Document or BodyInit)? body = null); 70 70 void abort(); 71 71
Note: See TracChangeset
for help on using the changeset viewer.