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

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

Issue 1114623002: Plugin Power Saver: Make PPS work well with prerendered pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: content/renderer/pepper/plugin_instance_throttler_impl.cc
diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc
index 6936a1adf4abbb4d327e2be49f8bf78b54700740..db8e882e497ffc5aeb2ef443333b645065f71a39 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -9,11 +9,8 @@
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_thread.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
-#include "content/renderer/pepper/pepper_webplugin_impl.h"
#include "content/renderer/render_frame_impl.h"
#include "ppapi/shared_impl/ppapi_constants.h"
-#include "ppapi/shared_impl/scoped_pp_var.h"
-#include "ppapi/shared_impl/var.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
@@ -98,16 +95,10 @@ void PluginInstanceThrottlerImpl::MarkPluginEssential(
state_ = THROTTLER_STATE_MARKED_ESSENTIAL;
RecordUnthrottleMethodMetric(method);
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnPeripheralStateChange());
+
if (was_throttled)
FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange());
-
- // Notify the Power Saver test plugin of a peripheral status change.
- if (web_plugin_ && web_plugin_->instance() &&
- plugin_module_name_ == ppapi::kPowerSaverTestPluginName) {
- web_plugin_->instance()->HandleMessage(ppapi::ScopedPPVar(
- ppapi::ScopedPPVar::PassRef(),
- ppapi::StringVar::StringToPPVar("peripheralStatusChange")));
- }
}
void PluginInstanceThrottlerImpl::SetHiddenForPlaceholder(bool hidden) {
@@ -115,7 +106,7 @@ void PluginInstanceThrottlerImpl::SetHiddenForPlaceholder(bool hidden) {
FOR_EACH_OBSERVER(Observer, observer_list_, OnHiddenForPlaceholder(hidden));
}
-blink::WebPlugin* PluginInstanceThrottlerImpl::GetWebPlugin() const {
+PepperWebPluginImpl* PluginInstanceThrottlerImpl::GetWebPlugin() const {
DCHECK(web_plugin_);
return web_plugin_;
}
@@ -140,7 +131,6 @@ void PluginInstanceThrottlerImpl::Initialize(
const GURL& content_origin,
const std::string& plugin_module_name,
const gfx::Size& unobscured_size) {
- plugin_module_name_ = plugin_module_name;
unobscured_size_ = unobscured_size;
// |frame| may be nullptr in tests.

Powered by Google App Engine
This is Rietveld 408576698