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

Unified Diff: Source/core/inspector/InspectorBaseAgent.h

Issue 427803002: DevTools: nits: introduce a handy asBool(bool*) and use across agents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/inspector/InspectorBaseAgent.h
diff --git a/Source/core/inspector/InspectorBaseAgent.h b/Source/core/inspector/InspectorBaseAgent.h
index 20c53b641cce964c4caba20c6836dddf7f73ba9d..38a3b92ec35749a4c1fd4b6c670134fbd254d23b 100644
--- a/Source/core/inspector/InspectorBaseAgent.h
+++ b/Source/core/inspector/InspectorBaseAgent.h
@@ -109,6 +109,11 @@ protected:
}
};
+inline bool asBool(const bool* const b, bool defaultValue = false)
+{
+ return b ? *b : defaultValue;
+}
+
} // namespace blink
#endif // !defined(InspectorBaseAgent_h)
« no previous file with comments | « no previous file | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | Source/core/inspector/InspectorCSSAgent.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698