| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/renderer/render_frame.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 class WebPlugin; | 15 class WebPlugin; |
| 15 struct WebPluginParams; | 16 struct WebPluginParams; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace gfx { | 19 namespace gfx { |
| 19 class Size; | 20 class Size; |
| 20 } | 21 } |
| 21 | 22 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void OnThrottleStateChange() {} | 67 virtual void OnThrottleStateChange() {} |
| 67 | 68 |
| 68 virtual void OnPeripheralStateChange() {} | 69 virtual void OnPeripheralStateChange() {} |
| 69 | 70 |
| 70 // Called when the plugin should be hidden due to a placeholder. | 71 // Called when the plugin should be hidden due to a placeholder. |
| 71 virtual void OnHiddenForPlaceholder(bool hidden) {} | 72 virtual void OnHiddenForPlaceholder(bool hidden) {} |
| 72 | 73 |
| 73 virtual void OnThrottlerDestroyed() {} | 74 virtual void OnThrottlerDestroyed() {} |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 static std::unique_ptr<PluginInstanceThrottler> Create(); | 77 static std::unique_ptr<PluginInstanceThrottler> Create( |
| 78 RenderFrame::RecordPeripheralDecision record_decision); |
| 77 | 79 |
| 78 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); | 80 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); |
| 79 | 81 |
| 80 virtual ~PluginInstanceThrottler() {} | 82 virtual ~PluginInstanceThrottler() {} |
| 81 | 83 |
| 82 virtual void AddObserver(Observer* observer) = 0; | 84 virtual void AddObserver(Observer* observer) = 0; |
| 83 virtual void RemoveObserver(Observer* observer) = 0; | 85 virtual void RemoveObserver(Observer* observer) = 0; |
| 84 | 86 |
| 85 virtual bool IsThrottled() const = 0; | 87 virtual bool IsThrottled() const = 0; |
| 86 virtual bool IsHiddenForPlaceholder() const = 0; | 88 virtual bool IsHiddenForPlaceholder() const = 0; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 102 | 104 |
| 103 protected: | 105 protected: |
| 104 PluginInstanceThrottler() {} | 106 PluginInstanceThrottler() {} |
| 105 | 107 |
| 106 private: | 108 private: |
| 107 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); | 109 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); |
| 108 }; | 110 }; |
| 109 } | 111 } |
| 110 | 112 |
| 111 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 113 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| OLD | NEW |