| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/prefs/pref_registry_simple.h" | |
| 12 #include "base/prefs/pref_service.h" | |
| 13 #include "base/prefs/scoped_user_pref_update.h" | |
| 14 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 18 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/plugins/plugin_prefs.h" | 16 #include "chrome/browser/plugins/plugin_prefs.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 22 #include "components/metrics/proto/system_profile.pb.h" | 19 #include "components/metrics/proto/system_profile.pb.h" |
| 20 #include "components/prefs/pref_registry_simple.h" |
| 21 #include "components/prefs/pref_service.h" |
| 22 #include "components/prefs/scoped_user_pref_update.h" |
| 23 #include "content/public/browser/child_process_data.h" | 23 #include "content/public/browser/child_process_data.h" |
| 24 #include "content/public/browser/plugin_service.h" | 24 #include "content/public/browser/plugin_service.h" |
| 25 #include "content/public/common/process_type.h" | 25 #include "content/public/common/process_type.h" |
| 26 #include "content/public/common/webplugininfo.h" | 26 #include "content/public/common/webplugininfo.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 // Delay for RecordCurrentState execution. | 30 // Delay for RecordCurrentState execution. |
| 31 const int kRecordStateDelayMs = 15 * base::Time::kMillisecondsPerSecond; | 31 const int kRecordStateDelayMs = 15 * base::Time::kMillisecondsPerSecond; |
| 32 | 32 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 385 } |
| 386 | 386 |
| 387 bool PluginMetricsProvider::RecordCurrentStateIfPending() { | 387 bool PluginMetricsProvider::RecordCurrentStateIfPending() { |
| 388 if (!weak_ptr_factory_.HasWeakPtrs()) | 388 if (!weak_ptr_factory_.HasWeakPtrs()) |
| 389 return false; | 389 return false; |
| 390 | 390 |
| 391 weak_ptr_factory_.InvalidateWeakPtrs(); | 391 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 392 RecordCurrentState(); | 392 RecordCurrentState(); |
| 393 return true; | 393 return true; |
| 394 } | 394 } |
| OLD | NEW |