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

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: Fixed presubmit errors 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
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 5eb3316774132b1dede2482956235d80b654fef2..3f13ad496c14e04b715142a122491c08a9cfabbd 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);
dgozman 2015/08/15 01:05:56 Looks strange to have |m_debuggerAgent| in Debugge
yurys 2015/08/17 17:15:06 Done.
+}
+
+void InspectorDebuggerAgent::disable(ErrorString* errorString)
+{
+ m_debuggerAgent->disable(errorString);
+}
+
+void InspectorDebuggerAgent::setBreakpointsActive(ErrorString* errorString, bool inActive)
+{
+ m_debuggerAgent->setBreakpointsActive(errorString, inActive);
+}
+
+void InspectorDebuggerAgent::setSkipAllPauses(ErrorString* errorString, bool inSkipped)
+{
+ m_debuggerAgent->setSkipAllPauses(errorString, inSkipped);
+}
+
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int inLineNumber, const String* inUrl, const String* inUrlRegex, const int* inColumnNumber, const String* inCondition, TypeBuilder::Debugger::BreakpointId* outBreakpointId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location>>& outLocations)
+{
+ m_debuggerAgent->setBreakpointByUrl(errorString, inLineNumber, inUrl, inUrlRegex, inColumnNumber, inCondition, outBreakpointId, outLocations);
+}
+
+void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<JSONObject>& inLocation, const String* inCondition, TypeBuilder::Debugger::BreakpointId* outBreakpointId, RefPtr<TypeBuilder::Debugger::Location>& outActualLocation)
+{
+ m_debuggerAgent->setBreakpoint(errorString, inLocation, inCondition, outBreakpointId, outActualLocation);
+}
+
+void InspectorDebuggerAgent::removeBreakpoint(ErrorString* errorString, const String& inBreakpointId)
+{
+ m_debuggerAgent->removeBreakpoint(errorString, inBreakpointId);
+}
+
+void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const RefPtr<JSONObject>& inLocation, const bool* inInterstatementLocation)
+{
+ m_debuggerAgent->continueToLocation(errorString, inLocation, inInterstatementLocation);
+}
+
+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& inScriptId, const String& inQuery, const bool* inCaseSensitive, const bool* inIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::SearchMatch>>& outResult)
+{
+ m_debuggerAgent->searchInContent(errorString, inScriptId, inQuery, inCaseSensitive, inIsRegex, outResult);
+}
+
+void InspectorDebuggerAgent::canSetScriptSource(ErrorString* errorString, bool* outResult)
+{
+ m_debuggerAgent->canSetScriptSource(errorString, outResult);
+}
+
+void InspectorDebuggerAgent::setScriptSource(ErrorString* errorString, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>& errorData, const String& inScriptId, const String& inScriptSource, const bool* inPreview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& optOutCallFrames, TypeBuilder::OptOutput<bool>* optOutStackChanged, RefPtr<TypeBuilder::Debugger::StackTrace>& optOutAsyncStackTrace)
+{
+ m_debuggerAgent->setScriptSource(errorString, errorData, inScriptId, inScriptSource, inPreview, optOutCallFrames, optOutStackChanged, optOutAsyncStackTrace);
+}
+
+void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& inCallFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& outCallFrames, RefPtr<TypeBuilder::Debugger::StackTrace>& optOutAsyncStackTrace)
+{
+ m_debuggerAgent->restartFrame(errorString, inCallFrameId, outCallFrames, optOutAsyncStackTrace);
+}
+
+void InspectorDebuggerAgent::getScriptSource(ErrorString* errorString, const String& inScriptId, String* outScriptSource)
+{
+ m_debuggerAgent->getScriptSource(errorString, inScriptId, outScriptSource);
+}
+
+void InspectorDebuggerAgent::getFunctionDetails(ErrorString* errorString, const String& inFunctionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>& outDetails)
+{
+ m_debuggerAgent->getFunctionDetails(errorString, inFunctionId, outDetails);
+}
+
+void InspectorDebuggerAgent::getGeneratorObjectDetails(ErrorString* errorString, const String& inObjectId, RefPtr<TypeBuilder::Debugger::GeneratorObjectDetails>& outDetails)
+{
+ m_debuggerAgent->getGeneratorObjectDetails(errorString, inObjectId, outDetails);
+}
+
+void InspectorDebuggerAgent::getCollectionEntries(ErrorString* errorString, const String& inObjectId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CollectionEntry>>& outEntries)
+{
+ m_debuggerAgent->getCollectionEntries(errorString, inObjectId, outEntries);
+}
+
+void InspectorDebuggerAgent::setPauseOnExceptions(ErrorString* errorString, const String& inState)
+{
+ m_debuggerAgent->setPauseOnExceptions(errorString, inState);
+}
+
+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& inCallFrameId, const String& inExpression, const String* inObjectGroup, const bool* inIncludeCommandLineAPI, const bool* inDoNotPauseOnExceptionsAndMuteConsole, const bool* inReturnByValue, const bool* inGeneratePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>& outResult, TypeBuilder::OptOutput<bool>* optOutWasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& optOutExceptionDetails)
+{
+ m_debuggerAgent->evaluateOnCallFrame(errorString, inCallFrameId, inExpression, inObjectGroup, inIncludeCommandLineAPI, inDoNotPauseOnExceptionsAndMuteConsole, inReturnByValue, inGeneratePreview, outResult, optOutWasThrown, optOutExceptionDetails);
+}
+
+void InspectorDebuggerAgent::compileScript(ErrorString* errorString, const String& inExpression, const String& inSourceURL, bool inPersistScript, const int* inExecutionContextId, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>* optOutScriptId, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& optOutExceptionDetails)
+{
+ m_debuggerAgent->compileScript(errorString, inExpression, inSourceURL, inPersistScript, inExecutionContextId, optOutScriptId, optOutExceptionDetails);
+}
+
+void InspectorDebuggerAgent::runScript(ErrorString* errorString, const String& inScriptId, const int* inExecutionContextId, const String* inObjectGroup, const bool* inDoNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& outResult, RefPtr<TypeBuilder::Debugger::ExceptionDetails>& optOutExceptionDetails)
+{
+ m_debuggerAgent->runScript(errorString, inScriptId, inExecutionContextId, inObjectGroup, inDoNotPauseOnExceptionsAndMuteConsole, outResult, optOutExceptionDetails);
}
+void InspectorDebuggerAgent::setVariableValue(ErrorString* errorString, int inScopeNumber, const String& inVariableName, const RefPtr<JSONObject>& inNewValue, const String* inCallFrameId, const String* inFunctionObjectId)
+{
+ m_debuggerAgent->setVariableValue(errorString, inScopeNumber, inVariableName, inNewValue, inCallFrameId, inFunctionObjectId);
+}
+
+void InspectorDebuggerAgent::getStepInPositions(ErrorString* errorString, const String& inCallFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location>>& optOutStepInPositions)
+{
+ m_debuggerAgent->getStepInPositions(errorString, inCallFrameId, optOutStepInPositions);
+}
+
+void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>>& outCallFrames, RefPtr<TypeBuilder::Debugger::StackTrace>& optOutAsyncStackTrace)
+{
+ m_debuggerAgent->getBacktrace(errorString, outCallFrames, optOutAsyncStackTrace);
+}
+
+void InspectorDebuggerAgent::skipStackFrames(ErrorString* errorString, const String* inScript, const bool* inSkipContentScripts)
+{
+ m_debuggerAgent->skipStackFrames(errorString, inScript, inSkipContentScripts);
+}
+
+void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString* errorString, int inMaxDepth)
+{
+ m_debuggerAgent->setAsyncCallStackDepth(errorString, inMaxDepth);
+}
+
+void InspectorDebuggerAgent::enablePromiseTracker(ErrorString* errorString, const bool* inCaptureStacks)
+{
+ m_debuggerAgent->enablePromiseTracker(errorString, inCaptureStacks);
+}
+
+void InspectorDebuggerAgent::disablePromiseTracker(ErrorString* errorString)
+{
+ m_debuggerAgent->disablePromiseTracker(errorString);
+}
+
+void InspectorDebuggerAgent::getPromiseById(ErrorString* errorString, int inPromiseId, const String* inObjectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& outPromise)
+{
+ m_debuggerAgent->getPromiseById(errorString, inPromiseId, inObjectGroup, outPromise);
+}
+
+void InspectorDebuggerAgent::flushAsyncOperationEvents(ErrorString* errorString)
+{
+ m_debuggerAgent->flushAsyncOperationEvents(errorString);
+}
+
+void InspectorDebuggerAgent::setAsyncOperationBreakpoint(ErrorString* errorString, int inOperationId)
+{
+ m_debuggerAgent->setAsyncOperationBreakpoint(errorString, inOperationId);
+}
+
+void InspectorDebuggerAgent::removeAsyncOperationBreakpoint(ErrorString* errorString, int inOperationId)
+{
+ m_debuggerAgent->removeAsyncOperationBreakpoint(errorString, inOperationId);
+}
+
+// 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
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698