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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 ppapi::thunk::ResourceCreationAPI& resource_creation() { | 139 ppapi::thunk::ResourceCreationAPI& resource_creation() { |
140 return *resource_creation_.get(); | 140 return *resource_creation_.get(); |
141 } | 141 } |
142 | 142 |
143 // Does some pre-destructor cleanup on the instance. This is necessary | 143 // Does some pre-destructor cleanup on the instance. This is necessary |
144 // because some cleanup depends on the plugin instance still existing (like | 144 // because some cleanup depends on the plugin instance still existing (like |
145 // calling the plugin's DidDestroy function). This function is called from | 145 // calling the plugin's DidDestroy function). This function is called from |
146 // the WebPlugin implementation when WebKit is about to remove the plugin. | 146 // the WebPlugin implementation when WebKit is about to remove the plugin. |
147 void Delete(); | 147 void Delete(); |
148 | 148 |
| 149 // Returns true if Delete() has been called on this object. |
| 150 bool is_deleted() const; |
| 151 |
149 // Paints the current backing store to the web page. | 152 // Paints the current backing store to the web page. |
150 void Paint(blink::WebCanvas* canvas, | 153 void Paint(blink::WebCanvas* canvas, |
151 const gfx::Rect& plugin_rect, | 154 const gfx::Rect& plugin_rect, |
152 const gfx::Rect& paint_rect); | 155 const gfx::Rect& paint_rect); |
153 | 156 |
154 // Schedules a paint of the page for the given region. The coordinates are | 157 // Schedules a paint of the page for the given region. The coordinates are |
155 // relative to the top-left of the plugin. This does nothing if the plugin | 158 // relative to the top-left of the plugin. This does nothing if the plugin |
156 // has not yet been positioned. You can supply an empty gfx::Rect() to | 159 // has not yet been positioned. You can supply an empty gfx::Rect() to |
157 // invalidate the entire plugin. | 160 // invalidate the entire plugin. |
158 void InvalidateRect(const gfx::Rect& rect); | 161 void InvalidateRect(const gfx::Rect& rect); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 // Dummy NPP value used when calling in to WebBindings, to allow the bindings | 843 // Dummy NPP value used when calling in to WebBindings, to allow the bindings |
841 // to correctly track NPObjects belonging to this plugin instance. | 844 // to correctly track NPObjects belonging to this plugin instance. |
842 scoped_ptr<struct _NPP> npp_; | 845 scoped_ptr<struct _NPP> npp_; |
843 | 846 |
844 // We store the isolate at construction so that we can be sure to use the | 847 // We store the isolate at construction so that we can be sure to use the |
845 // Isolate in which this Instance was created when interacting with v8. | 848 // Isolate in which this Instance was created when interacting with v8. |
846 v8::Isolate* isolate_; | 849 v8::Isolate* isolate_; |
847 | 850 |
848 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; | 851 scoped_ptr<MouseLockDispatcher::LockTarget> lock_target_; |
849 | 852 |
| 853 bool is_deleted_; |
| 854 |
850 // We use a weak ptr factory for scheduling DidChangeView events so that we | 855 // We use a weak ptr factory for scheduling DidChangeView events so that we |
851 // can tell whether updates are pending and consolidate them. When there's | 856 // can tell whether updates are pending and consolidate them. When there's |
852 // already a weak ptr pending (HasWeakPtrs is true), code should update the | 857 // already a weak ptr pending (HasWeakPtrs is true), code should update the |
853 // view_data_ but not send updates. This also allows us to cancel scheduled | 858 // view_data_ but not send updates. This also allows us to cancel scheduled |
854 // view change events. | 859 // view change events. |
855 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; | 860 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; |
856 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; | 861 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; |
857 | 862 |
858 friend class PpapiPluginInstanceTest; | 863 friend class PpapiPluginInstanceTest; |
859 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 864 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
860 }; | 865 }; |
861 | 866 |
862 } // namespace content | 867 } // namespace content |
863 | 868 |
864 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 869 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
OLD | NEW |