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

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

Issue 680193002: Plugin Power Saver: Implement size-based heuristic for peripheral content. (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
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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 bool IsValidInstanceOf(PluginModule* module); 527 bool IsValidInstanceOf(PluginModule* module);
528 528
529 // cc::TextureLayerClient implementation. 529 // cc::TextureLayerClient implementation.
530 bool PrepareTextureMailbox( 530 bool PrepareTextureMailbox(
531 cc::TextureMailbox* mailbox, 531 cc::TextureMailbox* mailbox,
532 scoped_ptr<cc::SingleReleaseCallback>* release_callback, 532 scoped_ptr<cc::SingleReleaseCallback>* release_callback,
533 bool use_shared_memory) override; 533 bool use_shared_memory) override;
534 534
535 // RenderFrameObserver 535 // RenderFrameObserver
536 void OnDestruct() override; 536 void OnDestruct() override;
537 bool OnMessageReceived(const IPC::Message& message) override;
537 538
538 void AddLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); 539 void AddLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
539 540
540 private: 541 private:
541 friend class base::RefCounted<PepperPluginInstanceImpl>; 542 friend class base::RefCounted<PepperPluginInstanceImpl>;
542 friend class PpapiPluginInstanceTest; 543 friend class PpapiPluginInstanceTest;
543 friend class PpapiUnittest; 544 friend class PpapiUnittest;
544 545
545 // Delete should be called by the WebPlugin before this destructor. 546 // Delete should be called by the WebPlugin before this destructor.
546 ~PepperPluginInstanceImpl() override; 547 ~PepperPluginInstanceImpl() override;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 MouseLockDispatcher* GetMouseLockDispatcher(); 683 MouseLockDispatcher* GetMouseLockDispatcher();
683 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); 684 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter();
684 void UnSetAndDeleteLockTargetAdapter(); 685 void UnSetAndDeleteLockTargetAdapter();
685 686
686 void DidDataFromWebURLResponse(const blink::WebURLResponse& response, 687 void DidDataFromWebURLResponse(const blink::WebURLResponse& response,
687 int pending_host_id, 688 int pending_host_id,
688 const ppapi::URLResponseInfoData& data); 689 const ppapi::URLResponseInfoData& data);
689 690
690 // Peripheral content is cross-origin plugin content determined heuristically 691 // Peripheral content is cross-origin plugin content determined heuristically
691 // to be not the "main attraction" of the webpage. 692 // to be not the "main attraction" of the webpage.
692 bool IsPeripheralContent() const; 693 bool IsPeripheralContent();
693 void SetPluginThrottled(bool throttled); 694 void SetPluginThrottled(bool throttled);
695 void OnPluginContentOriginWhitelisted(const GURL& content_origin);
694 696
695 RenderFrameImpl* render_frame_; 697 RenderFrameImpl* render_frame_;
696 base::Closure instance_deleted_callback_; 698 base::Closure instance_deleted_callback_;
697 scoped_refptr<PluginModule> module_; 699 scoped_refptr<PluginModule> module_;
698 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_; 700 scoped_ptr<ppapi::PPP_Instance_Combined> instance_interface_;
699 // If this is the NaCl plugin, we create a new module when we switch to the 701 // If this is the NaCl plugin, we create a new module when we switch to the
700 // IPC-based PPAPI proxy. Store the original module and instance interface 702 // IPC-based PPAPI proxy. Store the original module and instance interface
701 // so we can shut down properly. 703 // so we can shut down properly.
702 scoped_refptr<PluginModule> original_module_; 704 scoped_refptr<PluginModule> original_module_;
703 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; 705 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 // view change events. 927 // view change events.
926 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; 928 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_;
927 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; 929 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_;
928 930
929 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); 931 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl);
930 }; 932 };
931 933
932 } // namespace content 934 } // namespace content
933 935
934 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ 936 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698