| 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 a95f6db47aef47039b6c9696a87917f53b36f5da..e9562c4354978d34f122bd445b15c2d9ca3c6eb6 100644
|
| --- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
|
| +++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
|
| @@ -78,7 +78,7 @@ PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl(
|
| }
|
|
|
| PluginInstanceThrottlerImpl::~PluginInstanceThrottlerImpl() {
|
| - if (state_ != PLUGIN_INSTANCE_MARKED_ESSENTIAL)
|
| + if (state_ != POWER_SAVER_MARKED_ESSENTIAL)
|
| RecordUnthrottleMethodMetric(UNTHROTTLE_METHOD_NEVER);
|
| }
|
|
|
| @@ -96,15 +96,12 @@ bool PluginInstanceThrottlerImpl::IsThrottled() const {
|
|
|
| void PluginInstanceThrottlerImpl::MarkPluginEssential(
|
| PowerSaverUnthrottleMethod method) {
|
| - if (state_ == PLUGIN_INSTANCE_MARKED_ESSENTIAL)
|
| + if (state_ == POWER_SAVER_MARKED_ESSENTIAL)
|
| return;
|
|
|
| - bool was_throttled = IsThrottled();
|
| - state_ = PLUGIN_INSTANCE_MARKED_ESSENTIAL;
|
| + state_ = POWER_SAVER_MARKED_ESSENTIAL;
|
| RecordUnthrottleMethodMetric(method);
|
| -
|
| - if (was_throttled)
|
| - FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange());
|
| + FOR_EACH_OBSERVER(Observer, observer_list_, OnPowerSaverStateChange(state_));
|
| }
|
|
|
| void PluginInstanceThrottlerImpl::OnImageFlush(const SkBitmap* bitmap) {
|
| @@ -131,7 +128,7 @@ bool PluginInstanceThrottlerImpl::ConsumeInputEvent(
|
| if (event.modifiers & blink::WebInputEvent::Modifiers::RightButtonDown)
|
| return false;
|
|
|
| - if (state_ != PLUGIN_INSTANCE_MARKED_ESSENTIAL &&
|
| + if (state_ != POWER_SAVER_MARKED_ESSENTIAL &&
|
| event.type == blink::WebInputEvent::MouseUp &&
|
| (event.modifiers & blink::WebInputEvent::LeftButtonDown)) {
|
| bool was_throttled = IsThrottled();
|
| @@ -147,7 +144,7 @@ void PluginInstanceThrottlerImpl::EngageThrottle() {
|
| return;
|
|
|
| state_ = POWER_SAVER_ENABLED_PLUGIN_THROTTLED;
|
| - FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange());
|
| + FOR_EACH_OBSERVER(Observer, observer_list_, OnPowerSaverStateChange(state_));
|
| }
|
|
|
| } // namespace content
|
|
|