Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 703453004: Plugin Power Saver: Add some UMAs to test plugins in wild. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 690 void SetPluginThrottled(bool throttled);
691 void DisablePowerSaverAndUnthrottle(); 691 void DisablePowerSaverByRetroactiveWhitelist();
692 692
693 RenderFrameImpl* render_frame_; 693 RenderFrameImpl* render_frame_;
694 base::Closure instance_deleted_callback_; 694 base::Closure instance_deleted_callback_;
695 scoped_refptr<PluginModule> module_; 695 scoped_refptr<PluginModule> module_;
696 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; 696 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 697 // 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 698 // IPC-based PPAPI proxy. Store the original module and instance interface
699 // so we can shut down properly. 699 // so we can shut down properly.
700 scoped_refptr<PluginModule> original_module_; 700 scoped_refptr<PluginModule> original_module_;
701 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; 701 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_;
702 702
703 PP_Instance pp_instance_; 703 PP_Instance pp_instance_;
704 704
705 // NULL until we have been initialized. 705 // NULL until we have been initialized.
706 blink::WebPluginContainer* container_; 706 blink::WebPluginContainer* container_;
707 scoped_refptr<cc::Layer> compositor_layer_; 707 scoped_refptr<cc::Layer> compositor_layer_;
708 scoped_refptr<cc::TextureLayer> texture_layer_; 708 scoped_refptr<cc::TextureLayer> texture_layer_;
709 scoped_ptr<blink::WebLayer> web_layer_; 709 scoped_ptr<blink::WebLayer> web_layer_;
710 bool layer_bound_to_fullscreen_; 710 bool layer_bound_to_fullscreen_;
711 bool layer_is_hardware_; 711 bool layer_is_hardware_;
712 712
713 // Plugin URL. 713 // Plugin URL.
714 GURL plugin_url_; 714 GURL plugin_url_;
715 715
716 // Indicates whether this plugin may be throttled to reduce power consumption. 716 // Indicates whether this plugin may be throttled to reduce power consumption.
717 // |power_saver_enabled_| implies |is_peripheral_content_|.
717 bool power_saver_enabled_; 718 bool power_saver_enabled_;
718 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
719 // Indicates if the plugin is currently throttled. 725 // Indicates if the plugin is currently throttled.
720 bool plugin_throttled_; 726 bool plugin_throttled_;
721 727
722 // Fake view data used by the Power Saver feature to throttle plugins. 728 // Fake view data used by the Power Saver feature to throttle plugins.
723 const ppapi::ViewData empty_view_data_; 729 const ppapi::ViewData empty_view_data_;
724 730
725 // Responsible for turning on throttling if Power Saver is on. 731 // Responsible for turning on throttling if Power Saver is on.
726 scoped_ptr<PepperPluginInstanceThrottler> throttler_; 732 scoped_ptr<PepperPluginInstanceThrottler> throttler_;
raymes 2014/11/06 02:11:00 There's a growing number of power-saver related me
tommycli 2014/11/06 21:16:13 No problem. I realize I'm adding a bunch of junk.
727 733
728 // Indicates whether this is a full frame instance, which means it represents 734 // Indicates whether this is a full frame instance, which means it represents
729 // an entire document rather than an embed tag. 735 // an entire document rather than an embed tag.
730 bool full_frame_; 736 bool full_frame_;
731 737
732 // Stores the current state of the plugin view. 738 // Stores the current state of the plugin view.
733 ppapi::ViewData view_data_; 739 ppapi::ViewData view_data_;
734 // The last state sent to the plugin. It is only valid after 740 // The last state sent to the plugin. It is only valid after
735 // |sent_initial_did_change_view_| is set to true. 741 // |sent_initial_did_change_view_| is set to true.
736 ppapi::ViewData last_sent_view_data_; 742 ppapi::ViewData last_sent_view_data_;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 // view change events. 929 // view change events.
924 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; 930 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
925 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; 931 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_;
926 932
927 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); 933 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
928 }; 934 };
929 935
930 } // namespace content 936 } // namespace content
931 937
932 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 938 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698