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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 ppapi::thunk::ResourceCreationAPI& resource_creation() { | 142 ppapi::thunk::ResourceCreationAPI& resource_creation() { |
143 return *resource_creation_.get(); | 143 return *resource_creation_.get(); |
144 } | 144 } |
145 | 145 |
146 MessageChannel* message_channel() { return message_channel_; } | 146 MessageChannel* message_channel() { return message_channel_; } |
147 v8::Local<v8::Object> GetMessageChannelObject(); | 147 v8::Local<v8::Object> GetMessageChannelObject(); |
148 // Called when |message_channel_| is destroyed as it may be destroyed prior to | 148 // Called when |message_channel_| is destroyed as it may be destroyed prior to |
149 // the plugin being destroyed. | 149 // the plugin being destroyed. |
150 void MessageChannelDestroyed(); | 150 void MessageChannelDestroyed(); |
151 | 151 |
152 // Return the v8 context that the plugin is in. | 152 // Return the v8 context for the frame that the plugin is contained in. Care |
153 v8::Local<v8::Context> GetContext(); | 153 // should be taken to use the correct context for plugin<->JS interactions. |
| 154 // In cases where JS calls into the plugin, the caller's context should |
| 155 // typically be used. When calling from the plugin into JS, this context |
| 156 // should typically used. |
| 157 v8::Local<v8::Context> GetMainWorldContext(); |
154 | 158 |
155 // Does some pre-destructor cleanup on the instance. This is necessary | 159 // Does some pre-destructor cleanup on the instance. This is necessary |
156 // because some cleanup depends on the plugin instance still existing (like | 160 // because some cleanup depends on the plugin instance still existing (like |
157 // calling the plugin's DidDestroy function). This function is called from | 161 // calling the plugin's DidDestroy function). This function is called from |
158 // the WebPlugin implementation when WebKit is about to remove the plugin. | 162 // the WebPlugin implementation when WebKit is about to remove the plugin. |
159 void Delete(); | 163 void Delete(); |
160 | 164 |
161 // Returns true if Delete() has been called on this object. | 165 // Returns true if Delete() has been called on this object. |
162 bool is_deleted() const; | 166 bool is_deleted() const; |
163 | 167 |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; | 927 base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; |
924 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; | 928 base::WeakPtrFactory<PepperPluginInstanceImpl> weak_factory_; |
925 | 929 |
926 friend class PpapiPluginInstanceTest; | 930 friend class PpapiPluginInstanceTest; |
927 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); | 931 DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); |
928 }; | 932 }; |
929 | 933 |
930 } // namespace content | 934 } // namespace content |
931 | 935 |
932 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ | 936 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ |
OLD | NEW |