OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // Plugin instance has been marked essential. | 77 // Plugin instance has been marked essential. |
78 THROTTLER_STATE_MARKED_ESSENTIAL, | 78 THROTTLER_STATE_MARKED_ESSENTIAL, |
79 }; | 79 }; |
80 | 80 |
81 // Maximum number of frames to examine for a suitable keyframe. After that, we | 81 // Maximum number of frames to examine for a suitable keyframe. After that, we |
82 // simply suspend the plugin where it's at. Chosen arbitrarily. | 82 // simply suspend the plugin where it's at. Chosen arbitrarily. |
83 static const int kMaximumFramesToExamine; | 83 static const int kMaximumFramesToExamine; |
84 | 84 |
85 void AudioThrottledFrameTimeout(); | 85 void AudioThrottledFrameTimeout(); |
86 void EngageThrottle(); | 86 void EngageThrottle(); |
| 87 void BroadcastThrottleStateChange(); |
87 | 88 |
88 ThrottlerState state_; | 89 ThrottlerState state_; |
89 | 90 |
90 bool is_hidden_for_placeholder_; | 91 bool is_hidden_for_placeholder_; |
91 | 92 |
92 PepperWebPluginImpl* web_plugin_; | 93 PepperWebPluginImpl* web_plugin_; |
93 | 94 |
94 // Holds a reference to the last received frame. This doesn't actually copy | 95 // Holds a reference to the last received frame. This doesn't actually copy |
95 // the pixel data, but rather increments the reference count to the pixels. | 96 // the pixel data, but rather increments the reference count to the pixels. |
96 SkBitmap last_received_frame_; | 97 SkBitmap last_received_frame_; |
(...skipping 17 matching lines...) Expand all Loading... |
114 | 115 |
115 ObserverList<Observer> observer_list_; | 116 ObserverList<Observer> observer_list_; |
116 | 117 |
117 base::WeakPtrFactory<PluginInstanceThrottlerImpl> weak_factory_; | 118 base::WeakPtrFactory<PluginInstanceThrottlerImpl> weak_factory_; |
118 | 119 |
119 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottlerImpl); | 120 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottlerImpl); |
120 }; | 121 }; |
121 } | 122 } |
122 | 123 |
123 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ | 124 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_INSTANCE_THROTTLER_IMPL_H_ |
OLD | NEW |