| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 bool IsMouseLocked(); | 680 bool IsMouseLocked(); |
| 681 bool LockMouse(); | 681 bool LockMouse(); |
| 682 MouseLockDispatcher* GetMouseLockDispatcher(); | 682 MouseLockDispatcher* GetMouseLockDispatcher(); |
| 683 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); | 683 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); |
| 684 void UnSetAndDeleteLockTargetAdapter(); | 684 void UnSetAndDeleteLockTargetAdapter(); |
| 685 | 685 |
| 686 void DidDataFromWebURLResponse(const blink::WebURLResponse& response, | 686 void DidDataFromWebURLResponse(const blink::WebURLResponse& response, |
| 687 int pending_host_id, | 687 int pending_host_id, |
| 688 const ppapi::URLResponseInfoData& data); | 688 const ppapi::URLResponseInfoData& data); |
| 689 | 689 |
| 690 void SetPluginThrottled(bool throttled); | |
| 691 void DisablePowerSaverByRetroactiveWhitelist(); | |
| 692 | |
| 693 RenderFrameImpl* render_frame_; | 690 RenderFrameImpl* render_frame_; |
| 694 base::Closure instance_deleted_callback_; | 691 base::Closure instance_deleted_callback_; |
| 695 scoped_refptr<PluginModule> module_; | 692 scoped_refptr<PluginModule> module_; |
| 696 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; | 693 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; |
| 697 // If this is the NaCl plugin, we create a new module when we switch to the | 694 // If this is the NaCl plugin, we create a new module when we switch to the |
| 698 // IPC-based PPAPI proxy. Store the original module and instance interface | 695 // IPC-based PPAPI proxy. Store the original module and instance interface |
| 699 // so we can shut down properly. | 696 // so we can shut down properly. |
| 700 scoped_refptr<PluginModule> original_module_; | 697 scoped_refptr<PluginModule> original_module_; |
| 701 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; | 698 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; |
| 702 | 699 |
| 703 PP_Instance pp_instance_; | 700 PP_Instance pp_instance_; |
| 704 | 701 |
| 705 // NULL until we have been initialized. | 702 // NULL until we have been initialized. |
| 706 blink::WebPluginContainer* container_; | 703 blink::WebPluginContainer* container_; |
| 707 scoped_refptr<cc::Layer> compositor_layer_; | 704 scoped_refptr<cc::Layer> compositor_layer_; |
| 708 scoped_refptr<cc::TextureLayer> texture_layer_; | 705 scoped_refptr<cc::TextureLayer> texture_layer_; |
| 709 scoped_ptr<blink::WebLayer> web_layer_; | 706 scoped_ptr<blink::WebLayer> web_layer_; |
| 710 bool layer_bound_to_fullscreen_; | 707 bool layer_bound_to_fullscreen_; |
| 711 bool layer_is_hardware_; | 708 bool layer_is_hardware_; |
| 712 | 709 |
| 713 // Plugin URL. | 710 // Plugin URL. |
| 714 GURL plugin_url_; | 711 GURL plugin_url_; |
| 715 | 712 |
| 716 // Indicates whether this plugin may be throttled to reduce power consumption. | |
| 717 // |power_saver_enabled_| implies |is_peripheral_content_|. | |
| 718 bool power_saver_enabled_; | |
| 719 | |
| 720 // Indicates whether this plugin was found to be peripheral content. | |
| 721 // This is separately tracked from |power_saver_enabled_| to collect UMAs. | |
| 722 // Always true if |power_saver_enabled_| is true. | |
| 723 bool is_peripheral_content_; | |
| 724 | |
| 725 // Indicates if the plugin is currently throttled. | |
| 726 bool plugin_throttled_; | |
| 727 | |
| 728 // Fake view data used by the Power Saver feature to throttle plugins. | |
| 729 const ppapi::ViewData empty_view_data_; | |
| 730 | |
| 731 // Responsible for turning on throttling if Power Saver is on. | 713 // Responsible for turning on throttling if Power Saver is on. |
| 732 scoped_ptr<PepperPluginInstanceThrottler> throttler_; | 714 scoped_ptr<PepperPluginInstanceThrottler> throttler_; |
| 733 | 715 |
| 734 // Indicates whether this is a full frame instance, which means it represents | 716 // Indicates whether this is a full frame instance, which means it represents |
| 735 // an entire document rather than an embed tag. | 717 // an entire document rather than an embed tag. |
| 736 bool full_frame_; | 718 bool full_frame_; |
| 737 | 719 |
| 738 // Stores the current state of the plugin view. | 720 // Stores the current state of the plugin view. |
| 739 ppapi::ViewData view_data_; | 721 ppapi::ViewData view_data_; |
| 740 // The last state sent to the plugin. It is only valid after | 722 // The last state sent to the plugin. It is only valid after |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 // view change events. | 911 // view change events. |
| 930 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; | 912 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; |
| 931 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; | 913 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; |
| 932 | 914 |
| 933 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 915 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
| 934 }; | 916 }; |
| 935 | 917 |
| 936 } // namespace content | 918 } // namespace content |
| 937 | 919 |
| 938 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 920 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| OLD | NEW |