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

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

Issue 427803002: DevTools: nits: introduce a handy asBool(bool*) and use across agents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 years, 5 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
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorRuntimeAgent.cpp
diff --git a/Source/core/inspector/InspectorRuntimeAgent.cpp b/Source/core/inspector/InspectorRuntimeAgent.cpp
index 063223e6856f64028df1d220fd70548742c96de4..eb3bdca51e988e5f6fe010e0796467fb0d186217 100644
--- a/Source/core/inspector/InspectorRuntimeAgent.cpp
+++ b/Source/core/inspector/InspectorRuntimeAgent.cpp
@@ -46,11 +46,6 @@ namespace InspectorRuntimeAgentState {
static const char runtimeEnabled[] = "runtimeEnabled";
};
-static bool asBool(const bool* const b)
-{
- return b ? *b : false;
-}
-
InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager, ScriptDebugServer* scriptDebugServer)
: InspectorBaseAgent<InspectorRuntimeAgent>("Runtime")
, m_enabled(false)
@@ -134,10 +129,9 @@ void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String
ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
muteConsole();
- bool accessorPropertiesOnlyValue = accessorPropertiesOnly && *accessorPropertiesOnly;
- injectedScript.getProperties(errorString, objectId, ownProperties && *ownProperties, accessorPropertiesOnlyValue, &result);
+ injectedScript.getProperties(errorString, objectId, asBool(ownProperties), asBool(accessorPropertiesOnly), &result);
- if (!accessorPropertiesOnlyValue)
+ if (!asBool(accessorPropertiesOnly))
injectedScript.getInternalProperties(errorString, objectId, &internalProperties);
unmuteConsole();
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698