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