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

Unified Diff: Source/core/inspector/InspectorHeapProfilerAgent.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: 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/InspectorHeapProfilerAgent.cpp
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index 056176d50bdbdff866dd203cbe98c6af67253892..ed6b607f34d49cab7aa236551430c2246fd50703 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -152,7 +152,7 @@ private:
void InspectorHeapProfilerAgent::startTrackingHeapObjects(ErrorString*, const bool* trackAllocations)
{
m_state->setBoolean(HeapProfilerAgentState::heapObjectsTrackingEnabled, true);
- bool allocationTrackingEnabled = trackAllocations && *trackAllocations;
+ bool allocationTrackingEnabled = asBool(trackAllocations);
m_state->setBoolean(HeapProfilerAgentState::allocationTrackingEnabled, allocationTrackingEnabled);
startTrackingHeapObjectsInternal(allocationTrackingEnabled);
}
@@ -251,7 +251,7 @@ void InspectorHeapProfilerAgent::takeHeapSnapshot(ErrorString* errorString, cons
};
String title = "Snapshot " + String::number(m_nextUserInitiatedHeapSnapshotNumber++);
- HeapSnapshotProgress progress(reportProgress && *reportProgress ? m_frontend : 0);
+ HeapSnapshotProgress progress(asBool(reportProgress) ? m_frontend : 0);
RefPtr<ScriptHeapSnapshot> snapshot = ScriptProfiler::takeHeapSnapshot(title, &progress);
if (!snapshot) {
*errorString = "Failed to take heap snapshot";

Powered by Google App Engine
This is Rietveld 408576698