| 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_POWER_SAVER_HELPER_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_POWER_SAVER_HELPER_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_POWER_SAVER_HELPER_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_POWER_SAVER_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 url::Origin content_origin; | 43 url::Origin content_origin; |
| 44 base::Closure unthrottle_callback; | 44 base::Closure unthrottle_callback; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // See RenderFrame for documentation. | 47 // See RenderFrame for documentation. |
| 48 void RegisterPeripheralPlugin(const url::Origin& content_origin, | 48 void RegisterPeripheralPlugin(const url::Origin& content_origin, |
| 49 const base::Closure& unthrottle_callback); | 49 const base::Closure& unthrottle_callback); |
| 50 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( | 50 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( |
| 51 const url::Origin& main_frame_origin, | 51 const url::Origin& main_frame_origin, |
| 52 const url::Origin& content_origin, | 52 const url::Origin& content_origin, |
| 53 const gfx::Size& unobscured_size) const; | 53 const gfx::Size& unobscured_size, |
| 54 RenderFrame::RecordPeripheralDecision record_decision) const; |
| 54 void WhitelistContentOrigin(const url::Origin& content_origin); | 55 void WhitelistContentOrigin(const url::Origin& content_origin); |
| 55 | 56 |
| 56 // RenderFrameObserver implementation. | 57 // RenderFrameObserver implementation. |
| 57 void DidCommitProvisionalLoad(bool is_new_navigation, | 58 void DidCommitProvisionalLoad(bool is_new_navigation, |
| 58 bool is_same_page_navigation) override; | 59 bool is_same_page_navigation) override; |
| 59 bool OnMessageReceived(const IPC::Message& message) override; | 60 bool OnMessageReceived(const IPC::Message& message) override; |
| 60 void OnDestruct() override; | 61 void OnDestruct() override; |
| 61 | 62 |
| 62 void OnUpdatePluginContentOriginWhitelist( | 63 void OnUpdatePluginContentOriginWhitelist( |
| 63 const std::set<url::Origin>& origin_whitelist); | 64 const std::set<url::Origin>& origin_whitelist); |
| 64 | 65 |
| 65 // Local copy of the whitelist for the entire tab. | 66 // Local copy of the whitelist for the entire tab. |
| 66 std::set<url::Origin> origin_whitelist_; | 67 std::set<url::Origin> origin_whitelist_; |
| 67 | 68 |
| 68 // Set of peripheral plugins eligible to be unthrottled ex post facto. | 69 // Set of peripheral plugins eligible to be unthrottled ex post facto. |
| 69 std::vector<PeripheralPlugin> peripheral_plugins_; | 70 std::vector<PeripheralPlugin> peripheral_plugins_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(PluginPowerSaverHelper); | 72 DISALLOW_COPY_AND_ASSIGN(PluginPowerSaverHelper); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace content | 75 } // namespace content |
| 75 | 76 |
| 76 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_POWER_SAVER_HELPER_H_ | 77 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_POWER_SAVER_HELPER_H_ |
| OLD | NEW |