| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 namespace v8 { | 92 namespace v8 { |
| 93 class Isolate; | 93 class Isolate; |
| 94 } | 94 } |
| 95 | 95 |
| 96 namespace content { | 96 namespace content { |
| 97 | 97 |
| 98 class ContentDecryptorDelegate; | 98 class ContentDecryptorDelegate; |
| 99 class FullscreenContainer; | 99 class FullscreenContainer; |
| 100 class MessageChannel; | 100 class MessageChannel; |
| 101 class PepperGraphics2DHost; | 101 class PepperGraphics2DHost; |
| 102 class PepperPluginDelegateImpl; | 102 class PepperHelperImpl; |
| 103 class PluginModule; | 103 class PluginModule; |
| 104 class PluginObject; | 104 class PluginObject; |
| 105 class PPB_Graphics3D_Impl; | 105 class PPB_Graphics3D_Impl; |
| 106 class PPB_ImageData_Impl; | 106 class PPB_ImageData_Impl; |
| 107 class PPB_URLLoader_Impl; | 107 class PPB_URLLoader_Impl; |
| 108 class RenderViewImpl; | 108 class RenderViewImpl; |
| 109 | 109 |
| 110 // Represents one time a plugin appears on one web page. | 110 // Represents one time a plugin appears on one web page. |
| 111 // | 111 // |
| 112 // Note: to get from a PP_Instance to a PepperPluginInstance*, use the | 112 // Note: to get from a PP_Instance to a PepperPluginInstance*, use the |
| 113 // ResourceTracker. | 113 // ResourceTracker. |
| 114 class CONTENT_EXPORT PepperPluginInstanceImpl | 114 class CONTENT_EXPORT PepperPluginInstanceImpl |
| 115 : public base::RefCounted<PepperPluginInstanceImpl>, | 115 : public base::RefCounted<PepperPluginInstanceImpl>, |
| 116 public base::SupportsWeakPtr<PepperPluginInstanceImpl>, | 116 public base::SupportsWeakPtr<PepperPluginInstanceImpl>, |
| 117 public NON_EXPORTED_BASE(PepperPluginInstance), | 117 public NON_EXPORTED_BASE(PepperPluginInstance), |
| 118 public ::ppapi::PPB_Instance_Shared { | 118 public ::ppapi::PPB_Instance_Shared { |
| 119 public: | 119 public: |
| 120 // Create and return a PepperPluginInstanceImpl object which supports the most | 120 // Create and return a PepperPluginInstanceImpl object which supports the most |
| 121 // recent version of PPP_Instance possible by querying the given | 121 // recent version of PPP_Instance possible by querying the given |
| 122 // get_plugin_interface function. If the plugin does not support any valid | 122 // get_plugin_interface function. If the plugin does not support any valid |
| 123 // PPP_Instance interface, returns NULL. | 123 // PPP_Instance interface, returns NULL. |
| 124 static PepperPluginInstanceImpl* Create( | 124 static PepperPluginInstanceImpl* Create( |
| 125 PepperPluginDelegateImpl* delegate, | 125 PepperHelperImpl* helper, |
| 126 RenderViewImpl* render_view, | 126 RenderViewImpl* render_view, |
| 127 PluginModule* module, | 127 PluginModule* module, |
| 128 WebKit::WebPluginContainer* container, | 128 WebKit::WebPluginContainer* container, |
| 129 const GURL& plugin_url); | 129 const GURL& plugin_url); |
| 130 PepperPluginDelegateImpl* delegate() const { return delegate_; } | 130 PepperHelperImpl* helper() const { return helper_; } |
| 131 RenderViewImpl* render_view() const { return render_view_; } | 131 RenderViewImpl* render_view() const { return render_view_; } |
| 132 PluginModule* module() const { return module_.get(); } | 132 PluginModule* module() const { return module_.get(); } |
| 133 MessageChannel& message_channel() { return *message_channel_; } | 133 MessageChannel& message_channel() { return *message_channel_; } |
| 134 | 134 |
| 135 WebKit::WebPluginContainer* container() const { return container_; } | 135 WebKit::WebPluginContainer* container() const { return container_; } |
| 136 | 136 |
| 137 // Returns the PP_Instance uniquely identifying this instance. Guaranteed | 137 // Returns the PP_Instance uniquely identifying this instance. Guaranteed |
| 138 // nonzero. | 138 // nonzero. |
| 139 PP_Instance pp_instance() const { return pp_instance_; } | 139 PP_Instance pp_instance() const { return pp_instance_; } |
| 140 | 140 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 std::list<std::string> data_; | 533 std::list<std::string> data_; |
| 534 bool finished_loading_; | 534 bool finished_loading_; |
| 535 scoped_ptr<WebKit::WebURLError> error_; | 535 scoped_ptr<WebKit::WebURLError> error_; |
| 536 }; | 536 }; |
| 537 | 537 |
| 538 // Implements PPB_Gamepad_API. This is just to avoid having an excessive | 538 // Implements PPB_Gamepad_API. This is just to avoid having an excessive |
| 539 // number of interfaces implemented by PepperPluginInstanceImpl. | 539 // number of interfaces implemented by PepperPluginInstanceImpl. |
| 540 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API, | 540 class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API, |
| 541 public ::ppapi::Resource { | 541 public ::ppapi::Resource { |
| 542 public: | 542 public: |
| 543 explicit GamepadImpl(PepperPluginDelegateImpl* delegate); | 543 explicit GamepadImpl(PepperHelperImpl* helper); |
| 544 // Resource implementation. | 544 // Resource implementation. |
| 545 virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE; | 545 virtual ::ppapi::thunk::PPB_Gamepad_API* AsPPB_Gamepad_API() OVERRIDE; |
| 546 virtual void Sample(PP_Instance instance, | 546 virtual void Sample(PP_Instance instance, |
| 547 PP_GamepadsSampleData* data) OVERRIDE; | 547 PP_GamepadsSampleData* data) OVERRIDE; |
| 548 private: | 548 private: |
| 549 virtual ~GamepadImpl(); | 549 virtual ~GamepadImpl(); |
| 550 PepperPluginDelegateImpl* delegate_; | 550 PepperHelperImpl* helper_; |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 // See the static Create functions above for creating PepperPluginInstanceImpl | 553 // See the static Create functions above for creating PepperPluginInstanceImpl |
| 554 // objects. This constructor is private so that we can hide the | 554 // objects. This constructor is private so that we can hide the |
| 555 // PPP_Instance_Combined details while still having 1 constructor to maintain | 555 // PPP_Instance_Combined details while still having 1 constructor to maintain |
| 556 // for member initialization. | 556 // for member initialization. |
| 557 PepperPluginInstanceImpl(PepperPluginDelegateImpl* delegate, | 557 PepperPluginInstanceImpl(PepperHelperImpl* helper, |
| 558 RenderViewImpl* render_view, | 558 RenderViewImpl* render_view, |
| 559 PluginModule* module, | 559 PluginModule* module, |
| 560 ::ppapi::PPP_Instance_Combined* instance_interface, | 560 ::ppapi::PPP_Instance_Combined* instance_interface, |
| 561 WebKit::WebPluginContainer* container, | 561 WebKit::WebPluginContainer* container, |
| 562 const GURL& plugin_url); | 562 const GURL& plugin_url); |
| 563 | 563 |
| 564 bool LoadFindInterface(); | 564 bool LoadFindInterface(); |
| 565 bool LoadInputEventInterface(); | 565 bool LoadInputEventInterface(); |
| 566 bool LoadMessagingInterface(); | 566 bool LoadMessagingInterface(); |
| 567 bool LoadMouseLockInterface(); | 567 bool LoadMouseLockInterface(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 void KeepSizeAttributesBeforeFullscreen(); | 639 void KeepSizeAttributesBeforeFullscreen(); |
| 640 void SetSizeAttributesForFullscreen(); | 640 void SetSizeAttributesForFullscreen(); |
| 641 void ResetSizeAttributesAfterFullscreen(); | 641 void ResetSizeAttributesAfterFullscreen(); |
| 642 | 642 |
| 643 bool IsMouseLocked(); | 643 bool IsMouseLocked(); |
| 644 bool LockMouse(); | 644 bool LockMouse(); |
| 645 MouseLockDispatcher* GetMouseLockDispatcher(); | 645 MouseLockDispatcher* GetMouseLockDispatcher(); |
| 646 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); | 646 MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter(); |
| 647 void UnSetAndDeleteLockTargetAdapter(); | 647 void UnSetAndDeleteLockTargetAdapter(); |
| 648 | 648 |
| 649 PepperPluginDelegateImpl* delegate_; | 649 PepperHelperImpl* helper_; |
| 650 RenderViewImpl* render_view_; | 650 RenderViewImpl* render_view_; |
| 651 scoped_refptr<PluginModule> module_; | 651 scoped_refptr<PluginModule> module_; |
| 652 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 652 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
| 653 // If this is the NaCl plugin, we create a new module when we switch to the | 653 // If this is the NaCl plugin, we create a new module when we switch to the |
| 654 // IPC-based PPAPI proxy. Store the original module and instance interface | 654 // IPC-based PPAPI proxy. Store the original module and instance interface |
| 655 // so we can shut down properly. | 655 // so we can shut down properly. |
| 656 scoped_refptr<PluginModule> original_module_; | 656 scoped_refptr<PluginModule> original_module_; |
| 657 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; | 657 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; |
| 658 | 658 |
| 659 PP_Instance pp_instance_; | 659 PP_Instance pp_instance_; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 | 854 |
| 855 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; | 855 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; |
| 856 | 856 |
| 857 friend class PpapiPluginInstanceTest; | 857 friend class PpapiPluginInstanceTest; |
| 858 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 858 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
| 859 }; | 859 }; |
| 860 | 860 |
| 861 } // namespace content | 861 } // namespace content |
| 862 | 862 |
| 863 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 863 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
| OLD | NEW |