OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // Will run the provided task after finished. | 99 // Will run the provided task after finished. |
100 class MetricsMemoryDetails : public MemoryDetails { | 100 class MetricsMemoryDetails : public MemoryDetails { |
101 public: | 101 public: |
102 MetricsMemoryDetails( | 102 MetricsMemoryDetails( |
103 const base::Closure& callback, | 103 const base::Closure& callback, |
104 MemoryGrowthTracker* memory_growth_tracker) | 104 MemoryGrowthTracker* memory_growth_tracker) |
105 : callback_(callback) { | 105 : callback_(callback) { |
106 SetMemoryGrowthTracker(memory_growth_tracker); | 106 SetMemoryGrowthTracker(memory_growth_tracker); |
107 } | 107 } |
108 | 108 |
109 virtual void OnDetailsAvailable() override { | 109 void OnDetailsAvailable() override { |
110 base::MessageLoop::current()->PostTask(FROM_HERE, callback_); | 110 base::MessageLoop::current()->PostTask(FROM_HERE, callback_); |
111 } | 111 } |
112 | 112 |
113 private: | 113 private: |
114 virtual ~MetricsMemoryDetails() {} | 114 ~MetricsMemoryDetails() override {} |
115 | 115 |
116 base::Closure callback_; | 116 base::Closure callback_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); | 118 DISALLOW_COPY_AND_ASSIGN(MetricsMemoryDetails); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace | 121 } // namespace |
122 | 122 |
123 ChromeMetricsServiceClient::ChromeMetricsServiceClient( | 123 ChromeMetricsServiceClient::ChromeMetricsServiceClient( |
124 metrics::MetricsStateManager* state_manager) | 124 metrics::MetricsStateManager* state_manager) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 // Capture the histogram samples. | 547 // Capture the histogram samples. |
548 if (dumps_with_crash != 0) | 548 if (dumps_with_crash != 0) |
549 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 549 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
550 if (dumps_with_no_crash != 0) | 550 if (dumps_with_no_crash != 0) |
551 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 551 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
552 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 552 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
553 if (total_dumps != 0) | 553 if (total_dumps != 0) |
554 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 554 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
555 } | 555 } |
556 #endif // defined(OS_WIN) | 556 #endif // defined(OS_WIN) |
OLD | NEW |