@@ -499,6 +499,8 @@ Response V8DebuggerAgentImpl::setBreakpointByUrl(
499499 Maybe<int > optionalColumnNumber, Maybe<String16> optionalCondition,
500500 String16* outBreakpointId,
501501 std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
502+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
503+
502504 *locations = std::make_unique<Array<protocol::Debugger::Location>>();
503505
504506 int specified = (optionalURL.isJust () ? 1 : 0 ) +
@@ -587,6 +589,8 @@ Response V8DebuggerAgentImpl::setBreakpoint(
587589 String16 breakpointId = generateBreakpointId (
588590 BreakpointType::kByScriptId , location->getScriptId (),
589591 location->getLineNumber (), location->getColumnNumber (0 ));
592+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
593+
590594 if (m_breakpointIdToDebuggerBreakpointIds.find (breakpointId) !=
591595 m_breakpointIdToDebuggerBreakpointIds.end ()) {
592596 return Response::ServerError (
@@ -605,6 +609,8 @@ Response V8DebuggerAgentImpl::setBreakpoint(
605609Response V8DebuggerAgentImpl::setBreakpointOnFunctionCall (
606610 const String16& functionObjectId, Maybe<String16> optionalCondition,
607611 String16* outBreakpointId) {
612+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
613+
608614 InjectedScript::ObjectScope scope (m_session, functionObjectId);
609615 Response response = scope.initialize ();
610616 if (!response.IsSuccess ()) return response;
0 commit comments