| Index: src/inspector/v8-debugger.cc
|
| diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
|
| index 6ebd55798f4bd48bd540b18efe82dac39fad7843..9ce49808eb3d34b7d82c5a5f04c68d27da32b84d 100644
|
| --- a/src/inspector/v8-debugger.cc
|
| +++ b/src/inspector/v8-debugger.cc
|
| @@ -56,7 +56,7 @@ V8Debugger::V8Debugger(v8::Isolate* isolate, V8InspectorImpl* inspector)
|
| m_runningNestedMessageLoop(false),
|
| m_ignoreScriptParsedEventsCounter(0),
|
| m_maxAsyncCallStackDepth(0),
|
| - m_pauseOnExceptionsState(v8::DebugInterface::NoBreakOnException),
|
| + m_pauseOnExceptionsState(v8::debug::NoBreakOnException),
|
| m_wasmTranslation(isolate, this) {}
|
|
|
| V8Debugger::~V8Debugger() {}
|
| @@ -65,14 +65,14 @@ void V8Debugger::enable() {
|
| if (m_enableCount++) return;
|
| DCHECK(!enabled());
|
| v8::HandleScope scope(m_isolate);
|
| - v8::DebugInterface::SetDebugEventListener(m_isolate,
|
| - &V8Debugger::v8DebugEventCallback,
|
| - v8::External::New(m_isolate, this));
|
| - m_debuggerContext.Reset(m_isolate,
|
| - v8::DebugInterface::GetDebugContext(m_isolate));
|
| - v8::DebugInterface::ChangeBreakOnException(
|
| - m_isolate, v8::DebugInterface::NoBreakOnException);
|
| - m_pauseOnExceptionsState = v8::DebugInterface::NoBreakOnException;
|
| + v8::debug::DebugInterface::SetDebugEventListener(
|
| + m_isolate, &V8Debugger::v8DebugEventCallback,
|
| + v8::External::New(m_isolate, this));
|
| + m_debuggerContext.Reset(
|
| + m_isolate, v8::debug::DebugInterface::GetDebugContext(m_isolate));
|
| + v8::debug::DebugInterface::ChangeBreakOnException(
|
| + m_isolate, v8::debug::NoBreakOnException);
|
| + m_pauseOnExceptionsState = v8::debug::NoBreakOnException;
|
| compileDebuggerScript();
|
| }
|
|
|
| @@ -84,7 +84,7 @@ void V8Debugger::disable() {
|
| m_debuggerContext.Reset();
|
| allAsyncTasksCanceled();
|
| m_wasmTranslation.Clear();
|
| - v8::DebugInterface::SetDebugEventListener(m_isolate, nullptr);
|
| + v8::debug::DebugInterface::SetDebugEventListener(m_isolate, nullptr);
|
| }
|
|
|
| bool V8Debugger::enabled() const { return !m_debuggerScript.IsEmpty(); }
|
| @@ -120,11 +120,11 @@ void V8Debugger::getCompiledScripts(
|
| int contextGroupId,
|
| std::vector<std::unique_ptr<V8DebuggerScript>>& result) {
|
| v8::HandleScope scope(m_isolate);
|
| - v8::PersistentValueVector<v8::DebugInterface::Script> scripts(m_isolate);
|
| - v8::DebugInterface::GetLoadedScripts(m_isolate, scripts);
|
| + v8::PersistentValueVector<v8::debug::Script> scripts(m_isolate);
|
| + v8::debug::DebugInterface::GetLoadedScripts(m_isolate, scripts);
|
| String16 contextPrefix = String16::fromInteger(contextGroupId) + ",";
|
| for (size_t i = 0; i < scripts.Size(); ++i) {
|
| - v8::Local<v8::DebugInterface::Script> script = scripts.Get(i);
|
| + v8::Local<v8::debug::Script> script = scripts.Get(i);
|
| if (!script->WasCompiled()) continue;
|
| v8::Local<v8::String> v8ContextData;
|
| if (!script->ContextData().ToLocal(&v8ContextData)) continue;
|
| @@ -167,7 +167,8 @@ String16 V8Debugger::setBreakpoint(const ScriptBreakpoint& breakpoint,
|
| ->Get(context, toV8StringInternalized(m_isolate, "setBreakpoint"))
|
| .ToLocalChecked());
|
| v8::Local<v8::Value> breakpointId =
|
| - v8::DebugInterface::Call(debuggerContext(), setBreakpointFunction, info)
|
| + v8::debug::DebugInterface::Call(debuggerContext(), setBreakpointFunction,
|
| + info)
|
| .ToLocalChecked();
|
| if (!breakpointId->IsString()) return "";
|
| *actualLineNumber =
|
| @@ -202,7 +203,8 @@ void V8Debugger::removeBreakpoint(const String16& breakpointId) {
|
| ->Get(context,
|
| toV8StringInternalized(m_isolate, "removeBreakpoint"))
|
| .ToLocalChecked());
|
| - v8::DebugInterface::Call(debuggerContext(), removeBreakpointFunction, info)
|
| + v8::debug::DebugInterface::Call(debuggerContext(), removeBreakpointFunction,
|
| + info)
|
| .ToLocalChecked();
|
| }
|
|
|
| @@ -215,7 +217,7 @@ void V8Debugger::clearBreakpoints() {
|
| m_debuggerScript.Get(m_isolate)
|
| ->Get(context, toV8StringInternalized(m_isolate, "clearBreakpoints"))
|
| .ToLocalChecked());
|
| - v8::DebugInterface::Call(debuggerContext(), clearBreakpoints)
|
| + v8::debug::DebugInterface::Call(debuggerContext(), clearBreakpoints)
|
| .ToLocalChecked();
|
| }
|
|
|
| @@ -240,32 +242,33 @@ void V8Debugger::setBreakpointsActivated(bool activated) {
|
| ->Get(context, toV8StringInternalized(m_isolate,
|
| "setBreakpointsActivated"))
|
| .ToLocalChecked());
|
| - v8::DebugInterface::Call(debuggerContext(), setBreakpointsActivated, info)
|
| + v8::debug::DebugInterface::Call(debuggerContext(), setBreakpointsActivated,
|
| + info)
|
| .ToLocalChecked();
|
|
|
| m_breakpointsActivated = activated;
|
| }
|
|
|
| -v8::DebugInterface::ExceptionBreakState
|
| -V8Debugger::getPauseOnExceptionsState() {
|
| +v8::debug::ExceptionBreakState V8Debugger::getPauseOnExceptionsState() {
|
| DCHECK(enabled());
|
| return m_pauseOnExceptionsState;
|
| }
|
|
|
| void V8Debugger::setPauseOnExceptionsState(
|
| - v8::DebugInterface::ExceptionBreakState pauseOnExceptionsState) {
|
| + v8::debug::ExceptionBreakState pauseOnExceptionsState) {
|
| DCHECK(enabled());
|
| if (m_pauseOnExceptionsState == pauseOnExceptionsState) return;
|
| - v8::DebugInterface::ChangeBreakOnException(m_isolate, pauseOnExceptionsState);
|
| + v8::debug::DebugInterface::ChangeBreakOnException(m_isolate,
|
| + pauseOnExceptionsState);
|
| m_pauseOnExceptionsState = pauseOnExceptionsState;
|
| }
|
|
|
| void V8Debugger::setPauseOnNextStatement(bool pause) {
|
| if (m_runningNestedMessageLoop) return;
|
| if (pause)
|
| - v8::DebugInterface::DebugBreak(m_isolate);
|
| + v8::debug::DebugInterface::DebugBreak(m_isolate);
|
| else
|
| - v8::DebugInterface::CancelDebugBreak(m_isolate);
|
| + v8::debug::DebugInterface::CancelDebugBreak(m_isolate);
|
| }
|
|
|
| bool V8Debugger::canBreakProgram() {
|
| @@ -293,7 +296,8 @@ void V8Debugger::breakProgram() {
|
| v8::ConstructorBehavior::kThrow)
|
| .ToLocal(&breakFunction))
|
| return;
|
| - v8::DebugInterface::Call(debuggerContext(), breakFunction).ToLocalChecked();
|
| + v8::debug::DebugInterface::Call(debuggerContext(), breakFunction)
|
| + .ToLocalChecked();
|
| }
|
|
|
| void V8Debugger::continueProgram() {
|
| @@ -305,27 +309,27 @@ void V8Debugger::continueProgram() {
|
| void V8Debugger::stepIntoStatement() {
|
| DCHECK(isPaused());
|
| DCHECK(!m_executionState.IsEmpty());
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepIn);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepIn);
|
| continueProgram();
|
| }
|
|
|
| void V8Debugger::stepOverStatement() {
|
| DCHECK(isPaused());
|
| DCHECK(!m_executionState.IsEmpty());
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepNext);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepNext);
|
| continueProgram();
|
| }
|
|
|
| void V8Debugger::stepOutOfFunction() {
|
| DCHECK(isPaused());
|
| DCHECK(!m_executionState.IsEmpty());
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepOut);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepOut);
|
| continueProgram();
|
| }
|
|
|
| void V8Debugger::clearStepping() {
|
| DCHECK(enabled());
|
| - v8::DebugInterface::ClearStepping(m_isolate);
|
| + v8::debug::DebugInterface::ClearStepping(m_isolate);
|
| }
|
|
|
| Response V8Debugger::setScriptSource(
|
| @@ -336,11 +340,11 @@ Response V8Debugger::setScriptSource(
|
| class EnableLiveEditScope {
|
| public:
|
| explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) {
|
| - v8::DebugInterface::SetLiveEditEnabled(m_isolate, true);
|
| + v8::debug::DebugInterface::SetLiveEditEnabled(m_isolate, true);
|
| inLiveEditScope = true;
|
| }
|
| ~EnableLiveEditScope() {
|
| - v8::DebugInterface::SetLiveEditEnabled(m_isolate, false);
|
| + v8::debug::DebugInterface::SetLiveEditEnabled(m_isolate, false);
|
| inLiveEditScope = false;
|
| }
|
|
|
| @@ -435,10 +439,10 @@ JavaScriptCallFrames V8Debugger::currentCallFrames(int limit) {
|
| ->Get(debuggerContext(),
|
| toV8StringInternalized(m_isolate, "currentCallFrames"))
|
| .ToLocalChecked());
|
| - currentCallFramesV8 =
|
| - v8::DebugInterface::Call(debuggerContext(), currentCallFramesFunction,
|
| - v8::Integer::New(m_isolate, limit))
|
| - .ToLocalChecked();
|
| + currentCallFramesV8 = v8::debug::DebugInterface::Call(
|
| + debuggerContext(), currentCallFramesFunction,
|
| + v8::Integer::New(m_isolate, limit))
|
| + .ToLocalChecked();
|
| } else {
|
| v8::Local<v8::Value> argv[] = {m_executionState,
|
| v8::Integer::New(m_isolate, limit)};
|
| @@ -524,16 +528,16 @@ void V8Debugger::handleProgramBreak(v8::Local<v8::Context> pausedContext,
|
| m_executionState.Clear();
|
|
|
| if (result == V8DebuggerAgentImpl::RequestStepFrame) {
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepFrame);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepFrame);
|
| } else if (result == V8DebuggerAgentImpl::RequestStepInto) {
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepIn);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepIn);
|
| } else if (result == V8DebuggerAgentImpl::RequestStepOut) {
|
| - v8::DebugInterface::PrepareStep(m_isolate, v8::DebugInterface::StepOut);
|
| + v8::debug::DebugInterface::PrepareStep(m_isolate, v8::debug::StepOut);
|
| }
|
| }
|
|
|
| void V8Debugger::v8DebugEventCallback(
|
| - const v8::DebugInterface::EventDetails& eventDetails) {
|
| + const v8::debug::EventDetails& eventDetails) {
|
| V8Debugger* thisPtr = toV8Debugger(eventDetails.GetCallbackData());
|
| thisPtr->handleV8DebugEvent(eventDetails);
|
| }
|
| @@ -554,7 +558,7 @@ v8::Local<v8::Value> V8Debugger::callInternalGetterFunction(
|
| }
|
|
|
| void V8Debugger::handleV8DebugEvent(
|
| - const v8::DebugInterface::EventDetails& eventDetails) {
|
| + const v8::debug::EventDetails& eventDetails) {
|
| if (!enabled()) return;
|
| v8::DebugEvent event = eventDetails.GetEvent();
|
| if (event != v8::AsyncTaskEvent && event != v8::Break &&
|
| @@ -586,9 +590,8 @@ void V8Debugger::handleV8DebugEvent(
|
| v8::Local<v8::Value> scriptWrapper =
|
| callInternalGetterFunction(scriptMirror.As<v8::Object>(), "value");
|
| DCHECK(scriptWrapper->IsObject());
|
| - v8::Local<v8::DebugInterface::Script> script;
|
| - if (!v8::DebugInterface::Script::Wrap(m_isolate,
|
| - scriptWrapper.As<v8::Object>())
|
| + v8::Local<v8::debug::Script> script;
|
| + if (!v8::debug::Script::Wrap(m_isolate, scriptWrapper.As<v8::Object>())
|
| .ToLocal(&script)) {
|
| return;
|
| }
|
| @@ -739,7 +742,7 @@ v8::MaybeLocal<v8::Value> V8Debugger::generatorScopes(
|
| v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(
|
| v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
|
| v8::Local<v8::Array> properties;
|
| - if (!v8::DebugInterface::GetInternalProperties(m_isolate, value)
|
| + if (!v8::debug::DebugInterface::GetInternalProperties(m_isolate, value)
|
| .ToLocal(&properties))
|
| return v8::MaybeLocal<v8::Array>();
|
| if (value->IsFunction()) {
|
|
|