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

Unified Diff: content/public/renderer/plugin_instance_throttler.cc

Issue 849723002: Plugin Power Saver: Make PepperPluginInstanceThrottler interface public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/plugin_instance_throttler.h ('k') | content/public/renderer/render_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/plugin_instance_throttler.cc
diff --git a/content/public/renderer/plugin_instance_throttler.cc b/content/public/renderer/plugin_instance_throttler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8fde88a5b8616e7bb11969082ed701179e725f9a
--- /dev/null
+++ b/content/public/renderer/plugin_instance_throttler.cc
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/renderer/plugin_instance_throttler.h"
+
+#include "content/renderer/pepper/plugin_instance_throttler_impl.h"
+
+namespace content {
+
+// static
+scoped_ptr<PluginInstanceThrottler> PluginInstanceThrottler::Get(
+ RenderFrame* frame,
+ const GURL& plugin_url,
+ PluginPowerSaverMode power_saver_mode) {
+ if (power_saver_mode == PluginPowerSaverMode::POWER_SAVER_MODE_ESSENTIAL)
+ return nullptr;
+
+ bool power_saver_enabled =
+ power_saver_mode ==
+ PluginPowerSaverMode::POWER_SAVER_MODE_PERIPHERAL_THROTTLED;
+ return make_scoped_ptr(
+ new PluginInstanceThrottlerImpl(frame, plugin_url, power_saver_enabled));
+}
+
+} // namespace content
« no previous file with comments | « content/public/renderer/plugin_instance_throttler.h ('k') | content/public/renderer/render_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698