@@ -499,6 +499,8 @@ Response V8DebuggerAgentImpl::setBreakpointByUrl(
499
499
Maybe<int > optionalColumnNumber, Maybe<String16> optionalCondition,
500
500
String16* outBreakpointId,
501
501
std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
502
+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
503
+
502
504
*locations = std::make_unique<Array<protocol::Debugger ::Location>>();
503
505
504
506
int specified = (optionalURL.isJust () ? 1 : 0 ) +
@@ -587,6 +589,8 @@ Response V8DebuggerAgentImpl::setBreakpoint(
587
589
String16 breakpointId = generateBreakpointId (
588
590
BreakpointType::kByScriptId , location->getScriptId (),
589
591
location->getLineNumber (), location->getColumnNumber (0 ));
592
+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
593
+
590
594
if (m_breakpointIdToDebuggerBreakpointIds.find (breakpointId) !=
591
595
m_breakpointIdToDebuggerBreakpointIds.end ()) {
592
596
return Response::ServerError (
@@ -605,6 +609,8 @@ Response V8DebuggerAgentImpl::setBreakpoint(
605
609
Response V8DebuggerAgentImpl::setBreakpointOnFunctionCall (
606
610
const String16& functionObjectId, Maybe<String16> optionalCondition,
607
611
String16* outBreakpointId) {
612
+ if (!enabled ()) return Response::ServerError (kDebuggerNotEnabled );
613
+
608
614
InjectedScript::ObjectScope scope (m_session, functionObjectId);
609
615
Response response = scope.initialize ();
610
616
if (!response.IsSuccess ()) return response;
0 commit comments