Commit e6bd3063 authored by clemensh's avatar clemensh Committed by Commit bot

[debug] Remove DebugInterface class

It only contained type definitions and static functions, so we
can also just make it a namespace.

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

Review-Url: https://codereview.chromium.org/2549133002
Cr-Commit-Position: refs/heads/master@{#41501}
parent 6a8dccb1
This diff is collapsed.
......@@ -110,7 +110,7 @@ class RegisteredExtension {
V(StackFrame, JSObject) \
V(Proxy, JSProxy) \
V(NativeWeakMap, JSWeakMap) \
V(DebugInterface::Script, Script)
V(debug::Script, Script)
class Utils {
public:
......
This diff is collapsed.
......@@ -1836,9 +1836,8 @@ void Debug::CallEventCallback(v8::DebugEvent event,
in_debug_event_listener_ = true;
if (event_listener_->IsForeign()) {
// Invoke the C debug event listener.
v8::DebugInterface::EventCallback callback =
FUNCTION_CAST<v8::DebugInterface::EventCallback>(
Handle<Foreign>::cast(event_listener_)->foreign_address());
debug::EventCallback callback = FUNCTION_CAST<debug::EventCallback>(
Handle<Foreign>::cast(event_listener_)->foreign_address());
EventDetailsImpl event_details(event,
Handle<JSObject>::cast(exec_state),
Handle<JSObject>::cast(event_data),
......
......@@ -283,7 +283,7 @@ class MessageImpl : public v8::Debug::Message {
};
// Details of the debug event delivered to the debug event listener.
class EventDetailsImpl : public v8::DebugInterface::EventDetails {
class EventDetailsImpl : public debug::EventDetails {
public:
EventDetailsImpl(DebugEvent event,
Handle<JSObject> exec_state,
......
......@@ -419,7 +419,7 @@ InjectedScript::Scope::Scope(V8InspectorImpl* inspector, int contextGroupId)
m_handleScope(inspector->isolate()),
m_tryCatch(inspector->isolate()),
m_ignoreExceptionsAndMuteConsole(false),
m_previousPauseOnExceptionsState(v8::DebugInterface::NoBreakOnException),
m_previousPauseOnExceptionsState(v8::debug::NoBreakOnException),
m_userGesture(false) {}
Response InjectedScript::Scope::initialize() {
......@@ -449,14 +449,13 @@ void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() {
m_inspector->client()->muteMetrics(m_contextGroupId);
m_inspector->muteExceptions(m_contextGroupId);
m_previousPauseOnExceptionsState =
setPauseOnExceptionsState(v8::DebugInterface::NoBreakOnException);
setPauseOnExceptionsState(v8::debug::NoBreakOnException);
}
v8::DebugInterface::ExceptionBreakState
InjectedScript::Scope::setPauseOnExceptionsState(
v8::DebugInterface::ExceptionBreakState newState) {
v8::debug::ExceptionBreakState InjectedScript::Scope::setPauseOnExceptionsState(
v8::debug::ExceptionBreakState newState) {
if (!m_inspector->debugger()->enabled()) return newState;
v8::DebugInterface::ExceptionBreakState presentState =
v8::debug::ExceptionBreakState presentState =
m_inspector->debugger()->getPauseOnExceptionsState();
if (presentState != newState)
m_inspector->debugger()->setPauseOnExceptionsState(newState);
......
......@@ -120,15 +120,15 @@ class InjectedScript final {
private:
void cleanup();
v8::DebugInterface::ExceptionBreakState setPauseOnExceptionsState(
v8::DebugInterface::ExceptionBreakState);
v8::debug::ExceptionBreakState setPauseOnExceptionsState(
v8::debug::ExceptionBreakState);
v8::HandleScope m_handleScope;
v8::TryCatch m_tryCatch;
v8::Local<v8::Context> m_context;
std::unique_ptr<V8Console::CommandLineAPIScope> m_commandLineAPIScope;
bool m_ignoreExceptionsAndMuteConsole;
v8::DebugInterface::ExceptionBreakState m_previousPauseOnExceptionsState;
v8::debug::ExceptionBreakState m_previousPauseOnExceptionsState;
bool m_userGesture;
};
......
......@@ -129,10 +129,10 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::restart() {
v8::Local<v8::Function> restartFunction = v8::Local<v8::Function>::Cast(
callFrame->Get(context, toV8StringInternalized(m_isolate, "restart"))
.ToLocalChecked());
v8::DebugInterface::SetLiveEditEnabled(m_isolate, true);
v8::debug::SetLiveEditEnabled(m_isolate, true);
v8::MaybeLocal<v8::Value> result = restartFunction->Call(
m_debuggerContext.Get(m_isolate), callFrame, 0, nullptr);
v8::DebugInterface::SetLiveEditEnabled(m_isolate, false);
v8::debug::SetLiveEditEnabled(m_isolate, false);
return result;
}
......
......@@ -183,7 +183,7 @@ Response V8DebuggerAgentImpl::disable() {
m_state->setObject(DebuggerAgentState::javaScriptBreakpoints,
protocol::DictionaryValue::create());
m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState,
v8::DebugInterface::NoBreakOnException);
v8::debug::NoBreakOnException);
m_state->setInteger(DebuggerAgentState::asyncCallStackDepth, 0);
if (!m_pausedContext.IsEmpty()) m_debugger->continueProgram();
......@@ -221,7 +221,7 @@ void V8DebuggerAgentImpl::restore() {
enableImpl();
int pauseState = v8::DebugInterface::NoBreakOnException;
int pauseState = v8::debug::NoBreakOnException;
m_state->getInteger(DebuggerAgentState::pauseOnExceptionsState, &pauseState);
setPauseOnExceptionsImpl(pauseState);
......@@ -726,13 +726,13 @@ Response V8DebuggerAgentImpl::stepOut() {
Response V8DebuggerAgentImpl::setPauseOnExceptions(
const String16& stringPauseState) {
if (!enabled()) return Response::Error(kDebuggerNotEnabled);
v8::DebugInterface::ExceptionBreakState pauseState;
v8::debug::ExceptionBreakState pauseState;
if (stringPauseState == "none") {
pauseState = v8::DebugInterface::NoBreakOnException;
pauseState = v8::debug::NoBreakOnException;
} else if (stringPauseState == "all") {
pauseState = v8::DebugInterface::BreakOnAnyException;
pauseState = v8::debug::BreakOnAnyException;
} else if (stringPauseState == "uncaught") {
pauseState = v8::DebugInterface::BreakOnUncaughtException;
pauseState = v8::debug::BreakOnUncaughtException;
} else {
return Response::Error("Unknown pause on exceptions mode: " +
stringPauseState);
......@@ -743,7 +743,7 @@ Response V8DebuggerAgentImpl::setPauseOnExceptions(
void V8DebuggerAgentImpl::setPauseOnExceptionsImpl(int pauseState) {
m_debugger->setPauseOnExceptionsState(
static_cast<v8::DebugInterface::ExceptionBreakState>(pauseState));
static_cast<v8::debug::ExceptionBreakState>(pauseState));
m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState, pauseState);
}
......@@ -937,7 +937,7 @@ Response V8DebuggerAgentImpl::currentCallFrames(
}
v8::HandleScope handles(m_isolate);
v8::Local<v8::Context> debuggerContext =
v8::DebugInterface::GetDebugContext(m_isolate);
v8::debug::GetDebugContext(m_isolate);
v8::Context::Scope contextScope(debuggerContext);
v8::Local<v8::Array> objects = v8::Array::New(m_isolate);
......@@ -1236,8 +1236,7 @@ void V8DebuggerAgentImpl::breakProgramOnException(
const String16& breakReason,
std::unique_ptr<protocol::DictionaryValue> data) {
if (!enabled() ||
m_debugger->getPauseOnExceptionsState() ==
v8::DebugInterface::NoBreakOnException)
m_debugger->getPauseOnExceptionsState() == v8::debug::NoBreakOnException)
return;
breakProgram(breakReason, std::move(data));
}
......
......@@ -67,7 +67,7 @@ static String16 calculateHash(const String16& str) {
}
V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate,
v8::Local<v8::DebugInterface::Script> script,
v8::Local<v8::debug::Script> script,
bool isLiveEdit) {
m_isolate = script->GetIsolate();
m_id = String16::fromInteger(script->Id());
......@@ -176,7 +176,7 @@ bool V8DebuggerScript::getPossibleBreakpoints(
const v8::debug::Location& start, const v8::debug::Location& end,
std::vector<v8::debug::Location>* locations) {
v8::HandleScope scope(m_isolate);
v8::Local<v8::DebugInterface::Script> script = m_script.Get(m_isolate);
v8::Local<v8::debug::Script> script = m_script.Get(m_isolate);
return script->GetPossibleBreakpoints(start, end, locations);
}
......
......@@ -40,8 +40,7 @@ namespace v8_inspector {
class V8DebuggerScript {
public:
V8DebuggerScript(v8::Isolate* isolate,
v8::Local<v8::DebugInterface::Script> script,
V8DebuggerScript(v8::Isolate* isolate, v8::Local<v8::debug::Script> script,
bool isLiveEdit);
V8DebuggerScript(String16 id, String16 url, String16 source);
~V8DebuggerScript();
......@@ -88,7 +87,7 @@ class V8DebuggerScript {
bool m_isLiveEdit = false;
v8::Isolate* m_isolate;
v8::Global<v8::DebugInterface::Script> m_script;
v8::Global<v8::debug::Script> m_script;
DISALLOW_COPY_AND_ASSIGN(V8DebuggerScript);
};
......
This diff is collapsed.
......@@ -43,8 +43,8 @@ class V8Debugger {
void setBreakpointsActivated(bool);
bool breakpointsActivated() const { return m_breakpointsActivated; }
v8::DebugInterface::ExceptionBreakState getPauseOnExceptionsState();
void setPauseOnExceptionsState(v8::DebugInterface::ExceptionBreakState);
v8::debug::ExceptionBreakState getPauseOnExceptionsState();
void setPauseOnExceptionsState(v8::debug::ExceptionBreakState);
void setPauseOnNextStatement(bool);
bool canBreakProgram();
void breakProgram();
......@@ -112,10 +112,10 @@ class V8Debugger {
v8::Local<v8::Array> hitBreakpoints,
bool isPromiseRejection = false,
bool isUncaught = false);
static void v8DebugEventCallback(const v8::DebugInterface::EventDetails&);
static void v8DebugEventCallback(const v8::debug::EventDetails&);
v8::Local<v8::Value> callInternalGetterFunction(v8::Local<v8::Object>,
const char* functionName);
void handleV8DebugEvent(const v8::DebugInterface::EventDetails&);
void handleV8DebugEvent(const v8::debug::EventDetails&);
void handleV8AsyncTaskEvent(v8::Local<v8::Context>,
v8::Local<v8::Object> executionState,
v8::Local<v8::Object> eventData);
......@@ -161,7 +161,7 @@ class V8Debugger {
std::vector<std::unique_ptr<V8StackTraceImpl>> m_currentStacks;
protocol::HashMap<V8DebuggerAgentImpl*, int> m_maxAsyncCallStackDepthMap;
v8::DebugInterface::ExceptionBreakState m_pauseOnExceptionsState;
v8::debug::ExceptionBreakState m_pauseOnExceptionsState;
WasmTranslation m_wasmTranslation;
......
......@@ -128,7 +128,7 @@ v8::MaybeLocal<v8::Value> V8InspectorImpl::callFunction(
v8::MaybeLocal<v8::Value> V8InspectorImpl::compileAndRunInternalScript(
v8::Local<v8::Context> context, v8::Local<v8::String> source) {
v8::Local<v8::UnboundScript> unboundScript;
if (!v8::DebugInterface::CompileInspectorScript(m_isolate, source)
if (!v8::debug::CompileInspectorScript(m_isolate, source)
.ToLocal(&unboundScript))
return v8::MaybeLocal<v8::Value>();
v8::MicrotasksScope microtasksScope(m_isolate,
......
......@@ -171,9 +171,8 @@ class WasmTranslation::TranslatorImpl::DisassemblingTranslator
if (it != offset_tables_.end()) return it->second;
v8::Isolate *isolate = loc->translation->isolate_;
debug::WasmDisassembly disassembly_result =
DebugInterface::DisassembleWasmFunction(isolate, script_.Get(isolate),
func_index);
debug::WasmDisassembly disassembly_result = debug::DisassembleWasmFunction(
isolate, script_.Get(isolate), func_index);
it = offset_tables_
.insert(std::make_pair(func_index,
......
......@@ -312,8 +312,8 @@ static void ChangeBreakOnExceptionFromJS(v8::Isolate* isolate, bool caught,
// Change break on exception using the native API call.
static void ChangeBreakOnExceptionFromAPI(
v8::Isolate* isolate, v8::DebugInterface::ExceptionBreakState state) {
v8::DebugInterface::ChangeBreakOnException(isolate, state);
v8::Isolate* isolate, v8::debug::ExceptionBreakState state) {
v8::debug::ChangeBreakOnException(isolate, state);
}
// Prepare to step to next break location.
......@@ -3818,7 +3818,7 @@ TEST(BreakOnException) {
DebugEventCounterClear();
MessageCallbackCountClear();
ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
v8::DebugInterface::NoBreakOnException);
v8::debug::NoBreakOnException);
caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
DebugEventCounterCheck(0, 0, 0);
CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
......@@ -3832,7 +3832,7 @@ TEST(BreakOnException) {
DebugEventCounterClear();
MessageCallbackCountClear();
ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
v8::DebugInterface::BreakOnUncaughtException);
v8::debug::BreakOnUncaughtException);
caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
DebugEventCounterCheck(0, 0, 0);
CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
......@@ -3846,7 +3846,7 @@ TEST(BreakOnException) {
DebugEventCounterClear();
MessageCallbackCountClear();
ChangeBreakOnExceptionFromAPI(env->GetIsolate(),
v8::DebugInterface::BreakOnAnyException);
v8::debug::BreakOnAnyException);
caught->Call(context, env->Global(), 0, NULL).ToLocalChecked();
DebugEventCounterCheck(1, 0, 0);
CHECK(notCaught->Call(context, env->Global(), 0, NULL).IsEmpty());
......
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