Commit 313bc6d4 authored by Dominic Farolino's avatar Dominic Farolino Committed by Commit Bot

[inspector] remove deprecated console methods

As per https://github.com/whatwg/console/issues/27#issuecomment-289312546
and https://bugs.chromium.org/p/chromium/issues/detail?id=706804 we're
leaving the console timeline/timelineEnd methods out of the specification
and testing that implementations do not expose them (relevant WPTs at
https://github.com/web-platform-tests/wpt/blob/master/console/console-tests-historical.any.js).
Their implementations should be removed from Chrome, one of the last
implementers of these legacy methods. The same goes for markTimeline, as
it is deprecated in Chrome and not being included in the spec.

R=bmeurer@chromium.org, kozyatinskiy@chromium.org

Bug: chromium:706804
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibe05848fb664d26d16eeb5bdf6f519c1eeb4b2df
Reviewed-on: https://chromium-review.googlesource.com/1082112Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarAleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#53973}
parent f2b90bd4
......@@ -2837,16 +2837,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kConsoleCountReset, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "assert",
Builtins::kFastConsoleAssert, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "markTimeline",
Builtins::kConsoleMarkTimeline, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "profile",
Builtins::kConsoleProfile, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "profileEnd",
Builtins::kConsoleProfileEnd, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "timeline",
Builtins::kConsoleTimeline, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "timelineEnd",
Builtins::kConsoleTimelineEnd, 1, false, NONE);
SimpleInstallFunction(isolate_, console, "time", Builtins::kConsoleTime, 1,
false, NONE);
SimpleInstallFunction(isolate_, console, "timeEnd",
......
......@@ -32,11 +32,8 @@ namespace internal {
V(Count, count) \
V(CountReset, countReset) \
V(Assert, assert) \
V(MarkTimeline, markTimeline) \
V(Profile, profile) \
V(ProfileEnd, profileEnd) \
V(Timeline, timeline) \
V(TimelineEnd, timelineEnd)
V(ProfileEnd, profileEnd)
namespace {
void ConsoleCall(
......
......@@ -483,11 +483,8 @@ namespace internal {
CPP(ConsoleCountReset) \
CPP(ConsoleAssert) \
TFJ(FastConsoleAssert, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
CPP(ConsoleMarkTimeline) \
CPP(ConsoleProfile) \
CPP(ConsoleProfileEnd) \
CPP(ConsoleTimeline) \
CPP(ConsoleTimelineEnd) \
CPP(ConsoleTime) \
CPP(ConsoleTimeEnd) \
CPP(ConsoleTimeStamp) \
......
......@@ -155,16 +155,10 @@ class ConsoleDelegate {
const ConsoleContext& context) {}
virtual void Assert(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void MarkTimeline(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void Profile(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void ProfileEnd(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void Timeline(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void TimelineEnd(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void Time(const ConsoleCallArguments& args,
const ConsoleContext& context) {}
virtual void TimeEnd(const ConsoleCallArguments& args,
......
......@@ -345,16 +345,6 @@ void V8Console::Assert(const v8::debug::ConsoleCallArguments& info,
m_inspector->debugger()->breakProgramOnAssert(helper.groupId());
}
void V8Console::MarkTimeline(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
ConsoleHelper(info, consoleContext, m_inspector)
.reportDeprecatedCall("V8Console#markTimelineDeprecated",
"'console.markTimeline' is "
"deprecated. Please use "
"'console.timeStamp' instead.");
TimeStamp(info, consoleContext);
}
void V8Console::Profile(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
ConsoleHelper helper(info, consoleContext, m_inspector);
......@@ -414,25 +404,6 @@ static void timeEndFunction(const v8::debug::ConsoleCallArguments& info,
helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message);
}
void V8Console::Timeline(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
ConsoleHelper(info, consoleContext, m_inspector)
.reportDeprecatedCall("V8Console#timeline",
"'console.timeline' is deprecated. Please use "
"'console.time' instead.");
timeFunction(info, consoleContext, true, m_inspector);
}
void V8Console::TimelineEnd(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
ConsoleHelper(info, consoleContext, m_inspector)
.reportDeprecatedCall("V8Console#timelineEnd",
"'console.timelineEnd' is "
"deprecated. Please use "
"'console.timeEnd' instead.");
timeEndFunction(info, consoleContext, true, m_inspector);
}
void V8Console::Time(const v8::debug::ConsoleCallArguments& info,
const v8::debug::ConsoleContext& consoleContext) {
timeFunction(info, consoleContext, false, m_inspector);
......
......@@ -82,16 +82,10 @@ class V8Console : public v8::debug::ConsoleDelegate {
const v8::debug::ConsoleContext& consoleContext) override;
void Assert(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void MarkTimeline(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void Profile(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void ProfileEnd(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void Timeline(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void TimelineEnd(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void Time(const v8::debug::ConsoleCallArguments&,
const v8::debug::ConsoleContext& consoleContext) override;
void TimeEnd(const v8::debug::ConsoleCallArguments&,
......
......@@ -26,14 +26,11 @@ console.context() methods:
[13] : count
[14] : countReset
[15] : assert
[16] : markTimeline
[17] : profile
[18] : profileEnd
[19] : timeline
[20] : timelineEnd
[21] : time
[22] : timeEnd
[23] : timeStamp
[16] : profile
[17] : profileEnd
[18] : time
[19] : timeEnd
[20] : timeStamp
]
Running test: testDefaultConsoleContext
......
Tests checks that deprecation messages for console.
'console.timeline' is deprecated. Please use 'console.time' instead.
'console.timelineEnd' is deprecated. Please use 'console.timeEnd' instead.
'console.markTimeline' is deprecated. Please use 'console.timeStamp' instead.
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start("Tests checks that deprecation messages for console.")
Protocol.Runtime.onConsoleAPICalled(messageAdded);
Protocol.Runtime.enable();
var deprecatedMethods = [
"console.timeline(\"42\")",
"console.timeline(\"42\")",
"console.timeline(\"42\")", // three calls should produce one warning message
"console.timelineEnd(\"42\")",
"console.markTimeline(\"42\")",
];
Protocol.Runtime.evaluate({ expression: deprecatedMethods.join(";") });
var messagesLeft = 3;
function messageAdded(data)
{
var text = data.params.args[0].value;
if (text.indexOf("deprecated") === -1)
return;
InspectorTest.log(text);
if (!--messagesLeft)
InspectorTest.completeTest();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment