Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 virtual const gfx::Size& GetSize() const = 0; | |
|
Lei Zhang
2015/03/18 00:48:12
You should comment what this is exactly.
tommycli
2015/03/19 22:10:12
Done.
| |
| 92 | |
| 87 protected: | 93 protected: |
| 88 PluginInstanceThrottler() {} | 94 PluginInstanceThrottler() {} |
| 89 | 95 |
| 90 private: | 96 private: |
| 91 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); | 97 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); |
| 92 }; | 98 }; |
| 93 } | 99 } |
| 94 | 100 |
| 95 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 101 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| OLD | NEW |