Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3601)

Unified Diff: chrome/browser/metrics/plugin_metrics_provider.h

Issue 441013002: Eliminate MetricsProvider::RecordCurrentState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RecordCurrentState is called before reading from prefs and delayed calls are canceled. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/plugin_metrics_provider.h
diff --git a/chrome/browser/metrics/plugin_metrics_provider.h b/chrome/browser/metrics/plugin_metrics_provider.h
index baabcf746df0bc5a1f499815ca0898d56e7078d0..c4e0c60c64f627b5461d4d34338e729f35b565c8 100644
--- a/chrome/browser/metrics/plugin_metrics_provider.h
+++ b/chrome/browser/metrics/plugin_metrics_provider.h
@@ -42,7 +42,7 @@ class PluginMetricsProvider : public metrics::MetricsProvider,
metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
virtual void ProvideStabilityMetrics(
metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
- virtual void RecordCurrentState() OVERRIDE;
+ void RecordCurrentState();
// Notifies the provider about an error loading the plugin at |plugin_path|.
void LogPluginLoadingError(const base::FilePath& plugin_path);
@@ -50,6 +50,15 @@ class PluginMetricsProvider : public metrics::MetricsProvider,
// Sets this provider's list of plugins, exposed for testing.
void SetPluginsForTesting(const std::vector<content::WebPluginInfo>& plugins);
+ // Posts a delayed task for RecordCurrentState. Returns true if new task is
+ // posted and false if there was one already waiting for execution.
+ // The param delay_sec is for unit tests.
+ bool DelayedRecordCurrentState(int delay_ms);
Alexei Svitkine (slow) 2014/08/05 21:35:21 Nit: How about RecordCurrentStateWithDelay(). (It'
gayane -on leave until 09-2017 2014/08/06 14:51:35 Done.
+
+ // If a delayed RecordCurrnetState task exists than cancel it, call
Alexei Svitkine (slow) 2014/08/05 21:35:21 Nit: Use the same verb tense here as a above (i.e.
gayane -on leave until 09-2017 2014/08/06 14:51:35 Done.
+ // RecordCurrentState immediately and returns true. Otherwise return false.
+ bool ForcedRecordCurrentState();
Alexei Svitkine (slow) 2014/08/05 21:35:21 Nit: How about RecordCurrentStateIfPending().
gayane -on leave until 09-2017 2014/08/06 14:51:35 Done.
+
// Returns true if process of type |type| should be counted as a plugin
// process, and false otherwise.
static bool IsPluginProcess(int process_type);
« no previous file with comments | « no previous file | chrome/browser/metrics/plugin_metrics_provider.cc » ('j') | chrome/browser/metrics/plugin_metrics_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698