Skip to content

Commit

Permalink
[DevTools] Removed Debugger.canSetScriptSource & Debugger.getBacktrace
Browse files Browse the repository at this point in the history
BUG=635947
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2234703003
Cr-Commit-Position: refs/heads/master@{#411376}
  • Loading branch information
alexkozy authored and Commit bot committed Aug 11, 2016
1 parent 667f057 commit 3ecdf6e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,40 @@
{
var a = 2;
debugger;
debugger;
}

function test()
{
var newVariableValue = 55;

InspectorTest.sendCommand("Debugger.enable", {});

InspectorTest.eventHandler["Debugger.paused"] = handleDebuggerPaused;

InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(TestFunction, 0)" });

function handleDebuggerPaused(messageObject)
{
InspectorTest.log("Paused on 'debugger;'");
InspectorTest.eventHandler["Debugger.paused"] = undefined;

var topFrame = messageObject.params.callFrames[0];
var topFrameId = topFrame.callFrameId;
InspectorTest.sendCommand("Debugger.evaluateOnCallFrame", { "callFrameId": topFrameId, "expression": "a = " + newVariableValue }, callbackChangeValue);
}

function callbackChangeValue(response)
{
InspectorTest.log("Variable value changed");
InspectorTest.sendCommand("Debugger.getBacktrace", { }, callbackGetBacktrace);
InspectorTest.eventHandler["Debugger.paused"] = callbackGetBacktrace;
InspectorTest.sendCommand("Debugger.resume", { });
}

function callbackGetBacktrace(response)
{
InspectorTest.log("Stacktrace re-read again");
var localScope = response.result.callFrames[0].scopeChain[0];
var localScope = response.params.callFrames[0].scopeChain[0];
InspectorTest.sendCommand("Runtime.getProperties", { "objectId": localScope.object.objectId }, callbackGetProperties);
}

Expand All @@ -57,7 +59,7 @@
var actualValue = varNamedA.value.value;
InspectorTest.log("New variable is " + actualValue + ", expected is " + newVariableValue + ", old was: 2");
InspectorTest.log(actualValue == newVariableValue ? "SUCCESS" : "FAIL");
} else {
} else {
InspectorTest.log("Failed to find variable in scope");
}
InspectorTest.completeTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
Expand All @@ -14,7 +14,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Expand All @@ -28,7 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Inspector protocol validator.
#
#
# Tests that subsequent protocol changes are not breaking backwards compatibility.
# Following violations are reported:
#
Expand All @@ -39,7 +39,7 @@
# - Event has been removed
# - Required event parameter was removed or changed to optional
# - Parameter type has changed.
#
#
# For the parameters with composite types the above checks are also applied
# recursively to every property of the type.
#
Expand Down Expand Up @@ -197,7 +197,7 @@ def extract_type(typed_object, types_map, errors):
ref = typed_object["$ref"]
if not ref in types_map:
errors.append("Can not resolve type: %s" % ref)
types_map[ref] = { "id": "<transient>", "type": "object" }
types_map[ref] = { "id": "<transient>", "type": "object" }
return types_map[ref]


Expand Down Expand Up @@ -452,7 +452,8 @@ def main():

expected_errors = [
"Debugger.globalObjectCleared: event has been removed",
"Runtime.executionContextCreated.context parameter->Runtime.ExecutionContextDescription.frameId: required property has been removed"
"Runtime.executionContextCreated.context parameter->Runtime.ExecutionContextDescription.frameId: required property has been removed",
"Debugger.canSetScriptSource: command has been removed"
]

errors = compare_schemas(baseline_domains, domains, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,6 @@ void V8DebuggerAgentImpl::continueToLocation(ErrorString* errorString, std::uniq
resume(errorString);
}

void V8DebuggerAgentImpl::getBacktrace(ErrorString* errorString, std::unique_ptr<Array<CallFrame>>* callFrames, Maybe<StackTrace>* asyncStackTrace)
{
if (!assertPaused(errorString))
return;
JavaScriptCallFrames frames = m_debugger->currentCallFrames();
m_pausedCallFrames.swap(frames);
*callFrames = currentCallFrames(errorString);
if (!*callFrames)
return;
*asyncStackTrace = currentAsyncStackTrace();
}

bool V8DebuggerAgentImpl::isCurrentCallStackEmptyOrBlackboxed()
{
DCHECK(enabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,12 @@ class V8DebuggerAgentImpl : public protocol::Debugger::Backend {
void removeBreakpoint(ErrorString*, const String16& breakpointId) override;
void continueToLocation(ErrorString*,
std::unique_ptr<protocol::Debugger::Location>) override;
void getBacktrace(ErrorString*,
std::unique_ptr<protocol::Array<protocol::Debugger::CallFrame>>*,
Maybe<protocol::Runtime::StackTrace>*) override;
void searchInContent(ErrorString*,
const String16& scriptId,
const String16& query,
const Maybe<bool>& optionalCaseSensitive,
const Maybe<bool>& optionalIsRegex,
std::unique_ptr<protocol::Array<protocol::Debugger::SearchMatch>>*) override;
void canSetScriptSource(ErrorString*, bool* result) override { *result = true; }
void setScriptSource(ErrorString*,
const String16& inScriptId,
const String16& inScriptSource,
Expand Down
16 changes: 0 additions & 16 deletions third_party/WebKit/Source/platform/v8_inspector/js_protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,6 @@
],
"description": "Searches for given string in script content."
},
{
"name": "canSetScriptSource",
"returns": [
{ "name": "result", "type": "boolean", "description": "True if <code>setScriptSource</code> is supported." }
],
"description": "Always returns true."
},
{
"name": "setScriptSource",
"parameters": [
Expand Down Expand Up @@ -647,15 +640,6 @@
"experimental": true,
"description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually."
},
{
"name": "getBacktrace",
"returns": [
{ "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
{ "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." }
],
"experimental": true,
"description": "Returns call stack including variables changed since VM was paused. VM must be paused."
},
{
"name": "setAsyncCallStackDepth",
"parameters": [
Expand Down

0 comments on commit 3ecdf6e

Please sign in to comment.