Chromium Code Reviews| 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..a741cc082d4c36bc5209f00b5567c90ff0a2557c 100644 |
| --- a/components/plugins/renderer/loadable_plugin_placeholder.h |
| +++ b/components/plugins/renderer/loadable_plugin_placeholder.h |
| @@ -85,6 +85,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 +100,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 +135,14 @@ 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_; |
| + |
| + // A separate weak factory so we can schedule, coalesce and cancel unthrottle |
| + // calls due to plugin size updates. |
| + base::WeakPtrFactory<LoadablePluginPlaceholder> size_update_weak_factory_; |
|
groby-ooo-7-16
2015/06/05 23:03:45
You can skip the WeakPtrFactory thing, and instead
tommycli
2015/06/06 01:23:22
Delaying this change per offline discussion.
|
| + |
| base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); |