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

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

Issue 1124173008: Plugin Power Saver: Unthrottle dynamically sized plugins correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/renderer/pepper/plugin_instance_throttler_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/plugin_power_saver_helper.cc
diff --git a/content/renderer/pepper/plugin_power_saver_helper.cc b/content/renderer/pepper/plugin_power_saver_helper.cc
index 7931b41d7d187bc8fa292ba9c09b891feb87f5c1..e21305a2814d40312e21b9fa8407db002ec593c9 100644
--- a/content/renderer/pepper/plugin_power_saver_helper.cc
+++ b/content/renderer/pepper/plugin_power_saver_helper.cc
@@ -12,6 +12,7 @@
#include "content/common/frame_messages.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
+#include "content/public/renderer/plugin_instance_throttler.h"
#include "content/public/renderer/render_frame.h"
#include "ppapi/shared_impl/ppapi_constants.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -37,11 +38,6 @@ enum PeripheralHeuristicDecision {
const char kPeripheralHeuristicHistogram[] =
"Plugin.PowerSaver.PeripheralHeuristic";
-// Maximum dimensions plugin content may have while still being considered
-// peripheral content. These are similar to the numbers used by WebKit.
-const int kPeripheralContentMaxWidth = 398;
-const int kPeripheralContentMaxHeight = 298;
-
// Plugin content below this size in height and width is considered "tiny".
// Tiny content is never peripheral, as tiny plugins often serve a critical
// purpose, and the user often cannot find and click to unthrottle it.
@@ -180,8 +176,7 @@ bool PluginPowerSaverHelper::ShouldThrottleContent(
}
// Plugin content large in both dimensions are the "main attraction".
- if (width >= kPeripheralContentMaxWidth &&
- height >= kPeripheralContentMaxHeight) {
+ if (PluginInstanceThrottler::IsLargeContent(width, height)) {
RecordDecisionMetric(HEURISTIC_DECISION_ESSENTIAL_CROSS_ORIGIN_BIG);
if (cross_origin_main_content)
*cross_origin_main_content = true;
« no previous file with comments | « content/renderer/pepper/plugin_instance_throttler_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698