| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/metrics/tracking_synchronizer.h" | 5 #include "chrome/browser/metrics/tracking_synchronizer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 delete request; | 138 delete request; |
| 139 outstanding_requests_.Get().erase(it); | 139 outstanding_requests_.Get().erase(it); |
| 140 | 140 |
| 141 UMA_HISTOGRAM_BOOLEAN("Profiling.ReceivedProcessGroupCount", | 141 UMA_HISTOGRAM_BOOLEAN("Profiling.ReceivedProcessGroupCount", |
| 142 received_process_group_count); | 142 received_process_group_count); |
| 143 UMA_HISTOGRAM_COUNTS("Profiling.PendingProcessNotResponding", | 143 UMA_HISTOGRAM_COUNTS("Profiling.PendingProcessNotResponding", |
| 144 unresponsive_processes); | 144 unresponsive_processes); |
| 145 } | 145 } |
| 146 | 146 |
| 147 | |
| 148 // Delete all the entries in |outstanding_requests_| map. | 147 // Delete all the entries in |outstanding_requests_| map. |
| 149 static void OnShutdown() { | 148 static void OnShutdown() { |
| 150 // Just in case we have any pending tasks, clear them out. | 149 // Just in case we have any pending tasks, clear them out. |
| 151 while (!outstanding_requests_.Get().empty()) { | 150 while (!outstanding_requests_.Get().empty()) { |
| 152 RequestContextMap::iterator it = outstanding_requests_.Get().begin(); | 151 RequestContextMap::iterator it = outstanding_requests_.Get().begin(); |
| 153 delete it->second; | 152 delete it->second; |
| 154 outstanding_requests_.Get().erase(it); | 153 outstanding_requests_.Get().erase(it); |
| 155 } | 154 } |
| 156 } | 155 } |
| 157 | 156 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 288 |
| 290 ++last_used_sequence_number_; | 289 ++last_used_sequence_number_; |
| 291 | 290 |
| 292 // Watch out for wrapping to a negative number. | 291 // Watch out for wrapping to a negative number. |
| 293 if (last_used_sequence_number_ < 0) | 292 if (last_used_sequence_number_ < 0) |
| 294 last_used_sequence_number_ = 1; | 293 last_used_sequence_number_ = 1; |
| 295 return last_used_sequence_number_; | 294 return last_used_sequence_number_; |
| 296 } | 295 } |
| 297 | 296 |
| 298 } // namespace chrome_browser_metrics | 297 } // namespace chrome_browser_metrics |
| OLD | NEW |