Commit ff10ed55 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] migrated Debugger.setBreakpointsActive to native

BUG=none
R=pfeldman@chromium.org,yangguo@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2688243004
Cr-Commit-Position: refs/heads/master@{#43136}
parent 31bc17f0
......@@ -9049,6 +9049,12 @@ void debug::ChangeBreakOnException(Isolate* isolate, ExceptionBreakState type) {
type != NoBreakOnException);
}
void debug::SetBreakPointsActive(Isolate* v8_isolate, bool is_active) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
isolate->debug()->set_break_points_active(is_active);
}
void debug::SetOutOfMemoryCallback(Isolate* isolate,
OutOfMemoryCallback callback, void* data) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
......
......@@ -83,6 +83,8 @@ enum ExceptionBreakState {
*/
void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state);
void SetBreakPointsActive(Isolate* isolate, bool is_active);
enum StepAction {
StepOut = 0, // Step out of the current function.
StepNext = 1, // Step to the next statement in the current function.
......
......@@ -186,15 +186,6 @@ DebuggerScript.clearBreakpoints = function(execState)
Debug.clearAllBreakPoints();
}
/**
* @param {!ExecutionState} execState
* @param {!{enabled: boolean}} info
*/
DebuggerScript.setBreakpointsActivated = function(execState, info)
{
Debug.debuggerFlags().breakPointsActive.setValue(info.enabled);
}
/**
* @param {!Array<!BreakPoint>|undefined} breakpoints
*/
......
......@@ -72,10 +72,6 @@ Debug.findBreakPointActualLocations = function(breakId) {}
*/
Debug.findBreakPoint = function(breakId, remove) {}
/** @return {!DebuggerFlags} */
Debug.debuggerFlags = function() {}
/** @enum */
const BreakPositionAlignment = {
Statement: 0,
......@@ -83,20 +79,6 @@ const BreakPositionAlignment = {
};
Debug.BreakPositionAlignment = BreakPositionAlignment;
/** @interface */
function DebuggerFlag() {}
/** @param {boolean} value */
DebuggerFlag.prototype.setValue = function(value) {}
/** @typedef {{
* breakPointsActive: !DebuggerFlag
* }}
*/
var DebuggerFlags;
/** @const */
var LiveEdit = {}
......
......@@ -310,26 +310,7 @@ void V8Debugger::setBreakpointsActivated(bool activated) {
UNREACHABLE();
return;
}
v8::HandleScope scope(m_isolate);
v8::Local<v8::Context> context = debuggerContext();
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> info = v8::Object::New(m_isolate);
bool success = false;
success = info->Set(context, toV8StringInternalized(m_isolate, "enabled"),
v8::Boolean::New(m_isolate, activated))
.FromMaybe(false);
DCHECK(success);
USE(success);
v8::Local<v8::Function> setBreakpointsActivated =
v8::Local<v8::Function>::Cast(
m_debuggerScript.Get(m_isolate)
->Get(context, toV8StringInternalized(m_isolate,
"setBreakpointsActivated"))
.ToLocalChecked());
v8::debug::Call(debuggerContext(), setBreakpointsActivated, info)
.ToLocalChecked();
v8::debug::SetBreakPointsActive(m_isolate, activated);
m_breakpointsActivated = activated;
}
......
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