| 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 a47d910835c1910d986355816e16e37979b36602..ff30f4a702c4b7a863cb233a72fbb3b984faf55d 100644
|
| --- a/components/plugins/renderer/loadable_plugin_placeholder.cc
|
| +++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
|
| @@ -270,6 +270,10 @@ void LoadablePluginPlaceholder::DidFinishLoadingCallback() {
|
| // This is necessary to prevent a flicker.
|
| if (premade_throttler_ && power_saver_enabled_)
|
| premade_throttler_->SetHiddenForPlaceholder(true /* hidden */);
|
| +
|
| + // In case our initial geometry was reported before the placeholder finished
|
| + // loading, request another one. Needed for correct large poster unthrottling.
|
| + plugin()->container()->reportGeometry();
|
| }
|
|
|
| void LoadablePluginPlaceholder::DidFinishIconRepositionForTestingCallback() {
|
| @@ -347,17 +351,20 @@ void LoadablePluginPlaceholder::RecheckSizeAndMaybeUnthrottle() {
|
|
|
| // On a size update check if we now qualify as a essential plugin.
|
| url::Origin content_origin = url::Origin(GetPluginParams().url);
|
| - bool cross_origin_main_content = false;
|
| - if (!render_frame()->ShouldThrottleContent(
|
| - render_frame()->GetWebFrame()->top()->securityOrigin(),
|
| - content_origin, width, height, &cross_origin_main_content)) {
|
| + auto status = render_frame()->GetPeripheralContentStatus(
|
| + render_frame()->GetWebFrame()->top()->securityOrigin(), content_origin,
|
| + gfx::Size(width, height));
|
| + if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL) {
|
| MarkPluginEssential(
|
| heuristic_run_before_
|
| ? PluginInstanceThrottler::UNTHROTTLE_METHOD_BY_SIZE_CHANGE
|
| : PluginInstanceThrottler::UNTHROTTLE_METHOD_DO_NOT_RECORD);
|
|
|
| - if (cross_origin_main_content && !heuristic_run_before_)
|
| + if (!heuristic_run_before_ &&
|
| + status ==
|
| + content::RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_BIG) {
|
| render_frame()->WhitelistContentOrigin(content_origin);
|
| + }
|
| }
|
|
|
| heuristic_run_before_ = true;
|
|
|