| 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/plugin_metrics_provider.h" | 5 #include "chrome/browser/metrics/plugin_metrics_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 return child_process_stats_buffer_[child_name]; | 346 return child_process_stats_buffer_[child_name]; |
| 347 } | 347 } |
| 348 | 348 |
| 349 void PluginMetricsProvider::BrowserChildProcessHostConnected( | 349 void PluginMetricsProvider::BrowserChildProcessHostConnected( |
| 350 const content::ChildProcessData& data) { | 350 const content::ChildProcessData& data) { |
| 351 GetChildProcessStats(data).process_launches++; | 351 GetChildProcessStats(data).process_launches++; |
| 352 RecordCurrentStateWithDelay(kRecordStateDelayMs); | 352 RecordCurrentStateWithDelay(kRecordStateDelayMs); |
| 353 } | 353 } |
| 354 | 354 |
| 355 void PluginMetricsProvider::BrowserChildProcessCrashed( | 355 void PluginMetricsProvider::BrowserChildProcessCrashed( |
| 356 const content::ChildProcessData& data) { | 356 const content::ChildProcessData& data, |
| 357 int exit_code) { |
| 357 GetChildProcessStats(data).process_crashes++; | 358 GetChildProcessStats(data).process_crashes++; |
| 358 RecordCurrentStateWithDelay(kRecordStateDelayMs); | 359 RecordCurrentStateWithDelay(kRecordStateDelayMs); |
| 359 } | 360 } |
| 360 | 361 |
| 361 void PluginMetricsProvider::BrowserChildProcessInstanceCreated( | 362 void PluginMetricsProvider::BrowserChildProcessInstanceCreated( |
| 362 const content::ChildProcessData& data) { | 363 const content::ChildProcessData& data) { |
| 363 GetChildProcessStats(data).instances++; | 364 GetChildProcessStats(data).instances++; |
| 364 RecordCurrentStateWithDelay(kRecordStateDelayMs); | 365 RecordCurrentStateWithDelay(kRecordStateDelayMs); |
| 365 } | 366 } |
| 366 | 367 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 377 } | 378 } |
| 378 | 379 |
| 379 bool PluginMetricsProvider::RecordCurrentStateIfPending() { | 380 bool PluginMetricsProvider::RecordCurrentStateIfPending() { |
| 380 if (!weak_ptr_factory_.HasWeakPtrs()) | 381 if (!weak_ptr_factory_.HasWeakPtrs()) |
| 381 return false; | 382 return false; |
| 382 | 383 |
| 383 weak_ptr_factory_.InvalidateWeakPtrs(); | 384 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 384 RecordCurrentState(); | 385 RecordCurrentState(); |
| 385 return true; | 386 return true; |
| 386 } | 387 } |
| OLD | NEW |