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 593fb99d7fadb924a36c0e4cd68100d9ef121719..b1918d966cedf8cd07c9d30aca225a8722b109c7 100644 |
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc |
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc |
@@ -102,7 +102,7 @@ void PluginInstanceThrottlerImpl::MarkPluginEssential( |
RecordUnthrottleMethodMetric(method); |
if (was_throttled) |
- FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange()); |
+ BroadcastThrottleStateChange(); |
// Notify the Power Saver test plugin of a peripheral status change. |
if (web_plugin_ && web_plugin_->instance() && |
@@ -229,7 +229,19 @@ void PluginInstanceThrottlerImpl::EngageThrottle() { |
} |
state_ = THROTTLER_STATE_PLUGIN_THROTTLED; |
+ BroadcastThrottleStateChange(); |
+} |
+ |
+void PluginInstanceThrottlerImpl::BroadcastThrottleStateChange() { |
FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange()); |
+ |
+ // Notify the Power Saver test plugin of a throttle status change. |
+ if (web_plugin_ && web_plugin_->instance() && |
+ plugin_module_name_ == ppapi::kPowerSaverTestPluginName) { |
+ web_plugin_->instance()->HandleMessage(ppapi::ScopedPPVar( |
+ ppapi::ScopedPPVar::PassRef(), |
+ ppapi::StringVar::StringToPPVar("throttleStatusChange"))); |
+ } |
raymes
2015/04/29 00:12:34
It feels a little weird to have this test code in
tommycli
2015/04/29 20:25:47
Done.
|
} |
} // namespace content |