Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1649)

Unified Diff: content/renderer/pepper/plugin_instance_throttler_impl.cc

Issue 1421693002: Plugin Power Saver: Do not always throttle plugins with posters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0025-pps-poster-pixel-tests
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/renderer/render_frame.h ('k') | content/renderer/pepper/plugin_power_saver_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fdd7de3a64ae9bd9ef274e2a9b9ef3de50bf668a..2b95411068d14966222966c97f38239830919beb 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -9,7 +9,6 @@
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_thread.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
-#include "content/renderer/peripheral_content_heuristic.h"
#include "content/renderer/render_frame_impl.h"
#include "ppapi/shared_impl/ppapi_constants.h"
#include "third_party/WebKit/public/platform/WebRect.h"
@@ -53,11 +52,6 @@ void PluginInstanceThrottler::RecordUnthrottleMethodMetric(
PluginInstanceThrottler::UNTHROTTLE_METHOD_NUM_ITEMS);
}
-// static
-bool PluginInstanceThrottler::IsLargeContent(int width, int height) {
- return PeripheralContentHeuristic::IsLargeContent(width, height);
-}
-
PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl()
: state_(THROTTLER_STATE_AWAITING_KEYFRAME),
is_hidden_for_placeholder_(false),
@@ -145,10 +139,9 @@ void PluginInstanceThrottlerImpl::Initialize(
// |frame| may be nullptr in tests.
if (frame) {
- PluginPowerSaverHelper* helper = frame->plugin_power_saver_helper();
bool cross_origin_main_content = false;
float zoom_factor = GetWebPlugin()->container()->pageZoomFactor();
- if (!helper->ShouldThrottleContent(
+ if (!frame->ShouldThrottleContent(
frame->GetWebFrame()->top()->securityOrigin(), content_origin,
plugin_module_name, roundf(unobscured_size.width() / zoom_factor),
roundf(unobscured_size.height() / zoom_factor),
@@ -158,14 +151,14 @@ void PluginInstanceThrottlerImpl::Initialize(
FOR_EACH_OBSERVER(Observer, observer_list_, OnPeripheralStateChange());
if (cross_origin_main_content)
- helper->WhitelistContentOrigin(content_origin);
+ frame->WhitelistContentOrigin(content_origin);
return;
}
// To collect UMAs, register peripheral content even if power saver mode
// is disabled.
- helper->RegisterPeripheralPlugin(
+ frame->RegisterPeripheralPlugin(
content_origin,
base::Bind(&PluginInstanceThrottlerImpl::MarkPluginEssential,
weak_factory_.GetWeakPtr(), UNTHROTTLE_METHOD_BY_WHITELIST));
« no previous file with comments | « content/public/renderer/render_frame.h ('k') | content/renderer/pepper/plugin_power_saver_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698