WebKit Bugzilla
Attachment 372856 Details for
Bug 199200
: Web Inspector: Implement console.countReset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
countReset-1.patch (text/plain), 25.28 KB, created by
Joseph Pecoraro
on 2019-06-25 13:13:34 PDT
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2019-06-25 13:13:34 PDT
Size:
25.28 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e37909b8ac5..9a651e33f2c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-06-25 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Implement console.countReset >+ https://bugs.webkit.org/show_bug.cgi?id=199200 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/console/console-count-expected.txt: >+ * inspector/console/console-count.html: >+ * js/console-expected.txt: >+ > 2019-06-24 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Implement console.timeLog >diff --git a/LayoutTests/inspector/console/console-count-expected.txt b/LayoutTests/inspector/console/console-count-expected.txt >index 1b3834daea1..9e9a8e252a6 100644 >--- a/LayoutTests/inspector/console/console-count-expected.txt >+++ b/LayoutTests/inspector/console/console-count-expected.txt >@@ -1,8 +1,8 @@ >-Tests for the console.count API. >+Tests for the console.count and console.countReset APIs. > > > == Running test suite: console.count >--- Running test case: NoArguments >+-- Running test case: console.count.NoArguments > Global: 1 > Global: 2 > Global: 3 >@@ -20,7 +20,7 @@ Global: 14 > Global: 15 > Global: 16 > >--- Running test case: WithLabel >+-- Running test case: console.count.WithLabel > alpha: 1 > alpha: 2 > beta: 1 >@@ -42,3 +42,21 @@ alpha: 14 > beta: 5 > alpha: 15 > >+-- Running test case: console.countReset.NoCounter >+PASS: Should produce a warning console message. >+Counter "missing-label-1" does not exist >+PASS: Should produce a warning console message. >+Counter "missing-label-2" does not exist >+ >+-- Running test case: console.countReset.Basic >+reset-label: 1 >+reset-label: 2 >+reset-label: 3 >+reset-label: 4 >+reset-label: 5 >+reset-label: 6 >+reset-label: 1 >+reset-label: 2 >+reset-label: 1 >+reset-label: 2 >+ >diff --git a/LayoutTests/inspector/console/console-count.html b/LayoutTests/inspector/console/console-count.html >index d648adbbf20..c8f957d422c 100644 >--- a/LayoutTests/inspector/console/console-count.html >+++ b/LayoutTests/inspector/console/console-count.html >@@ -21,12 +21,26 @@ function triggerLabeledCounters() { > } > } > >+function triggerConsoleResetWarnings() { >+ console.countReset("missing-label-1"); >+ console.countReset("missing-label-2"); >+} >+ >+function triggerConsoleResetBasic() { >+ for (let i = 0; i < 10; ++i) { >+ console.count("reset-label"); >+ if (i === 5 || i === 7) >+ console.countReset("reset-label"); >+ } >+} >+ > function test() > { >+ InspectorTest.debug(); > let suite = InspectorTest.createAsyncSuite("console.count"); > > suite.addTestCase({ >- name: "NoArguments", >+ name: "console.count.NoArguments", > description: "No arguments increments a shared global counter.", > test(resolve, reject) { > let seen = 0; >@@ -41,13 +55,13 @@ function test() > } > } > >- InspectorTest.evaluateInPage("triggerCountNoArguments()"); // 15 >- InspectorTest.evaluateInPage("console.count()"); // 1 >+ InspectorTest.evaluateInPage(`triggerCountNoArguments()`); // 15 >+ InspectorTest.evaluateInPage(`console.count()`); // 1 > } > }); > > suite.addTestCase({ >- name: "WithLabel", >+ name: "console.count.WithLabel", > description: "Labeled counters increment the label.", > test(resolve, reject) { > let seen = 0; >@@ -62,7 +76,48 @@ function test() > } > } > >- InspectorTest.evaluateInPage("triggerLabeledCounters()"); >+ InspectorTest.evaluateInPage(`triggerLabeledCounters()`); >+ } >+ }); >+ >+ suite.addTestCase({ >+ name: "console.countReset.NoCounter", >+ description: "A reset of a non-existing counter should warn.", >+ test(resolve, reject) { >+ let seen = 0; >+ const expected = 2; >+ WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, handler); >+ function handler(event) { >+ let message = event.data.message; >+ InspectorTest.expectEqual(message.level, WI.ConsoleMessage.MessageLevel.Warning, "Should produce a warning console message."); >+ InspectorTest.log(message.messageText); >+ if (++seen === expected) { >+ WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); >+ resolve(); >+ } >+ } >+ >+ InspectorTest.evaluateInPage(`triggerConsoleResetWarnings()`); >+ } >+ }); >+ >+ suite.addTestCase({ >+ name: "console.countReset.Basic", >+ description: "A reset of a non-existing counter should warn.", >+ test(resolve, reject) { >+ let seen = 0; >+ const expected = 10; >+ WI.consoleManager.addEventListener(WI.ConsoleManager.Event.MessageAdded, handler); >+ function handler(event) { >+ let message = event.data.message; >+ InspectorTest.log(message.messageText); >+ if (++seen === expected) { >+ WI.consoleManager.removeEventListener(WI.ConsoleManager.Event.MessageAdded, handler); >+ resolve(); >+ } >+ } >+ >+ InspectorTest.evaluateInPage(`triggerConsoleResetBasic()`); > } > }); > >@@ -71,6 +126,6 @@ function test() > </script> > </head> > <body onload="runTest()"> >-<p>Tests for the console.count API.</p> >+<p>Tests for the console.count and console.countReset APIs.</p> > </body> > </html> >diff --git a/LayoutTests/js/console-expected.txt b/LayoutTests/js/console-expected.txt >index 63f7d47667f..aa3b0638910 100644 >--- a/LayoutTests/js/console-expected.txt >+++ b/LayoutTests/js/console-expected.txt >@@ -100,6 +100,13 @@ PASS descriptor.configurable is true > PASS descriptor.writable is true > PASS descriptor.enumerable is true > >+console.countReset >+PASS typeof console.countReset is "function" >+PASS console.countReset.length is 0 >+PASS descriptor.configurable is true >+PASS descriptor.writable is true >+PASS descriptor.enumerable is true >+ > console.profile > PASS typeof console.profile is "function" > PASS console.profile.length is 0 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 62a2797e85c..67245f8df94 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-06-25 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Implement console.countReset >+ https://bugs.webkit.org/show_bug.cgi?id=199200 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/JSGlobalObjectConsoleClient.cpp: >+ (Inspector::JSGlobalObjectConsoleClient::countReset): >+ * inspector/JSGlobalObjectConsoleClient.h: >+ * inspector/agents/InspectorConsoleAgent.cpp: >+ (Inspector::InspectorConsoleAgent::getCounterLabel): >+ (Inspector::InspectorConsoleAgent::count): >+ (Inspector::InspectorConsoleAgent::countReset): >+ * inspector/agents/InspectorConsoleAgent.h: >+ * runtime/ConsoleClient.h: >+ * runtime/ConsoleObject.cpp: >+ (JSC::ConsoleObject::finishCreation): >+ (JSC::consoleProtoFuncCountReset): >+ > 2019-06-24 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Implement console.timeLog >diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >index fcdcc491c6d..3795f5b17ed 100644 >--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp >@@ -75,6 +75,11 @@ void JSGlobalObjectConsoleClient::count(ExecState* exec, Ref<ScriptArguments>&& > m_consoleAgent->count(exec, WTFMove(arguments)); > } > >+void JSGlobalObjectConsoleClient::countReset(ExecState* exec, Ref<ScriptArguments>&& arguments) >+{ >+ m_consoleAgent->countReset(exec, WTFMove(arguments)); >+} >+ > void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String& title) > { > if (!m_consoleAgent->enabled()) >diff --git a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >index 8bfeada8494..b75c66d20fd 100644 >--- a/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >+++ b/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h >@@ -50,6 +50,7 @@ public: > protected: > void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<ScriptArguments>&&) override; > void count(JSC::ExecState*, Ref<ScriptArguments>&&) override; >+ void countReset(JSC::ExecState*, Ref<ScriptArguments>&&) override; > void profile(JSC::ExecState*, const String& title) override; > void profileEnd(JSC::ExecState*, const String& title) override; > void takeHeapSnapshot(JSC::ExecState*, const String& title) override; >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >index 0386837fbbc..72fe7b46d16 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >@@ -208,15 +208,8 @@ void InspectorConsoleAgent::takeHeapSnapshot(const String& title) > m_frontendDispatcher->heapSnapshot(timestamp, snapshotData, title.isEmpty() ? nullptr : &title); > } > >-void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& arguments) >+void InspectorConsoleAgent::getCounterLabel(Ref<ScriptArguments>&& arguments, String& title, String& identifier) > { >- if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) >- return; >- >- Ref<ScriptCallStack> callStack = createScriptCallStackForConsole(state); >- >- String title; >- String identifier; > if (!arguments->argumentCount()) { > // '@' prefix for engine generated labels. > title = "Global"_s; >@@ -226,6 +219,16 @@ void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& > arguments->getFirstArgumentAsString(title); > identifier = makeString('#', title); > } >+} >+ >+void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& arguments) >+{ >+ if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) >+ return; >+ >+ String title; >+ String identifier; >+ getCounterLabel(WTFMove(arguments), title, identifier); > > auto result = m_counts.add(identifier, 1); > if (!result.isNewEntry) >@@ -234,9 +237,32 @@ void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& > // FIXME: Web Inspector should have a better UI for counters, but for now we just log an updated counter value. > > String message = makeString(title, ": ", result.iterator->value); >+ Ref<ScriptCallStack> callStack = createScriptCallStackForConsole(state); > addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Debug, message, WTFMove(callStack))); > } > >+void InspectorConsoleAgent::countReset(JSC::ExecState*, Ref<ScriptArguments>&& arguments) >+{ >+ if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) >+ return; >+ >+ String title; >+ String identifier; >+ getCounterLabel(WTFMove(arguments), title, identifier); >+ >+ auto it = m_counts.find(identifier); >+ if (it == m_counts.end()) { >+ // FIXME: Send an enum to the frontend for localization? >+ String warning = makeString("Counter \"", title, "\" does not exist"); >+ addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Log, MessageLevel::Warning, warning)); >+ return; >+ } >+ >+ it->value = 0; >+ >+ // FIXME: Web Inspector should have a better UI for counters, but for now we just log an updated counter value. >+} >+ > static bool isGroupMessage(MessageType type) > { > return type == MessageType::StartGroup >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >index 3c3d605e087..d9f623573a1 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >+++ b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h >@@ -75,11 +75,13 @@ public: > void stopTiming(const String& title, Ref<ScriptCallStack>&&); > void takeHeapSnapshot(const String& title); > void count(JSC::ExecState*, Ref<ScriptArguments>&&); >+ void countReset(JSC::ExecState*, Ref<ScriptArguments>&&); > > void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Protocol::Console::Channel>>&) override; > void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) override; > > protected: >+ void getCounterLabel(Ref<ScriptArguments>&&, String& title, String& identifier); > void addConsoleMessage(std::unique_ptr<ConsoleMessage>); > > InjectedScriptManager& m_injectedScriptManager; >diff --git a/Source/JavaScriptCore/runtime/ConsoleClient.h b/Source/JavaScriptCore/runtime/ConsoleClient.h >index b3a846b12ff..457080b81d3 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleClient.h >+++ b/Source/JavaScriptCore/runtime/ConsoleClient.h >@@ -56,6 +56,7 @@ public: > > virtual void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; > virtual void count(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; >+ virtual void countReset(ExecState*, Ref<Inspector::ScriptArguments>&&) = 0; > virtual void profile(ExecState*, const String& title) = 0; > virtual void profileEnd(ExecState*, const String& title) = 0; > virtual void takeHeapSnapshot(ExecState*, const String& title) = 0; >diff --git a/Source/JavaScriptCore/runtime/ConsoleObject.cpp b/Source/JavaScriptCore/runtime/ConsoleObject.cpp >index 4bdfaebb347..8c81a97025e 100644 >--- a/Source/JavaScriptCore/runtime/ConsoleObject.cpp >+++ b/Source/JavaScriptCore/runtime/ConsoleObject.cpp >@@ -48,6 +48,7 @@ static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTable(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTrace(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncAssert(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncCount(ExecState*); >+static EncodedJSValue JSC_HOST_CALL consoleProtoFuncCountReset(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncProfile(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncProfileEnd(ExecState*); > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTakeHeapSnapshot(ExecState*); >@@ -90,6 +91,7 @@ void ConsoleObject::finishCreation(VM& vm, JSGlobalObject* globalObject) > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("trace", consoleProtoFuncTrace, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("assert", consoleProtoFuncAssert, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->count, consoleProtoFuncCount, static_cast<unsigned>(PropertyAttribute::None), 0); >+ JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("countReset", consoleProtoFuncCountReset, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("profile", consoleProtoFuncProfile, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("profileEnd", consoleProtoFuncProfileEnd, static_cast<unsigned>(PropertyAttribute::None), 0); > JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("time", consoleProtoFuncTime, static_cast<unsigned>(PropertyAttribute::None), 0); >@@ -225,6 +227,16 @@ static EncodedJSValue JSC_HOST_CALL consoleProtoFuncCount(ExecState* exec) > return JSValue::encode(jsUndefined()); > } > >+static EncodedJSValue JSC_HOST_CALL consoleProtoFuncCountReset(ExecState* exec) >+{ >+ ConsoleClient* client = exec->lexicalGlobalObject()->consoleClient(); >+ if (!client) >+ return JSValue::encode(jsUndefined()); >+ >+ client->countReset(exec, Inspector::createScriptArguments(exec, 0)); >+ return JSValue::encode(jsUndefined()); >+} >+ > static EncodedJSValue JSC_HOST_CALL consoleProtoFuncProfile(ExecState* exec) > { > VM& vm = exec->vm(); >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 7296bf1127d..7dc1181bc33 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2019-06-25 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Implement console.countReset >+ https://bugs.webkit.org/show_bug.cgi?id=199200 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * inspector/InspectorInstrumentation.cpp: >+ (WebCore::InspectorInstrumentation::consoleCountImpl): >+ (WebCore::InspectorInstrumentation::consoleCountResetImpl): >+ * inspector/InspectorInstrumentation.h: >+ (WebCore::InspectorInstrumentation::consoleCountReset): >+ * page/PageConsoleClient.cpp: >+ (WebCore::PageConsoleClient::countReset): >+ * page/PageConsoleClient.h: >+ * workers/WorkerConsoleClient.cpp: >+ (WebCore::WorkerConsoleClient::countReset): >+ * workers/WorkerConsoleClient.h: >+ * worklets/WorkletConsoleClient.cpp: >+ (WebCore::WorkletConsoleClient::countReset): >+ * worklets/WorkletConsoleClient.h: >+ > 2019-06-24 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Implement console.timeLog >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp >index 2ec77986d25..8cfe8a75a36 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp >+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp >@@ -853,13 +853,16 @@ void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents& inst > > void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents& instrumentingAgents, JSC::ExecState* state, Ref<ScriptArguments>&& arguments) > { >- if (!instrumentingAgents.inspectorEnvironment().developerExtrasEnabled()) >- return; >- > if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent()) > consoleAgent->count(state, WTFMove(arguments)); > } > >+void InspectorInstrumentation::consoleCountResetImpl(InstrumentingAgents& instrumentingAgents, JSC::ExecState* state, Ref<ScriptArguments>&& arguments) >+{ >+ if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent()) >+ consoleAgent->countReset(state, WTFMove(arguments)); >+} >+ > void InspectorInstrumentation::takeHeapSnapshotImpl(InstrumentingAgents& instrumentingAgents, const String& title) > { > if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent()) >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index 1f75137fb5e..d5368c12e13 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -223,6 +223,9 @@ public: > > static void consoleCount(Page&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); > static void consoleCount(WorkerGlobalScope&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); >+ static void consoleCountReset(Page&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); >+ static void consoleCountReset(WorkerGlobalScope&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); >+ > static void takeHeapSnapshot(Frame&, const String& title); > static void startConsoleTiming(Frame&, const String& title); > static void startConsoleTiming(WorkerGlobalScope&, const String& title); >@@ -403,6 +406,7 @@ private: > static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>); > > static void consoleCountImpl(InstrumentingAgents&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); >+ static void consoleCountResetImpl(InstrumentingAgents&, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&); > static void takeHeapSnapshotImpl(InstrumentingAgents&, const String& title); > static void startConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title); > static void startConsoleTimingImpl(InstrumentingAgents&, const String& title); >@@ -1393,6 +1397,16 @@ inline void InspectorInstrumentation::consoleCount(WorkerGlobalScope& workerGlob > consoleCountImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), state, WTFMove(arguments)); > } > >+inline void InspectorInstrumentation::consoleCountReset(Page& page, JSC::ExecState* state, Ref<Inspector::ScriptArguments>&& arguments) >+{ >+ consoleCountResetImpl(instrumentingAgentsForPage(page), state, WTFMove(arguments)); >+} >+ >+inline void InspectorInstrumentation::consoleCountReset(WorkerGlobalScope& workerGlobalScope, JSC::ExecState* state, Ref<Inspector::ScriptArguments>&& arguments) >+{ >+ consoleCountResetImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), state, WTFMove(arguments)); >+} >+ > inline void InspectorInstrumentation::takeHeapSnapshot(Frame& frame, const String& title) > { > FAST_RETURN_IF_NO_FRONTENDS(void()); >diff --git a/Source/WebCore/page/PageConsoleClient.cpp b/Source/WebCore/page/PageConsoleClient.cpp >index 7b9704dda73..af2267cb1d1 100644 >--- a/Source/WebCore/page/PageConsoleClient.cpp >+++ b/Source/WebCore/page/PageConsoleClient.cpp >@@ -175,6 +175,11 @@ void PageConsoleClient::count(JSC::ExecState* exec, Ref<ScriptArguments>&& argum > InspectorInstrumentation::consoleCount(m_page, exec, WTFMove(arguments)); > } > >+void PageConsoleClient::countReset(JSC::ExecState* exec, Ref<ScriptArguments>&& arguments) >+{ >+ InspectorInstrumentation::consoleCountReset(m_page, exec, WTFMove(arguments)); >+} >+ > void PageConsoleClient::profile(JSC::ExecState* exec, const String& title) > { > // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler >diff --git a/Source/WebCore/page/PageConsoleClient.h b/Source/WebCore/page/PageConsoleClient.h >index 3d0890034b3..8a39da0d7da 100644 >--- a/Source/WebCore/page/PageConsoleClient.h >+++ b/Source/WebCore/page/PageConsoleClient.h >@@ -68,6 +68,7 @@ public: > protected: > void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void count(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; >+ void countReset(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void profile(JSC::ExecState*, const String& title) override; > void profileEnd(JSC::ExecState*, const String& title) override; > void takeHeapSnapshot(JSC::ExecState*, const String& title) override; >diff --git a/Source/WebCore/workers/WorkerConsoleClient.cpp b/Source/WebCore/workers/WorkerConsoleClient.cpp >index dd643e73201..c7b6b40f209 100644 >--- a/Source/WebCore/workers/WorkerConsoleClient.cpp >+++ b/Source/WebCore/workers/WorkerConsoleClient.cpp >@@ -55,6 +55,11 @@ void WorkerConsoleClient::count(JSC::ExecState* exec, Ref<ScriptArguments>&& arg > InspectorInstrumentation::consoleCount(m_workerGlobalScope, exec, WTFMove(arguments)); > } > >+void WorkerConsoleClient::countReset(JSC::ExecState* exec, Ref<ScriptArguments>&& arguments) >+{ >+ InspectorInstrumentation::consoleCountReset(m_workerGlobalScope, exec, WTFMove(arguments)); >+} >+ > void WorkerConsoleClient::time(JSC::ExecState*, const String& title) > { > InspectorInstrumentation::startConsoleTiming(m_workerGlobalScope, title); >diff --git a/Source/WebCore/workers/WorkerConsoleClient.h b/Source/WebCore/workers/WorkerConsoleClient.h >index ec3e19c0b2c..6177db18fcf 100644 >--- a/Source/WebCore/workers/WorkerConsoleClient.h >+++ b/Source/WebCore/workers/WorkerConsoleClient.h >@@ -44,6 +44,7 @@ public: > protected: > void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void count(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; >+ void countReset(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) override; > void profile(JSC::ExecState*, const String& title) override; > void profileEnd(JSC::ExecState*, const String& title) override; > void takeHeapSnapshot(JSC::ExecState*, const String& title) override; >diff --git a/Source/WebCore/worklets/WorkletConsoleClient.cpp b/Source/WebCore/worklets/WorkletConsoleClient.cpp >index eefbb9a113c..9f1d37dceab 100644 >--- a/Source/WebCore/worklets/WorkletConsoleClient.cpp >+++ b/Source/WebCore/worklets/WorkletConsoleClient.cpp >@@ -53,6 +53,7 @@ void WorkletConsoleClient::messageWithTypeAndLevel(MessageType type, MessageLeve > } > > void WorkletConsoleClient::count(JSC::ExecState*, Ref<ScriptArguments>&&) { } >+void WorkletConsoleClient::countReset(JSC::ExecState*, Ref<ScriptArguments>&&) { } > > void WorkletConsoleClient::time(JSC::ExecState*, const String&) { } > void WorkletConsoleClient::timeLog(JSC::ExecState*, const String&, Ref<ScriptArguments>&&) { } >diff --git a/Source/WebCore/worklets/WorkletConsoleClient.h b/Source/WebCore/worklets/WorkletConsoleClient.h >index 38b6774dda3..d8446403b31 100644 >--- a/Source/WebCore/worklets/WorkletConsoleClient.h >+++ b/Source/WebCore/worklets/WorkletConsoleClient.h >@@ -46,6 +46,7 @@ public: > private: > void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; > void count(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; >+ void countReset(JSC::ExecState*, Ref<Inspector::ScriptArguments>&&) final; > void profile(JSC::ExecState*, const String& title) final; > void profileEnd(JSC::ExecState*, const String& title) final; > void takeHeapSnapshot(JSC::ExecState*, const String& title) final;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hi
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199200
: 372856 |
372900
|
372937