| 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 10c7f50593eb113ec5348e0a8613db4a9052fb5c..1fee2786728a57f78661c45903e058d9bd56a408 100644
|
| --- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
|
| +++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
|
| @@ -41,8 +41,9 @@ const int kAudioThrottledFrameTimeoutMilliseconds = 500;
|
| const int PluginInstanceThrottlerImpl::kMaximumFramesToExamine = 150;
|
|
|
| // static
|
| -std::unique_ptr<PluginInstanceThrottler> PluginInstanceThrottler::Create() {
|
| - return base::WrapUnique(new PluginInstanceThrottlerImpl);
|
| +std::unique_ptr<PluginInstanceThrottler> PluginInstanceThrottler::Create(
|
| + RenderFrame::RecordPeripheralDecision record_decision) {
|
| + return base::WrapUnique(new PluginInstanceThrottlerImpl(record_decision));
|
| }
|
|
|
| // static
|
| @@ -53,8 +54,10 @@ void PluginInstanceThrottler::RecordUnthrottleMethodMetric(
|
| PluginInstanceThrottler::UNTHROTTLE_METHOD_NUM_ITEMS);
|
| }
|
|
|
| -PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl()
|
| - : state_(THROTTLER_STATE_AWAITING_KEYFRAME),
|
| +PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl(
|
| + content::RenderFrame::RecordPeripheralDecision record_decision)
|
| + : record_decision_(record_decision),
|
| + state_(THROTTLER_STATE_AWAITING_KEYFRAME),
|
| is_hidden_for_placeholder_(false),
|
| web_plugin_(nullptr),
|
| frames_examined_(0),
|
| @@ -65,8 +68,7 @@ PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl()
|
| kAudioThrottledFrameTimeoutMilliseconds),
|
| this,
|
| &PluginInstanceThrottlerImpl::EngageThrottle),
|
| - weak_factory_(this) {
|
| -}
|
| + weak_factory_(this) {}
|
|
|
| PluginInstanceThrottlerImpl::~PluginInstanceThrottlerImpl() {
|
| FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottlerDestroyed());
|
| @@ -144,7 +146,8 @@ void PluginInstanceThrottlerImpl::Initialize(
|
| auto status = frame->GetPeripheralContentStatus(
|
| frame->GetWebFrame()->top()->getSecurityOrigin(), content_origin,
|
| gfx::Size(roundf(unobscured_size.width() / zoom_factor),
|
| - roundf(unobscured_size.height() / zoom_factor)));
|
| + roundf(unobscured_size.height() / zoom_factor)),
|
| + record_decision_);
|
| if (status != RenderFrame::CONTENT_STATUS_PERIPHERAL) {
|
| DCHECK_NE(THROTTLER_STATE_MARKED_ESSENTIAL, state_);
|
| state_ = THROTTLER_STATE_MARKED_ESSENTIAL;
|
|
|