Index: content/public/renderer/plugin_instance_throttler.cc |
diff --git a/components/history/content/browser/history_context_helper.h b/content/public/renderer/plugin_instance_throttler.cc |
similarity index 25% |
copy from components/history/content/browser/history_context_helper.h |
copy to content/public/renderer/plugin_instance_throttler.cc |
index 8ea956a961f2a8d8dc926365bcf0c75a71d3df46..8fde88a5b8616e7bb11969082ed701179e725f9a 100644 |
--- a/components/history/content/browser/history_context_helper.h |
+++ b/content/public/renderer/plugin_instance_throttler.cc |
@@ -2,21 +2,25 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_ |
-#define COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_ |
+#include "content/public/renderer/plugin_instance_throttler.h" |
-#include "components/history/core/browser/history_context.h" |
+#include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
namespace content { |
-class WebContents; |
-} // namespace content |
- |
-namespace history { |
-// Helper function that associates a ContextID to a content::WebContents. The |
-// ContextID will become invalid once the content::WebContents is destroyed. |
-ContextID ContextIDForWebContents(content::WebContents* web_contents); |
+// 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; |
-} // namespace history |
+ 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)); |
+} |
-#endif // COMPONENTS_HISTORY_CONTENT_BROWSER_HISTORY_CONTEXT_HELPER_H_ |
+} // namespace content |