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

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

Issue 863813002: Plugin Power Saver: Make Unthrottle metric collection more consistent (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 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 "components/plugins/renderer/plugin_placeholder.h" 9 #include "components/plugins/renderer/plugin_placeholder.h"
10 #include "content/public/common/webplugininfo.h" 10 #include "content/public/common/webplugininfo.h"
(...skipping 26 matching lines...) Expand all
37 protected: 37 protected:
38 LoadablePluginPlaceholder(content::RenderFrame* render_frame, 38 LoadablePluginPlaceholder(content::RenderFrame* render_frame,
39 blink::WebLocalFrame* frame, 39 blink::WebLocalFrame* frame,
40 const blink::WebPluginParams& params, 40 const blink::WebPluginParams& params,
41 const std::string& html_data, 41 const std::string& html_data,
42 GURL placeholderDataUrl); 42 GURL placeholderDataUrl);
43 43
44 ~LoadablePluginPlaceholder() override; 44 ~LoadablePluginPlaceholder() override;
45 45
46 #if defined(ENABLE_PLUGINS) 46 #if defined(ENABLE_PLUGINS)
47 void DisablePowerSaverForInstance(); 47 void DisablePowerSaverForInstance(
48 content::PluginInstanceThrottler::PowerSaverUnthrottleMethod method);
48 #endif 49 #endif
49 50
50 void OnLoadBlockedPlugins(const std::string& identifier); 51 void OnLoadBlockedPlugins(const std::string& identifier);
51 void OnSetIsPrerendering(bool is_prerendering); 52 void OnSetIsPrerendering(bool is_prerendering);
52 53
53 void SetMessage(const base::string16& message); 54 void SetMessage(const base::string16& message);
54 void SetPluginInfo(const content::WebPluginInfo& plugin_info); 55 void SetPluginInfo(const content::WebPluginInfo& plugin_info);
55 const content::WebPluginInfo& GetPluginInfo() const; 56 const content::WebPluginInfo& GetPluginInfo() const;
56 void SetIdentifier(const std::string& identifier); 57 void SetIdentifier(const std::string& identifier);
57 bool LoadingAllowed() const { return allow_loading_; } 58 bool LoadingAllowed() const { return allow_loading_; }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 bool is_blocked_for_prerendering_; 105 bool is_blocked_for_prerendering_;
105 106
106 // True if the plugin load was deferred due to a Power Saver poster. 107 // True if the plugin load was deferred due to a Power Saver poster.
107 bool is_blocked_for_power_saver_poster_; 108 bool is_blocked_for_power_saver_poster_;
108 109
109 // This is independent of deferred plugin load due to a Power Saver poster. 110 // This is independent of deferred plugin load due to a Power Saver poster.
110 content::PluginPowerSaverMode power_saver_mode_; 111 content::PluginPowerSaverMode power_saver_mode_;
111 112
112 bool allow_loading_; 113 bool allow_loading_;
113 114
115 // True if the placeholder was replaced with the real plugin.
116 bool placeholder_was_replaced_;
117
114 bool hidden_; 118 bool hidden_;
115 bool finished_loading_; 119 bool finished_loading_;
116 std::string identifier_; 120 std::string identifier_;
117 121
118 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; 122 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_;
119 123
120 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); 124 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder);
121 }; 125 };
122 126
123 } // namespace plugins 127 } // namespace plugins
124 128
125 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ 129 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/plugins/chrome_plugin_placeholder.cc ('k') | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698