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

Unified Diff: base/trace_event/memory_dump_scheduler.cc

Issue 2787533002: memory-infra: Avoid dereferencing polling_state_ when it could be null (Closed)
Patch Set: add dcheck Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_scheduler.cc
diff --git a/base/trace_event/memory_dump_scheduler.cc b/base/trace_event/memory_dump_scheduler.cc
index 66ea6c9f1aeb5dd98b8af1ac43d11a26b0d025be..150feb8e791759681585c17318b05cc52ed639e7 100644
--- a/base/trace_event/memory_dump_scheduler.cc
+++ b/base/trace_event/memory_dump_scheduler.cc
@@ -171,9 +171,11 @@ void MemoryDumpScheduler::RequestPeriodicGlobalDump() {
}
void MemoryDumpScheduler::PollMemoryOnPollingThread() {
- if (polling_state_->current_state != PollingTriggerState::ENABLED)
+ if (!polling_state_)
return;
+ DCHECK_EQ(PollingTriggerState::ENABLED, polling_state_->current_state);
+
uint64_t polled_memory = 0;
bool res = mdm_->PollFastMemoryTotal(&polled_memory);
DCHECK(res);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698