Index: Source/core/inspector/InspectorDebuggerAgent.cpp |
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp |
index 55d9b7266e099f20f6df6f782f8995a0ed9fd9bd..c7750731cb92c1ebe4856de9873c40980c407ded 100644 |
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp |
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp |
@@ -98,6 +98,11 @@ static String generateBreakpointId(const String& scriptId, int lineNumber, int c |
return scriptId + ':' + String::number(lineNumber) + ':' + String::number(columnNumber) + breakpointIdSuffix(source); |
} |
+static bool asBool(const bool* const b) |
+{ |
+ return b ? *b : false; |
+} |
+ |
InspectorDebuggerAgent::InspectorDebuggerAgent(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager) |
: InspectorBaseAgent<InspectorDebuggerAgent>("Debugger", instrumentingAgents, inspectorState) |
, m_injectedScriptManager(injectedScriptManager) |
@@ -412,7 +417,6 @@ void InspectorDebuggerAgent::removeBreakpoint(const String& breakpointId) |
void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const RefPtr<JSONObject>& location, const bool* interstateLocationOpt) |
{ |
- bool interstateLocation = interstateLocationOpt ? *interstateLocationOpt : false; |
if (!m_continueToLocationBreakpointId.isEmpty()) { |
scriptDebugServer().removeBreakpoint(m_continueToLocationBreakpointId); |
m_continueToLocationBreakpointId = ""; |
@@ -426,7 +430,7 @@ void InspectorDebuggerAgent::continueToLocation(ErrorString* errorString, const |
return; |
ScriptBreakpoint breakpoint(lineNumber, columnNumber, ""); |
- m_continueToLocationBreakpointId = scriptDebugServer().setBreakpoint(scriptId, breakpoint, &lineNumber, &columnNumber, interstateLocation); |
+ m_continueToLocationBreakpointId = scriptDebugServer().setBreakpoint(scriptId, breakpoint, &lineNumber, &columnNumber, asBool(interstateLocationOpt)); |
resume(errorString); |
} |
@@ -583,12 +587,9 @@ static PassRefPtr<JSONObject> scriptToInspectorObject(ScriptObject scriptObject) |
void InspectorDebuggerAgent::searchInContent(ErrorString* error, const String& scriptId, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Array<WebCore::TypeBuilder::Page::SearchMatch> >& results) |
{ |
- bool isRegex = optionalIsRegex ? *optionalIsRegex : false; |
- bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false; |
- |
ScriptsMap::iterator it = m_scripts.find(scriptId); |
if (it != m_scripts.end()) |
- results = ContentSearchUtils::searchInTextByLines(it->value.source, query, caseSensitive, isRegex); |
+ results = ContentSearchUtils::searchInTextByLines(it->value.source, query, asBool(optionalCaseSensitive), asBool(optionalIsRegex)); |
else |
*error = "No script for id: " + scriptId; |
} |
@@ -757,7 +758,7 @@ void InspectorDebuggerAgent::setPauseOnExceptionsImpl(ErrorString* errorString, |
m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, pauseState); |
} |
-void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) |
+void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* const forceObjectId, const bool* generatePreview, RefPtr<RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) |
{ |
if (!isPaused() || m_currentCallStack.isNull()) { |
*errorString = "Attempt to access callframe when debugger is not on pause"; |
@@ -770,15 +771,15 @@ void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const |
} |
ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = scriptDebugServer().pauseOnExceptionsState(); |
- if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) { |
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole)) { |
if (previousPauseOnExceptionsState != ScriptDebugServer::DontPauseOnExceptions) |
scriptDebugServer().setPauseOnExceptionsState(ScriptDebugServer::DontPauseOnExceptions); |
muteConsole(); |
} |
- injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", includeCommandLineAPI ? *includeCommandLineAPI : false, returnByValue ? *returnByValue : false, generatePreview ? *generatePreview : false, &result, wasThrown); |
+ injectedScript.evaluateOnCallFrame(errorString, m_currentCallStack, callFrameId, expression, objectGroup ? *objectGroup : "", asBool(includeCommandLineAPI), asBool(returnByValue), asBool(forceObjectId), asBool(generatePreview), &result, wasThrown); |
- if (doNotPauseOnExceptionsAndMuteConsole ? *doNotPauseOnExceptionsAndMuteConsole : false) { |
+ if (asBool(doNotPauseOnExceptionsAndMuteConsole)) { |
unmuteConsole(); |
if (scriptDebugServer().pauseOnExceptionsState() != previousPauseOnExceptionsState) |
scriptDebugServer().setPauseOnExceptionsState(previousPauseOnExceptionsState); |