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

Side by Side Diff: components/plugins/renderer/loadable_plugin_placeholder.h

Issue 1491893004: Plugin Power Saver: Remove Size Recheck hack in plugin placeholders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0047-pps-skip-poster-for-same-origin
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ 5 #ifndef COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_
6 #define COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ 6 #define COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "components/plugins/renderer/plugin_placeholder.h" 10 #include "components/plugins/renderer/plugin_placeholder.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 v8::Local<v8::Object> GetV8ScriptableObject( 80 v8::Local<v8::Object> GetV8ScriptableObject(
81 v8::Isolate* isolate) const override; 81 v8::Isolate* isolate) const override;
82 void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override; 82 void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override;
83 83
84 // RenderFrameObserver methods: 84 // RenderFrameObserver methods:
85 void WasShown() override; 85 void WasShown() override;
86 86
87 void UpdateMessage(); 87 void UpdateMessage();
88 88
89 bool LoadingBlocked() const; 89 bool LoadingBlocked() const;
90 void RecheckSizeAndMaybeUnthrottle();
91 90
92 // Plugin creation is embedder-specific. 91 // Plugin creation is embedder-specific.
93 virtual blink::WebPlugin* CreatePlugin() = 0; 92 virtual blink::WebPlugin* CreatePlugin() = 0;
94 93
95 content::WebPluginInfo plugin_info_; 94 content::WebPluginInfo plugin_info_;
96 95
97 base::string16 message_; 96 base::string16 message_;
98 97
99 // True if the plugin load was deferred due to page being a background tab. 98 // True if the plugin load was deferred due to page being a background tab.
100 // Plugin may be automatically loaded when the page is foregrounded. 99 // Plugin may be automatically loaded when the page is foregrounded.
(...skipping 11 matching lines...) Expand all
112 bool power_saver_enabled_; 111 bool power_saver_enabled_;
113 112
114 // When we load, uses this premade plugin instead of creating a new one. 113 // When we load, uses this premade plugin instead of creating a new one.
115 content::PluginInstanceThrottler* premade_throttler_; 114 content::PluginInstanceThrottler* premade_throttler_;
116 115
117 bool allow_loading_; 116 bool allow_loading_;
118 117
119 bool finished_loading_; 118 bool finished_loading_;
120 std::string identifier_; 119 std::string identifier_;
121 120
122 // Used to prevent re-entrancy during the size recheck for throttled plugins.
123 bool in_size_recheck_;
124 gfx::Rect unobscured_rect_; 121 gfx::Rect unobscured_rect_;
125 base::OneShotTimer size_update_timer_;
126 122
127 // True if the power saver heuristic has already been run on this content. 123 // True if the power saver heuristic has already been run on this content.
128 bool heuristic_run_before_; 124 bool heuristic_run_before_;
129 125
130 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; 126 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_;
131 127
132 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); 128 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder);
133 }; 129 };
134 130
135 } // namespace plugins 131 } // namespace plugins
136 132
137 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ 133 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698