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

Side by Side Diff: content/public/renderer/plugin_instance_throttler.h

Issue 1015023002: Plugin Power Saver: Throttle 'large' plugins that appear small. (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 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 CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 11
12 namespace blink { 12 namespace blink {
13 class WebPlugin; 13 class WebPlugin;
14 struct WebPluginParams; 14 struct WebPluginParams;
15 } 15 }
16 16
17 namespace gfx {
18 class Size;
19 }
20
17 class GURL; 21 class GURL;
18 class SkBitmap; 22 class SkBitmap;
19 23
20 namespace content { 24 namespace content {
21 25
22 // This class manages the metric collection, throttling, and unthrottling of a 26 // This class manages the metric collection, throttling, and unthrottling of a
23 // single peripheral plugin instance. If the Power Saver feature is disabled, 27 // single peripheral plugin instance. If the Power Saver feature is disabled,
24 // the plugin instance will never actually be throttled, but still collects 28 // the plugin instance will never actually be throttled, but still collects
25 // user interaction metrics. 29 // user interaction metrics.
26 // 30 //
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 virtual bool IsHiddenForPlaceholder() const = 0; 81 virtual bool IsHiddenForPlaceholder() const = 0;
78 82
79 // Marks the plugin as essential. Unthrottles the plugin if already throttled. 83 // Marks the plugin as essential. Unthrottles the plugin if already throttled.
80 virtual void MarkPluginEssential(PowerSaverUnthrottleMethod method) = 0; 84 virtual void MarkPluginEssential(PowerSaverUnthrottleMethod method) = 0;
81 85
82 // Called by the placeholder when the plugin should temporarily be hidden. 86 // Called by the placeholder when the plugin should temporarily be hidden.
83 virtual void SetHiddenForPlaceholder(bool hidden) = 0; 87 virtual void SetHiddenForPlaceholder(bool hidden) = 0;
84 88
85 virtual blink::WebPlugin* GetWebPlugin() const = 0; 89 virtual blink::WebPlugin* GetWebPlugin() const = 0;
86 90
91 // Gets the throttler's best estimate of the plugin's visible dimensions.
92 virtual const gfx::Size& GetSize() const = 0;
93
87 // Throttler needs to know when the plugin audio is throttled, as this may 94 // Throttler needs to know when the plugin audio is throttled, as this may
88 // prevent the plugin from generating new frames. 95 // prevent the plugin from generating new frames.
89 virtual void NotifyAudioThrottled() = 0; 96 virtual void NotifyAudioThrottled() = 0;
90 97
91 protected: 98 protected:
92 PluginInstanceThrottler() {} 99 PluginInstanceThrottler() {}
93 100
94 private: 101 private:
95 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); 102 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler);
96 }; 103 };
97 } 104 }
98 105
99 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ 106 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/resources/plugin_poster.html ('k') | content/renderer/pepper/pepper_plugin_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698