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

Side by Side Diff: Source/core/inspector/InspectorDOMDebuggerAgent.cpp

Issue 1129473003: DevTools: respond with error when Debugger command is sent to disabled debugger agent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments, added checks in DOMDebugger Created 5 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 { 130 {
131 if (m_domAgent->enabled() && m_debuggerAgent->enabled()) 131 if (m_domAgent->enabled() && m_debuggerAgent->enabled())
132 m_instrumentingAgents->setInspectorDOMDebuggerAgent(this); 132 m_instrumentingAgents->setInspectorDOMDebuggerAgent(this);
133 } 133 }
134 134
135 void InspectorDOMDebuggerAgent::domAgentWasDisabled() 135 void InspectorDOMDebuggerAgent::domAgentWasDisabled()
136 { 136 {
137 disable(nullptr); 137 disable(nullptr);
138 } 138 }
139 139
140 bool InspectorDOMDebuggerAgent::checkEnabled(ErrorString* errorString)
141 {
142 if (!m_domAgent->enabled()) {
143 *errorString = "DOM domain required by DOMDebugger is not enabled";
144 return false;
145 }
146 if (!m_debuggerAgent->enabled()) {
147 *errorString = "Debugger domain required by DOMDebugger is not enabled";
148 return false;
149 }
150 return true;
151 }
152
140 void InspectorDOMDebuggerAgent::disable(ErrorString*) 153 void InspectorDOMDebuggerAgent::disable(ErrorString*)
141 { 154 {
142 m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr); 155 m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr);
143 clear(); 156 clear();
144 } 157 }
145 158
146 void InspectorDOMDebuggerAgent::discardAgent() 159 void InspectorDOMDebuggerAgent::discardAgent()
147 { 160 {
148 m_debuggerAgent->setListener(nullptr); 161 m_debuggerAgent->setListener(nullptr);
149 m_debuggerAgent = nullptr; 162 m_debuggerAgent = nullptr;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 eventData->setString("url", url); 603 eventData->setString("url", url);
591 m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::XHR, even tData.release()); 604 m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::XHR, even tData.release());
592 } 605 }
593 606
594 void InspectorDOMDebuggerAgent::clear() 607 void InspectorDOMDebuggerAgent::clear()
595 { 608 {
596 m_domBreakpoints.clear(); 609 m_domBreakpoints.clear();
597 } 610 }
598 611
599 } // namespace blink 612 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698