Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1046)

Unified Diff: Source/core/inspector/V8Debugger.cpp

Issue 1214863013: [DevTools] Remove ScriptDebugListener from V8Debugger. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/V8Debugger.h ('k') | Source/core/inspector/WorkerThreadDebugger.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/V8Debugger.cpp
diff --git a/Source/core/inspector/V8Debugger.cpp b/Source/core/inspector/V8Debugger.cpp
index 40e884d6a13094fc383abe687c2a1d7e810a68c0..cb36c150ba964fb46bc1cdd4f7f47cd9831ba7be 100644
--- a/Source/core/inspector/V8Debugger.cpp
+++ b/Source/core/inspector/V8Debugger.cpp
@@ -36,7 +36,6 @@
#include "bindings/core/v8/V8ScriptRunner.h"
#include "bindings/core/v8/inspector/V8JavaScriptCallFrame.h"
#include "core/inspector/JavaScriptCallFrame.h"
-#include "core/inspector/ScriptDebugListener.h"
#include "platform/JSONValues.h"
#include "wtf/StdLibExtras.h"
#include "wtf/Vector.h"
@@ -580,10 +579,6 @@ void V8Debugger::handleProgramBreak(ScriptState* pausedScriptState, v8::Local<v8
if (m_runningNestedMessageLoop)
return;
- ScriptDebugListener* listener = m_client->getDebugListenerForContext(pausedScriptState->context());
- if (!listener)
- return;
-
Vector<String> breakpointIds;
if (!hitBreakpointNumbers.IsEmpty()) {
breakpointIds.resize(hitBreakpointNumbers->Length());
@@ -596,7 +591,7 @@ void V8Debugger::handleProgramBreak(ScriptState* pausedScriptState, v8::Local<v8
m_pausedScriptState = pausedScriptState;
m_executionState = executionState;
- SkipPauseRequest result = listener->didPause(pausedScriptState, currentCallFrames(), ScriptValue(pausedScriptState, exception), breakpointIds, isPromiseRejection);
+ SkipPauseRequest result = m_client->didPause(pausedScriptState, currentCallFrames(), ScriptValue(pausedScriptState, exception), breakpointIds, isPromiseRejection);
if (result == NoSkip) {
m_runningNestedMessageLoop = true;
m_client->runMessageLoopOnPause(pausedScriptState->context());
@@ -641,38 +636,35 @@ void V8Debugger::handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails)
v8::Local<v8::Context> eventContext = eventDetails.GetEventContext();
ASSERT(!eventContext.IsEmpty());
- ScriptDebugListener* listener = m_client->getDebugListenerForContext(eventContext);
- if (listener) {
- v8::HandleScope scope(m_isolate);
- if (event == v8::AfterCompile || event == v8::CompileError) {
- v8::Context::Scope contextScope(debuggerContext());
- v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
- v8::Local<v8::Value> value = callDebuggerMethod("getAfterCompileScript", 1, argv).ToLocalChecked();
- ASSERT(value->IsObject());
- v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
- listener->didParseSource(createParsedScript(object, event != v8::AfterCompile ? CompileError : CompileSuccess));
- } else if (event == v8::Exception) {
- v8::Local<v8::Object> eventData = eventDetails.GetEventData();
- v8::Local<v8::Value> exception = callInternalGetterFunction(eventData, "exception");
- v8::Local<v8::Value> promise = callInternalGetterFunction(eventData, "promise");
- bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject();
- handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), exception, v8::Local<v8::Array>(), isPromiseRejection);
- } else if (event == v8::Break) {
- v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
- v8::Local<v8::Value> hitBreakpoints = callDebuggerMethod("getBreakpointNumbers", 1, argv).ToLocalChecked();
- ASSERT(hitBreakpoints->IsArray());
- handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), v8::Local<v8::Value>(), hitBreakpoints.As<v8::Array>());
- } else if (event == v8::AsyncTaskEvent) {
- if (listener->v8AsyncTaskEventsEnabled())
- handleV8AsyncTaskEvent(listener, ScriptState::from(eventContext), eventDetails.GetExecutionState(), eventDetails.GetEventData());
- } else if (event == v8::PromiseEvent) {
- if (listener->v8PromiseEventsEnabled())
- handleV8PromiseEvent(listener, ScriptState::from(eventContext), eventDetails.GetExecutionState(), eventDetails.GetEventData());
- }
+ v8::HandleScope scope(m_isolate);
+ if (event == v8::AfterCompile || event == v8::CompileError) {
+ v8::Context::Scope contextScope(debuggerContext());
+ v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
+ v8::Local<v8::Value> value = callDebuggerMethod("getAfterCompileScript", 1, argv).ToLocalChecked();
+ ASSERT(value->IsObject());
+ v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
+ m_client->didParseSource(eventContext, createParsedScript(object, event != v8::AfterCompile ? CompileError : CompileSuccess));
+ } else if (event == v8::Exception) {
+ v8::Local<v8::Object> eventData = eventDetails.GetEventData();
+ v8::Local<v8::Value> exception = callInternalGetterFunction(eventData, "exception");
+ v8::Local<v8::Value> promise = callInternalGetterFunction(eventData, "promise");
+ bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject();
+ handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), exception, v8::Local<v8::Array>(), isPromiseRejection);
+ } else if (event == v8::Break) {
+ v8::Local<v8::Value> argv[] = { eventDetails.GetEventData() };
+ v8::Local<v8::Value> hitBreakpoints = callDebuggerMethod("getBreakpointNumbers", 1, argv).ToLocalChecked();
+ ASSERT(hitBreakpoints->IsArray());
+ handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), v8::Local<v8::Value>(), hitBreakpoints.As<v8::Array>());
+ } else if (event == v8::AsyncTaskEvent) {
+ if (m_client->v8AsyncTaskEventsEnabled(ScriptState::from(eventContext)))
+ handleV8AsyncTaskEvent(ScriptState::from(eventContext), eventDetails.GetExecutionState(), eventDetails.GetEventData());
+ } else if (event == v8::PromiseEvent) {
+ if (m_client->v8PromiseEventsEnabled(ScriptState::from(eventContext)))
+ handleV8PromiseEvent(ScriptState::from(eventContext), eventDetails.GetExecutionState(), eventDetails.GetEventData());
}
}
-void V8Debugger::handleV8AsyncTaskEvent(ScriptDebugListener* listener, ScriptState* pausedScriptState, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
+void V8Debugger::handleV8AsyncTaskEvent(ScriptState* pausedScriptState, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
{
String type = toCoreStringWithUndefinedOrNullCheck(callInternalGetterFunction(eventData, "type"));
String name = toCoreStringWithUndefinedOrNullCheck(callInternalGetterFunction(eventData, "name"));
@@ -680,12 +672,12 @@ void V8Debugger::handleV8AsyncTaskEvent(ScriptDebugListener* listener, ScriptSta
m_pausedScriptState = pausedScriptState;
m_executionState = executionState;
- listener->didReceiveV8AsyncTaskEvent(pausedScriptState, type, name, id);
+ m_client->didReceiveV8AsyncTaskEvent(pausedScriptState, type, name, id);
m_pausedScriptState.clear();
m_executionState.Clear();
}
-void V8Debugger::handleV8PromiseEvent(ScriptDebugListener* listener, ScriptState* pausedScriptState, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
+void V8Debugger::handleV8PromiseEvent(ScriptState* pausedScriptState, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData)
{
v8::Local<v8::Value> argv[] = { eventData };
v8::Local<v8::Value> value = callDebuggerMethod("getPromiseDetails", 1, argv).ToLocalChecked();
@@ -697,7 +689,7 @@ void V8Debugger::handleV8PromiseEvent(ScriptDebugListener* listener, ScriptState
m_pausedScriptState = pausedScriptState;
m_executionState = executionState;
- listener->didReceiveV8PromiseEvent(pausedScriptState, promise, parentPromise, status);
+ m_client->didReceiveV8PromiseEvent(pausedScriptState, promise, parentPromise, status);
m_pausedScriptState.clear();
m_executionState.Clear();
}
« no previous file with comments | « Source/core/inspector/V8Debugger.h ('k') | Source/core/inspector/WorkerThreadDebugger.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698