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

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

Issue 1286343003: DevTools: make InspectorDebuggerAgent aggregate V8DebuggerAgent instead of inheriting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 5eb3316774132b1dede2482956235d80b654fef2..9c7d1746646ec9529bc0bdffc3efdf1ef104370e 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -30,10 +30,15 @@
#include "config.h"
#include "core/inspector/InspectorDebuggerAgent.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "core/inspector/ScriptAsyncCallStack.h"
+#include "core/inspector/v8/V8Debugger.h"
+
namespace blink {
InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedScriptManager, V8Debugger* debugger, int contextGroupId)
- : V8DebuggerAgent(injectedScriptManager, debugger, this, contextGroupId)
+ : InspectorBaseAgent<InspectorDebuggerAgent, InspectorFrontend::Debugger>("Debugger")
+ , m_debuggerAgent(adoptPtr(new V8DebuggerAgent(injectedScriptManager, debugger, this, contextGroupId)))
{
}
@@ -44,11 +49,193 @@ InspectorDebuggerAgent::~InspectorDebuggerAgent()
#endif
}
+// Protocol implementation.
void InspectorDebuggerAgent::enable(ErrorString* errorString)
{
- V8DebuggerAgent::enable(errorString);
+ m_debuggerAgent->enable(errorString);
+}
+
+void InspectorDebuggerAgent::disable(ErrorString* errorString)
+{
+ m_debuggerAgent->disable(errorString);
+}
+
+void InspectorDebuggerAgent::setBreakpointsActive(ErrorString* errorString, bool in_active)
+{
+ m_debuggerAgent->setBreakpointsActive(errorString, in_active);
+}
+
+void InspectorDebuggerAgent::setSkipAllPauses(ErrorString* errorString, bool in_skipped)
+{
+ m_debuggerAgent->setSkipAllPauses(errorString, in_skipped);
+}
+
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int in_lineNumber, const String* in_url, const String* in_urlRegex, const int* in_columnNumber, const String* in_condition, TypeBuilder::Debugger::BreakpointId* out_breakpointId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location>>& out_locations)
+{
+ m_debuggerAgent->setBreakpointByUrl(errorString, in_lineNumber, in_url, in_urlRegex, in_columnNumber, in_condition, out_breakpointId, out_locations);
+}
+
+void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<JSONObject>& in_location, const String* in_condition, TypeBuilder::Debugger::BreakpointId* out_breakpointId, RefPtr<TypeBuilder::Debugger::Location>& out_actualLocation)
+{
+ m_debuggerAgent->setBreakpoint(errorString, in_location, in_condition, out_breakpointId, out_actualLocation);
+}
+
+void InspectorDebuggerAgent::removeBreakpoint(ErrorString* errorString, const String& in_breakpointId)
+{
+ m_debuggerAgent->removeBreakpoint(errorString, in_breakpointId);
+}
+
+void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const RefPtr<JSONObject>& in_location, const bool* in_interstatementLocation)
+{
+ m_debuggerAgent->continueToLocation(errorString, in_location, in_interstatementLocation);
+}
+
+void InspectorDebuggerAgent::stepOver(ErrorString* errorString)
+{
+ m_debuggerAgent->stepOver(errorString);
+}
+
+void InspectorDebuggerAgent::stepInto(ErrorString* errorString)
+{
+ m_debuggerAgent->stepInto(errorString);
+}
+
+void InspectorDebuggerAgent::stepOut(ErrorString* errorString)
+{
+ m_debuggerAgent->stepOut(errorString);
+}
+
+void InspectorDebuggerAgent::pause(ErrorString* errorString)
+{
+ m_debuggerAgent->pause(errorString);
+}
+
+void InspectorDebuggerAgent::resume(ErrorString* errorString)
+{
+ m_debuggerAgent->resume(errorString);
+}
+
+void InspectorDebuggerAgent::stepIntoAsync(ErrorString* errorString)
+{
+ m_debuggerAgent->stepIntoAsync(errorString);
+}
+
+void InspectorDebuggerAgent::searchInContent(ErrorString* errorString, const String& in_scriptId, const String& in_query, const bool* in_caseSensitive, const bool* in_isRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::SearchMatch>>& out_result)
+{
+ m_debuggerAgent->searchInContent(errorString, in_scriptId, in_query, in_caseSensitive, in_isRegex, out_result);
+}
+
+void InspectorDebuggerAgent::canSetScriptSource(ErrorString* errorString, bool* out_result)
+{
+ m_debuggerAgent->canSetScriptSource(errorString, out_result);
+}
+
+void InspectorDebuggerAgent::setScriptSource(ErrorString* errorString, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>& errorData, const String& in_scriptId, const String& in_scriptSource, const bool* in_preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& opt_out_callFrames, TypeBuilder::OptOutput<bool>* opt_out_stackChanged, RefPtr<TypeBuilder::Debugger::StackTrace>& opt_out_asyncStackTrace)
+{
+ m_debuggerAgent->setScriptSource(errorString, errorData, in_scriptId, in_scriptSource, in_preview, opt_out_callFrames, opt_out_stackChanged, opt_out_asyncStackTrace);
+}
+
+void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& in_callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& out_callFrames, RefPtr<TypeBuilder::Debugger::StackTrace>& opt_out_asyncStackTrace)
+{
+ m_debuggerAgent->restartFrame(errorString, in_callFrameId, out_callFrames, opt_out_asyncStackTrace);
+}
+
+void InspectorDebuggerAgent::getScriptSource(ErrorString* errorString, const String& in_scriptId, String* out_scriptSource)
+{
+ m_debuggerAgent->getScriptSource(errorString, in_scriptId, out_scriptSource);
+}
+
+void InspectorDebuggerAgent::getFunctionDetails(ErrorString* errorString, const String& in_functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>& out_details)
+{
+ m_debuggerAgent->getFunctionDetails(errorString, in_functionId, out_details);
+}
+
+void InspectorDebuggerAgent::getGeneratorObjectDetails(ErrorString* errorString, const String& in_objectId, RefPtr<TypeBuilder::Debugger::GeneratorObjectDetails>& out_details)
+{
+ m_debuggerAgent->getGeneratorObjectDetails(errorString, in_objectId, out_details);
+}
+
+void InspectorDebuggerAgent::getCollectionEntries(ErrorString* errorString, const String& in_objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CollectionEntry>>& out_entries)
+{
+ m_debuggerAgent->getCollectionEntries(errorString, in_objectId, out_entries);
+}
+
+void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, const String& in_state)
+{
+ m_debuggerAgent->setPauseOnExceptions(errorString, in_state);
+}
+
+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& in_callFrameId, const String& in_expression, const String* in_objectGroup, const bool* in_includeCommandLineAPI, const bool* in_doNotPauseOnExceptionsAndMuteConsole, const bool* in_returnByValue, const bool* in_generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& out_result, TypeBuilder::OptOutput<bool>* opt_out_wasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& opt_out_exceptionDetails)
+{
+ m_debuggerAgent->evaluateOnCallFrame(errorString, in_callFrameId, in_expression, in_objectGroup, in_includeCommandLineAPI, in_doNotPauseOnExceptionsAndMuteConsole, in_returnByValue, in_generatePreview, out_result, opt_out_wasThrown, opt_out_exceptionDetails);
+}
+
+void InspectorDebuggerAgent::compileScript(ErrorString* errorString, const String& in_expression, const String& in_sourceURL, bool in_persistScript, const int* in_executionContextId, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>* opt_out_scriptId, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& opt_out_exceptionDetails)
+{
+ m_debuggerAgent->compileScript(errorString, in_expression, in_sourceURL, in_persistScript, in_executionContextId, opt_out_scriptId, opt_out_exceptionDetails);
+}
+
+void InspectorDebuggerAgent::runScript(ErrorString* errorString, const String& in_scriptId, const int* in_executionContextId, const String* in_objectGroup, const bool* in_doNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& out_result, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& opt_out_exceptionDetails)
+{
+ m_debuggerAgent->runScript(errorString, in_scriptId, in_executionContextId, in_objectGroup, in_doNotPauseOnExceptionsAndMuteConsole, out_result, opt_out_exceptionDetails);
}
+void InspectorDebuggerAgent::setVariableValue(ErrorString* errorString, int in_scopeNumber, const String& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callFrameId, const String* in_functionObjectId)
+{
+ m_debuggerAgent->setVariableValue(errorString, in_scopeNumber, in_variableName, in_newValue, in_callFrameId, in_functionObjectId);
+}
+
+void InspectorDebuggerAgent::getStepInPositions(ErrorString* errorString, const String& in_callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location>>& opt_out_stepInPositions)
+{
+ m_debuggerAgent->getStepInPositions(errorString, in_callFrameId, opt_out_stepInPositions);
+}
+
+void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& out_callFrames, RefPtr<TypeBuilder::Debugger::StackTrace>& opt_out_asyncStackTrace)
+{
+ m_debuggerAgent->getBacktrace(errorString, out_callFrames, opt_out_asyncStackTrace);
+}
+
+void InspectorDebuggerAgent::skipStackFrames(ErrorString* errorString, const String* in_script, const bool* in_skipContentScripts)
+{
+ m_debuggerAgent->skipStackFrames(errorString, in_script, in_skipContentScripts);
+}
+
+void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString* errorString, int in_maxDepth)
+{
+ m_debuggerAgent->setAsyncCallStackDepth(errorString, in_maxDepth);
+}
+
+void InspectorDebuggerAgent::enablePromiseTracker(ErrorString* errorString, const bool* in_captureStacks)
+{
+ m_debuggerAgent->enablePromiseTracker(errorString, in_captureStacks);
+}
+
+void InspectorDebuggerAgent::disablePromiseTracker(ErrorString* errorString)
+{
+ m_debuggerAgent->disablePromiseTracker(errorString);
+}
+
+void InspectorDebuggerAgent::getPromiseById(ErrorString* errorString, int in_promiseId, const String* in_objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& out_promise)
+{
+ m_debuggerAgent->getPromiseById(errorString, in_promiseId, in_objectGroup, out_promise);
+}
+
+void InspectorDebuggerAgent::flushAsyncOperationEvents(ErrorString* errorString)
+{
+ m_debuggerAgent->flushAsyncOperationEvents(errorString);
+}
+
+void InspectorDebuggerAgent::setAsyncOperationBreakpoint(ErrorString* errorString, int in_operationId)
+{
+ m_debuggerAgent->setAsyncOperationBreakpoint(errorString, in_operationId);
+}
+
+void InspectorDebuggerAgent::removeAsyncOperationBreakpoint(ErrorString* errorString, int in_operationId)
+{
+ m_debuggerAgent->removeAsyncOperationBreakpoint(errorString, in_operationId);
+}
+
+// V8DebuggerAgent::Client implementation.
void InspectorDebuggerAgent::debuggerAgentEnabled()
{
m_instrumentingAgents->setInspectorDebuggerAgent(this);
@@ -59,4 +246,79 @@ void InspectorDebuggerAgent::debuggerAgentDisabled()
m_instrumentingAgents->setInspectorDebuggerAgent(nullptr);
}
+bool InspectorDebuggerAgent::isPaused()
+{
+ return m_debuggerAgent->isPaused();
+}
+
+PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyncStackTraceForConsole()
+{
+ return m_debuggerAgent->currentAsyncStackTraceForConsole();
+}
+
+void InspectorDebuggerAgent::didFireTimer()
+{
+ m_debuggerAgent->cancelPauseOnNextStatement();
+}
+
+void InspectorDebuggerAgent::didHandleEvent()
+{
+ m_debuggerAgent->cancelPauseOnNextStatement();
+}
+
+void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
+{
+ if (m_debuggerAgent->debugger().pauseOnExceptionsState() == V8Debugger::DontPauseOnExceptions)
+ return;
+ RefPtr<JSONObject> directive = JSONObject::create();
+ directive->setString("directiveText", directiveText);
+ m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::CSPViolation, directive.release());
+}
+
+void InspectorDebuggerAgent::willCallFunction(const DevToolsFunctionInfo& info)
+{
+ m_debuggerAgent->willCallFunction(info.scriptId());
+}
+
+void InspectorDebuggerAgent::didCallFunction()
+{
+ m_debuggerAgent->didCallFunction();
+}
+
+void InspectorDebuggerAgent::willEvaluateScript()
+{
+ m_debuggerAgent->willEvaluateScript();
+}
+
+void InspectorDebuggerAgent::didEvaluateScript()
+{
+ m_debuggerAgent->didEvaluateScript();
+}
+
+bool InspectorDebuggerAgent::getEditedScript(const String& url, String* content)
+{
+ return m_debuggerAgent->getEditedScript(url, content);
+}
+
+// InspectorBaseAgent overrides.
+void InspectorDebuggerAgent::init()
+{
+ m_debuggerAgent->setInspectorState(m_state);
+}
+
+void InspectorDebuggerAgent::setFrontend(InspectorFrontend* frontend)
+{
+ m_debuggerAgent->setFrontend(InspectorFrontend::Debugger::from(frontend));
+}
+
+void InspectorDebuggerAgent::clearFrontend()
+{
+ m_debuggerAgent->clearFrontend();
+}
+
+void InspectorDebuggerAgent::restore()
+{
+ m_debuggerAgent->restore();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698