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

Unified Diff: content/renderer/render_frame_impl.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/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7258dbb97d8338997e601ae19c18429750a3aa09..811e644ff8d728b8c1f98cb9c490bdab988f113b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -81,6 +81,7 @@
#include "content/renderer/mojo/service_registry_js_wrapper.h"
#include "content/renderer/notification_permission_dispatcher.h"
#include "content/renderer/npapi/plugin_channel_host.h"
+#include "content/renderer/pepper/plugin_instance_throttler_impl.h"
#include "content/renderer/push_messaging/push_messaging_dispatcher.h"
#include "content/renderer/render_frame_proxy.h"
#include "content/renderer/render_process.h"
@@ -1616,7 +1617,7 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
blink::WebFrame* frame,
const WebPluginInfo& info,
const blink::WebPluginParams& params,
- PluginPowerSaverMode power_saver_mode) {
+ scoped_ptr<content::PluginInstanceThrottler> throttler) {
DCHECK_EQ(frame_, frame);
#if defined(ENABLE_PLUGINS)
bool pepper_plugin_was_registered = false;
@@ -1624,8 +1625,10 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
this, info, &pepper_plugin_was_registered));
if (pepper_plugin_was_registered) {
if (pepper_module.get()) {
- return new PepperWebPluginImpl(pepper_module.get(), params, this,
- power_saver_mode);
+ return new PepperWebPluginImpl(
+ pepper_module.get(), params, this,
+ make_scoped_ptr(
+ static_cast<PluginInstanceThrottlerImpl*>(throttler.release())));
}
}
#if defined(OS_CHROMEOS)
@@ -1771,7 +1774,7 @@ blink::WebPlugin* RenderFrameImpl::createPlugin(
WebPluginParams params_to_use = params;
params_to_use.mimeType = WebString::fromUTF8(mime_type);
- return CreatePlugin(frame, info, params_to_use, POWER_SAVER_MODE_ESSENTIAL);
+ return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */);
#else
return NULL;
#endif // defined(ENABLE_PLUGINS)
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698