| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // TODO: Need to deal with NPAPI's NPSavedData. | 5 // TODO: Need to deal with NPAPI's NPSavedData. |
| 6 // I haven't seen plugins use it yet. | 6 // I haven't seen plugins use it yet. |
| 7 | 7 |
| 8 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 8 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| 9 #define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 9 #define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| 10 | 10 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 static PluginInstance* SetInitializingInstance(PluginInstance* instance); | 185 static PluginInstance* SetInitializingInstance(PluginInstance* instance); |
| 186 static PluginInstance* GetInitializingInstance(); | 186 static PluginInstance* GetInitializingInstance(); |
| 187 | 187 |
| 188 void PushPopupsEnabledState(bool enabled); | 188 void PushPopupsEnabledState(bool enabled); |
| 189 void PopPopupsEnabledState(); | 189 void PopPopupsEnabledState(); |
| 190 | 190 |
| 191 bool popups_allowed() const { | 191 bool popups_allowed() const { |
| 192 return popups_enabled_stack_.empty() ? false : popups_enabled_stack_.top(); | 192 return popups_enabled_stack_.empty() ? false : popups_enabled_stack_.top(); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Initiates byte range reads for plugins. |
| 196 void RequestRead(NPStream* stream, NPByteRange* range_list); |
| 197 |
| 195 private: | 198 private: |
| 196 void OnPluginThreadAsyncCall(void (*func)(void *), | 199 void OnPluginThreadAsyncCall(void (*func)(void *), |
| 197 void *userData); | 200 void *userData); |
| 198 bool IsValidStream(const NPStream* stream); | 201 bool IsValidStream(const NPStream* stream); |
| 199 | 202 |
| 200 // This is a hack to get the real player plugin to work with chrome | 203 // This is a hack to get the real player plugin to work with chrome |
| 201 // The real player plugin dll(nppl3260) when loaded by firefox is loaded via | 204 // The real player plugin dll(nppl3260) when loaded by firefox is loaded via |
| 202 // the NS COM API which is analogous to win32 COM. So the NPAPI functions in | 205 // the NS COM API which is analogous to win32 COM. So the NPAPI functions in |
| 203 // the plugin are invoked via an interface by firefox. The plugin instance | 206 // the plugin are invoked via an interface by firefox. The plugin instance |
| 204 // handle which is passed to every NPAPI method is owned by the real player | 207 // handle which is passed to every NPAPI method is owned by the real player |
| (...skipping 26 matching lines...) Expand all Loading... |
| 231 GURL get_url_; | 234 GURL get_url_; |
| 232 void* get_notify_data_; | 235 void* get_notify_data_; |
| 233 bool use_mozilla_user_agent_; | 236 bool use_mozilla_user_agent_; |
| 234 scoped_refptr<MozillaExtensionApi> mozilla_extenstions_; | 237 scoped_refptr<MozillaExtensionApi> mozilla_extenstions_; |
| 235 MessageLoop* message_loop_; | 238 MessageLoop* message_loop_; |
| 236 // Using TLS to store PluginInstance object during its creation. | 239 // Using TLS to store PluginInstance object during its creation. |
| 237 // We need to pass this instance to the service manager | 240 // We need to pass this instance to the service manager |
| 238 // (MozillaExtensionApi) created as a result of NPN_GetValue | 241 // (MozillaExtensionApi) created as a result of NPN_GetValue |
| 239 // in the context of NP_Initialize. | 242 // in the context of NP_Initialize. |
| 240 static ThreadLocalStorage::Slot plugin_instance_tls_index_; | 243 static ThreadLocalStorage::Slot plugin_instance_tls_index_; |
| 241 scoped_refptr<PluginDataStream> plugin_data_stream_; | 244 scoped_refptr<PluginStreamUrl> plugin_data_stream_; |
| 242 GURL instance_url_; | 245 GURL instance_url_; |
| 243 | 246 |
| 244 // This flag if true indicates that the plugin data would be passed from | 247 // This flag if true indicates that the plugin data would be passed from |
| 245 // webkit. if false indicates that the plugin should download the data. | 248 // webkit. if false indicates that the plugin should download the data. |
| 246 bool load_manually_; | 249 bool load_manually_; |
| 247 | 250 |
| 248 // This flag indicates if the NPN_InvalidateRect calls made by the | 251 // This flag indicates if the NPN_InvalidateRect calls made by the |
| 249 // plugin need to be throttled. | 252 // plugin need to be throttled. |
| 250 bool throttle_invalidate_; | 253 bool throttle_invalidate_; |
| 251 | 254 |
| 252 // Stack indicating if popups are to be enabled for the outgoing | 255 // Stack indicating if popups are to be enabled for the outgoing |
| 253 // NPN_GetURL/NPN_GetURLNotify calls. | 256 // NPN_GetURL/NPN_GetURLNotify calls. |
| 254 std::stack<bool> popups_enabled_stack_; | 257 std::stack<bool> popups_enabled_stack_; |
| 255 | 258 |
| 256 // True if in CloseStreams(). | 259 // True if in CloseStreams(). |
| 257 bool in_close_streams_; | 260 bool in_close_streams_; |
| 258 | 261 |
| 259 DISALLOW_EVIL_CONSTRUCTORS(PluginInstance); | 262 DISALLOW_EVIL_CONSTRUCTORS(PluginInstance); |
| 260 }; | 263 }; |
| 261 | 264 |
| 262 } // namespace NPAPI | 265 } // namespace NPAPI |
| 263 | 266 |
| 264 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 267 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| OLD | NEW |