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

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

Issue 1132793002: DevTools: do not enable debugger for pages where script execution is prohibited (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 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 adf92f72854e066d2fe36f075bcc67cafcfb982e..545d597f764e3bd83c3a3e447599db9d3abba3b3 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -188,17 +188,20 @@ bool InspectorDebuggerAgent::checkEnabled(ErrorString* errorString)
return false;
}
-void InspectorDebuggerAgent::enable()
+bool InspectorDebuggerAgent::enable()
{
+ if (!startListeningScriptDebugServer())
+ return false;
+
m_instrumentingAgents->setInspectorDebuggerAgent(this);
- startListeningScriptDebugServer();
// FIXME(WK44513): breakpoints activated flag should be synchronized between all front-ends
scriptDebugServer().setBreakpointsActivated(true);
m_state->setBoolean(DebuggerAgentState::debuggerEnabled, true);
if (m_listener)
m_listener->debuggerWasEnabled();
+ return true;
}
void InspectorDebuggerAgent::disable()
@@ -225,12 +228,15 @@ bool InspectorDebuggerAgent::enabled()
return m_state->getBoolean(DebuggerAgentState::debuggerEnabled);
}
-void InspectorDebuggerAgent::enable(ErrorString*)
+void InspectorDebuggerAgent::enable(ErrorString* errorString)
{
if (enabled())
return;
- enable();
+ if (!enable()) {
+ *errorString = "Failed to enable debugger";
+ return;
+ }
ASSERT(frontend());
}

Powered by Google App Engine
This is Rietveld 408576698