From 3c366b33751752790db5a550ad26adaf9d46d313 Mon Sep 17 00:00:00 2001 From: tommycli Date: Mon, 6 Oct 2014 16:05:46 -0700 Subject: [PATCH] Plugin Power Saver: Add flag to experiment behind. This adds a flag we can experiment behind and begin the implementation parts we know how to do. Design doc: http://goo.gl/iDix3p BUG=403800 Review URL: https://codereview.chromium.org/617073002 Cr-Commit-Position: refs/heads/master@{#298304} --- chrome/app/generated_resources.grd | 6 ++++++ chrome/browser/about_flags.cc | 9 +++++++++ content/browser/renderer_host/render_process_host_impl.cc | 1 + content/public/common/content_switches.cc | 3 +++ content/public/common/content_switches.h | 1 + tools/metrics/histograms/histograms.xml | 1 + 6 files changed, 21 insertions(+) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 89d542a768d2..a95a7c3c8bba 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6079,6 +6079,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Allows applications to use NaCl Socket API. Use only to test NaCl plugins. + + Enable Plugin Power Saver. + + + Enables experimental power saver mode for peripheral plugin content. + Enable pinch scale. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4594ea585ddb..45993cf0097a 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1943,6 +1943,15 @@ const Experiment kExperiments[] = { kOsAll, SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI) }, +#if defined(ENABLE_PLUGINS) + { + "enable-plugin-power-saver", + IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_NAME, + IDS_FLAGS_ENABLE_PLUGIN_POWER_SAVER_DESCRIPTION, + kOsDesktop, + SINGLE_VALUE_TYPE(switches::kEnablePluginPowerSaver) + }, +#endif // NOTE: Adding new command-line switches requires adding corresponding // entries to enum "LoginCustomFlags" in histograms.xml. See note in diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 8e778b6687f3..76a77177c8e4 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1149,6 +1149,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kEnableOverlayScrollbar, switches::kEnableOverscrollNotifications, switches::kEnablePinch, + switches::kEnablePluginPowerSaver, switches::kEnablePreciseMemoryInfo, switches::kEnableRendererMojoChannel, switches::kEnableSeccompFilterSandbox, diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 940adf9b84b3..d9be18254bc8 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -399,6 +399,9 @@ const char kEnableOverscrollNotifications[] = "enable-overscroll-notifications"; // Enables compositor-accelerated touch-screen pinch gestures. const char kEnablePinch[] = "enable-pinch"; +// Enables the plugin power saver feature. +const char kEnablePluginPowerSaver[] = "enable-plugin-power-saver"; + // Make the values returned to window.performance.memory more granular and more // up to date in shared worker. Without this flag, the memory information is // still available, but it is bucketized and updated less frequently. This flag diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 037dd2c4d195..526301578a8d 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -121,6 +121,7 @@ CONTENT_EXPORT extern const char kEnableOneCopy[]; CONTENT_EXPORT extern const char kEnableOverlayFullscreenVideo[]; CONTENT_EXPORT extern const char kEnableOverscrollNotifications[]; CONTENT_EXPORT extern const char kEnablePinch[]; +CONTENT_EXPORT extern const char kEnablePluginPowerSaver[]; CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[]; CONTENT_EXPORT extern const char kEnableRegionBasedColumns[]; CONTENT_EXPORT extern const char kEnableRendererMojoChannel[]; diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 01e6809e03ca..8fab12d93b81 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -45731,6 +45731,7 @@ To add a new entry, add it with any value and run test to compute valid value. label="disable-gesture-requirement-for-media-playback"/> + -- 2.11.4.GIT