Index: components/plugins/renderer/loadable_plugin_placeholder.h |
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.h b/components/plugins/renderer/loadable_plugin_placeholder.h |
index 7683ba7c6d8a081c1c7116859c449a061552a52c..0111dffc9540064f2ec29cd2089cc9911dc095e1 100644 |
--- a/components/plugins/renderer/loadable_plugin_placeholder.h |
+++ b/components/plugins/renderer/loadable_plugin_placeholder.h |
@@ -6,6 +6,7 @@ |
#define COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ |
#include "base/memory/weak_ptr.h" |
+#include "base/timer/timer.h" |
#include "components/plugins/renderer/plugin_placeholder.h" |
#include "content/public/common/webplugininfo.h" |
#include "content/public/renderer/plugin_instance_throttler.h" |
@@ -85,6 +86,9 @@ class LoadablePluginPlaceholder : public PluginPlaceholder { |
void PluginDestroyed() override; |
v8::Local<v8::Object> GetV8ScriptableObject( |
v8::Isolate* isolate) const override; |
+#if defined(ENABLE_PLUGINS) |
+ void OnUnobscuredSizeUpdate(const gfx::Size& unobscured_size) override; |
+#endif |
// RenderFrameObserver methods: |
void WasShown() override; |
@@ -97,6 +101,9 @@ class LoadablePluginPlaceholder : public PluginPlaceholder { |
void UpdateMessage(); |
bool LoadingBlocked() const; |
+#if defined(ENABLE_PLUGINS) |
+ void RecheckSizeAndMaybeUnthrottle(); |
+#endif |
// Plugin creation is embedder-specific. |
virtual blink::WebPlugin* CreatePlugin() = 0; |
@@ -129,6 +136,11 @@ class LoadablePluginPlaceholder : public PluginPlaceholder { |
bool finished_loading_; |
std::string identifier_; |
+ // Used to prevent re-entrancy during the size recheck for throttled plugins. |
+ bool in_size_recheck_; |
+ gfx::Size unobscured_size_; |
+ base::OneShotTimer<LoadablePluginPlaceholder> size_update_timer_; |
+ |
base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); |