| Index: components/plugins/renderer/loadable_plugin_placeholder.cc
|
| diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc
|
| index 7d50eecaf8112ca14a78ce2bfefb8e6f5cabf90c..3ef70deb0c621a88af63b43beb945eda892d3a53 100644
|
| --- a/components/plugins/renderer/loadable_plugin_placeholder.cc
|
| +++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
|
| @@ -51,6 +51,7 @@ void LoadablePluginPlaceholder::SetPremadePlugin(
|
| content::PluginInstanceThrottler* throttler) {
|
| DCHECK(throttler);
|
| DCHECK(!premade_throttler_);
|
| + heuristic_run_before_ = true;
|
| premade_throttler_ = throttler;
|
| }
|
|
|
| @@ -60,6 +61,7 @@ LoadablePluginPlaceholder::LoadablePluginPlaceholder(
|
| const blink::WebPluginParams& params,
|
| const std::string& html_data)
|
| : PluginPlaceholderBase(render_frame, frame, params, html_data),
|
| + heuristic_run_before_(false),
|
| is_blocked_for_tinyness_(false),
|
| is_blocked_for_background_tab_(false),
|
| is_blocked_for_prerendering_(false),
|
| @@ -68,7 +70,6 @@ LoadablePluginPlaceholder::LoadablePluginPlaceholder(
|
| premade_throttler_(nullptr),
|
| allow_loading_(false),
|
| finished_loading_(false),
|
| - heuristic_run_before_(premade_throttler_ != nullptr),
|
| weak_factory_(this) {}
|
|
|
| LoadablePluginPlaceholder::~LoadablePluginPlaceholder() {
|
| @@ -202,7 +203,8 @@ void LoadablePluginPlaceholder::OnUnobscuredRectUpdate(
|
| content::RenderFrame::PeripheralContentStatus status =
|
| render_frame()->GetPeripheralContentStatus(
|
| render_frame()->GetWebFrame()->top()->getSecurityOrigin(),
|
| - content_origin, gfx::Size(width, height));
|
| + content_origin, gfx::Size(width, height),
|
| + !heuristic_run_before_ /* record_decision */);
|
|
|
| bool plugin_is_tiny_and_blocked =
|
| is_blocked_for_tinyness_ &&
|
|
|