| 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 #ifndef CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ | 6 #define CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Fetches plugin information data asynchronously and calls |done_callback| | 36 // Fetches plugin information data asynchronously and calls |done_callback| |
| 37 // when done. | 37 // when done. |
| 38 void GetPluginInformation(const base::Closure& done_callback); | 38 void GetPluginInformation(const base::Closure& done_callback); |
| 39 | 39 |
| 40 // metrics::MetricsDataProvider: | 40 // metrics::MetricsDataProvider: |
| 41 virtual void ProvideSystemProfileMetrics( | 41 virtual void ProvideSystemProfileMetrics( |
| 42 metrics::SystemProfileProto* system_profile_proto) OVERRIDE; | 42 metrics::SystemProfileProto* system_profile_proto) OVERRIDE; |
| 43 virtual void ProvideStabilityMetrics( | 43 virtual void ProvideStabilityMetrics( |
| 44 metrics::SystemProfileProto* system_profile_proto) OVERRIDE; | 44 metrics::SystemProfileProto* system_profile_proto) OVERRIDE; |
| 45 | 45 virtual void RecordCurrentState() OVERRIDE; |
| 46 // Saves plugin-related updates from the in-object buffer to Local State | |
| 47 // for retrieval next time we send a Profile log (generally next launch). | |
| 48 void RecordPluginChanges(); | |
| 49 | 46 |
| 50 // Notifies the provider about an error loading the plugin at |plugin_path|. | 47 // Notifies the provider about an error loading the plugin at |plugin_path|. |
| 51 void LogPluginLoadingError(const base::FilePath& plugin_path); | 48 void LogPluginLoadingError(const base::FilePath& plugin_path); |
| 52 | 49 |
| 53 // Sets this provider's list of plugins, exposed for testing. | 50 // Sets this provider's list of plugins, exposed for testing. |
| 54 void SetPluginsForTesting(const std::vector<content::WebPluginInfo>& plugins); | 51 void SetPluginsForTesting(const std::vector<content::WebPluginInfo>& plugins); |
| 55 | 52 |
| 56 // Returns true if process of type |type| should be counted as a plugin | 53 // Returns true if process of type |type| should be counted as a plugin |
| 57 // process, and false otherwise. | 54 // process, and false otherwise. |
| 58 static bool IsPluginProcess(int process_type); | 55 static bool IsPluginProcess(int process_type); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 86 | 83 |
| 87 // Buffer of child process notifications for quick access. | 84 // Buffer of child process notifications for quick access. |
| 88 std::map<base::string16, ChildProcessStats> child_process_stats_buffer_; | 85 std::map<base::string16, ChildProcessStats> child_process_stats_buffer_; |
| 89 | 86 |
| 90 base::WeakPtrFactory<PluginMetricsProvider> weak_ptr_factory_; | 87 base::WeakPtrFactory<PluginMetricsProvider> weak_ptr_factory_; |
| 91 | 88 |
| 92 DISALLOW_COPY_AND_ASSIGN(PluginMetricsProvider); | 89 DISALLOW_COPY_AND_ASSIGN(PluginMetricsProvider); |
| 93 }; | 90 }; |
| 94 | 91 |
| 95 #endif // CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ | 92 #endif // CHROME_BROWSER_METRICS_PLUGIN_METRICS_PROVIDER_H_ |
| OLD | NEW |