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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "cc/layers/content_layer_client.h" |
18 #include "cc/layers/texture_layer_client.h" | 19 #include "cc/layers/texture_layer_client.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
20 #include "content/public/renderer/pepper_plugin_instance.h" | 21 #include "content/public/renderer/pepper_plugin_instance.h" |
21 #include "content/renderer/mouse_lock_dispatcher.h" | 22 #include "content/renderer/mouse_lock_dispatcher.h" |
22 #include "content/renderer/pepper/ppp_pdf.h" | 23 #include "content/renderer/pepper/ppp_pdf.h" |
23 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 24 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
24 #include "ppapi/c/dev/ppp_find_dev.h" | 25 #include "ppapi/c/dev/ppp_find_dev.h" |
25 #include "ppapi/c/dev/ppp_printing_dev.h" | 26 #include "ppapi/c/dev/ppp_printing_dev.h" |
26 #include "ppapi/c/dev/ppp_selection_dev.h" | 27 #include "ppapi/c/dev/ppp_selection_dev.h" |
27 #include "ppapi/c/dev/ppp_text_input_dev.h" | 28 #include "ppapi/c/dev/ppp_text_input_dev.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 class RenderViewImpl; | 108 class RenderViewImpl; |
108 | 109 |
109 // Represents one time a plugin appears on one web page. | 110 // Represents one time a plugin appears on one web page. |
110 // | 111 // |
111 // 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 |
112 // ResourceTracker. | 113 // ResourceTracker. |
113 class CONTENT_EXPORT PepperPluginInstanceImpl | 114 class CONTENT_EXPORT PepperPluginInstanceImpl |
114 : public base::RefCounted<PepperPluginInstanceImpl>, | 115 : public base::RefCounted<PepperPluginInstanceImpl>, |
115 public base::SupportsWeakPtr<PepperPluginInstanceImpl>, | 116 public base::SupportsWeakPtr<PepperPluginInstanceImpl>, |
116 public NON_EXPORTED_BASE(PepperPluginInstance), | 117 public NON_EXPORTED_BASE(PepperPluginInstance), |
117 public ppapi::PPB_Instance_Shared { | 118 public ppapi::PPB_Instance_Shared, |
| 119 public NON_EXPORTED_BASE(cc::TextureLayerClient) { |
118 public: | 120 public: |
119 // Create and return a PepperPluginInstanceImpl object which supports the most | 121 // Create and return a PepperPluginInstanceImpl object which supports the most |
120 // recent version of PPP_Instance possible by querying the given | 122 // recent version of PPP_Instance possible by querying the given |
121 // get_plugin_interface function. If the plugin does not support any valid | 123 // get_plugin_interface function. If the plugin does not support any valid |
122 // PPP_Instance interface, returns NULL. | 124 // PPP_Instance interface, returns NULL. |
123 static PepperPluginInstanceImpl* Create( | 125 static PepperPluginInstanceImpl* Create( |
124 RenderViewImpl* render_view, | 126 RenderViewImpl* render_view, |
125 PluginModule* module, | 127 PluginModule* module, |
126 WebKit::WebPluginContainer* container, | 128 WebKit::WebPluginContainer* container, |
127 const GURL& plugin_url); | 129 const GURL& plugin_url); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 bool IsValidInstanceOf(PluginModule* module); | 491 bool IsValidInstanceOf(PluginModule* module); |
490 | 492 |
491 // Returns the plugin NPP identifier that this plugin will use to identify | 493 // Returns the plugin NPP identifier that this plugin will use to identify |
492 // itself when making NPObject scripting calls to WebBindings. | 494 // itself when making NPObject scripting calls to WebBindings. |
493 struct _NPP* instanceNPP(); | 495 struct _NPP* instanceNPP(); |
494 | 496 |
495 // Returns the v8::Isolate that was current when this Instance was created. | 497 // Returns the v8::Isolate that was current when this Instance was created. |
496 // This is not inlined so as to avoid an unnecessary header include of v8.h. | 498 // This is not inlined so as to avoid an unnecessary header include of v8.h. |
497 v8::Isolate* GetIsolate() const; | 499 v8::Isolate* GetIsolate() const; |
498 | 500 |
| 501 // cc::TextureLayerClient implementation. |
| 502 virtual unsigned PrepareTexture() OVERRIDE; |
| 503 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 504 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox, |
| 505 bool use_shared_memory) OVERRIDE; |
| 506 |
499 private: | 507 private: |
500 friend class base::RefCounted<PepperPluginInstanceImpl>; | 508 friend class base::RefCounted<PepperPluginInstanceImpl>; |
501 friend class PpapiUnittest; | 509 friend class PpapiUnittest; |
502 | 510 |
503 // Delete should be called by the WebPlugin before this destructor. | 511 // Delete should be called by the WebPlugin before this destructor. |
504 virtual ~PepperPluginInstanceImpl(); | 512 virtual ~PepperPluginInstanceImpl(); |
505 | 513 |
506 // Class to record document load notifications and play them back once the | 514 // Class to record document load notifications and play them back once the |
507 // real document loader becomes available. Used only by external instances. | 515 // real document loader becomes available. Used only by external instances. |
508 class ExternalDocumentLoader : public WebKit::WebURLLoaderClient { | 516 class ExternalDocumentLoader : public WebKit::WebURLLoaderClient { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 scoped_refptr<PluginModule> original_module_; | 659 scoped_refptr<PluginModule> original_module_; |
652 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; | 660 scoped_ptr<ppapi::PPP_Instance_Combined> original_instance_interface_; |
653 | 661 |
654 PP_Instance pp_instance_; | 662 PP_Instance pp_instance_; |
655 | 663 |
656 // NULL until we have been initialized. | 664 // NULL until we have been initialized. |
657 WebKit::WebPluginContainer* container_; | 665 WebKit::WebPluginContainer* container_; |
658 scoped_refptr<cc::TextureLayer> texture_layer_; | 666 scoped_refptr<cc::TextureLayer> texture_layer_; |
659 scoped_ptr<WebKit::WebLayer> web_layer_; | 667 scoped_ptr<WebKit::WebLayer> web_layer_; |
660 bool layer_bound_to_fullscreen_; | 668 bool layer_bound_to_fullscreen_; |
| 669 bool layer_is_hardware_; |
661 | 670 |
662 // Plugin URL. | 671 // Plugin URL. |
663 GURL plugin_url_; | 672 GURL plugin_url_; |
664 | 673 |
665 // Indicates whether this is a full frame instance, which means it represents | 674 // Indicates whether this is a full frame instance, which means it represents |
666 // an entire document rather than an embed tag. | 675 // an entire document rather than an embed tag. |
667 bool full_frame_; | 676 bool full_frame_; |
668 | 677 |
669 // Stores the current state of the plugin view. | 678 // Stores the current state of the plugin view. |
670 ppapi::ViewData view_data_; | 679 ppapi::ViewData view_data_; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 | 858 |
850 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; | 859 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; |
851 | 860 |
852 friend class PpapiPluginInstanceTest; | 861 friend class PpapiPluginInstanceTest; |
853 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 862 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
854 }; | 863 }; |
855 | 864 |
856 } // namespace content | 865 } // namespace content |
857 | 866 |
858 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 867 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
OLD | NEW |