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

Unified Diff: content/renderer/pepper/plugin_instance_throttler_impl.cc

Issue 863813002: Plugin Power Saver: Make Unthrottle metric collection more consistent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: content/renderer/pepper/plugin_instance_throttler_impl.cc
diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc
index ea06846f786539c2979415a4d0873229e898008b..67440e16e5b190799f072b90db3f6d933c7e31ce 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -4,7 +4,6 @@
#include "content/renderer/pepper/plugin_instance_throttler_impl.h"
-#include "base/metrics/histogram.h"
#include "base/time/time.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_frame.h"
@@ -17,15 +16,6 @@ namespace content {
namespace {
-const char kPowerSaverUnthrottleHistogram[] = "Plugin.PowerSaver.Unthrottle";
-
-void RecordUnthrottleMethodMetric(
- PluginInstanceThrottlerImpl::PowerSaverUnthrottleMethod method) {
- UMA_HISTOGRAM_ENUMERATION(
- kPowerSaverUnthrottleHistogram, method,
- PluginInstanceThrottler::UNTHROTTLE_METHOD_NUM_ITEMS);
-}
-
// When we give up waiting for a suitable preview frame, and simply suspend
// the plugin where it's at. In milliseconds.
const int kThrottleTimeout = 5000;
@@ -64,6 +54,8 @@ PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl(
}
PluginInstanceThrottlerImpl::~PluginInstanceThrottlerImpl() {
+ if (state_ != PLUGIN_INSTANCE_MARKED_ESSENTIAL)
+ RecordUnthrottleMethodMetric(UNTHROTTLE_METHOD_NEVER);
}
void PluginInstanceThrottlerImpl::AddObserver(Observer* observer) {

Powered by Google App Engine
This is Rietveld 408576698