Chromium Code Reviews| Index: chrome/browser/power/process_power_collector.cc |
| diff --git a/chrome/browser/power/process_power_collector.cc b/chrome/browser/power/process_power_collector.cc |
| index 5d44e6112f3a1e8870446ed23964218a238fbe48..325541470897922f5129b1484f06adb9733ce870 100644 |
| --- a/chrome/browser/power/process_power_collector.cc |
| +++ b/chrome/browser/power/process_power_collector.cc |
| @@ -171,7 +171,8 @@ void ProcessPowerCollector::RecordCpuUsageByOrigin(double total_cpu_percent) { |
| power::OriginPowerMap* origin_power_map = |
| power::OriginPowerMapFactory::GetForBrowserContext( |
| it->second->profile()); |
| - DCHECK(origin_power_map); |
| + if (!origin_power_map) |
|
Daniel Erat
2014/09/19 00:39:42
nit: add a comment documenting that this can happe
Daniel Nishi
2014/09/19 00:50:15
Done.
|
| + continue; |
| origin_power_map->AddPowerForOrigin(origin, last_process_power_usage); |
| } |
| @@ -183,6 +184,8 @@ void ProcessPowerCollector::RecordCpuUsageByOrigin(double total_cpu_percent) { |
| ++it) { |
| power::OriginPowerMap* origin_power_map = |
| power::OriginPowerMapFactory::GetForBrowserContext(*it); |
| + if (!origin_power_map) |
| + continue; |
| origin_power_map->OnAllOriginsUpdated(); |
| } |
| } |