diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-10 22:22:46 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-10 22:22:46 +0000 |
commit | 93df81ea498b7ee1afb839ae58fafaf445fa8054 (patch) | |
tree | 9c0773fb4c69bbebdbd63295c73b84293a1ea5c7 /webkit | |
parent | b556c2ea563365710107e788eea58d09239b9b50 (diff) | |
download | chromium_src-93df81ea498b7ee1afb839ae58fafaf445fa8054.zip chromium_src-93df81ea498b7ee1afb839ae58fafaf445fa8054.tar.gz chromium_src-93df81ea498b7ee1afb839ae58fafaf445fa8054.tar.bz2 |
Bluetooth API: improve discovery
This CL:
- eliminates unnecessary dispatches
- correctly handles devices that are discovered before interest is
registered
TEST=ran api test
BUG=133179
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150898
Review URL: https://chromiumcodereview.appspot.com/10815072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151138 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 8 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.h | 19 |
2 files changed, 27 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index accc029..3da896e 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -460,6 +460,14 @@ PluginModule::~PluginModule() { // previous parts of the destructor. } +void PluginModule::SetEmbedderState(scoped_ptr<EmbedderState> state) { + embedder_state_ = state.Pass(); +} + +PluginModule::EmbedderState* PluginModule::GetEmbedderState() { + return embedder_state_.get(); +} + bool PluginModule::InitAsInternalPlugin(const EntryPoints& entry_points) { if (InitializeModule(entry_points)) { entry_points_ = entry_points; diff --git a/webkit/plugins/ppapi/plugin_module.h b/webkit/plugins/ppapi/plugin_module.h index 827546f..7301723 100644 --- a/webkit/plugins/ppapi/plugin_module.h +++ b/webkit/plugins/ppapi/plugin_module.h @@ -61,6 +61,14 @@ class WEBKIT_PLUGINS_EXPORT PluginModule : PPP_ShutdownModuleFunc shutdown_module; // Optional, may be NULL. }; + // Allows the embedder to associate a class with this module. This is opaque + // from the PluginModule's perspective (see Set/GetEmbedderState below) but + // the module is in charge of deleting the class. + class EmbedderState { + public: + virtual ~EmbedderState() {} + }; + typedef std::set<PluginInstance*> PluginInstanceSet; // You must call one of the Init functions after the constructor to create a @@ -76,6 +84,14 @@ class WEBKIT_PLUGINS_EXPORT PluginModule : ~PluginModule(); + // Sets the given class as being associated with this module. It will be + // deleted when the module is destroyed. You can only set it once, subsequent + // sets will assert. + // + // See EmbedderState above for more. + void SetEmbedderState(scoped_ptr<EmbedderState> state); + EmbedderState* GetEmbedderState(); + // Initializes this module as an internal plugin with the given entrypoints. // This is used for "plugins" compiled into Chrome. Returns true on success. // False means that the plugin can not be used. @@ -163,6 +179,9 @@ class WEBKIT_PLUGINS_EXPORT PluginModule : // Note: This may be null. PluginDelegate::ModuleLifetime* lifetime_delegate_; + // See EmbedderState above. + scoped_ptr<EmbedderState> embedder_state_; + // Tracker for completion callbacks, used mainly to ensure that all callbacks // are properly aborted on module shutdown. scoped_refptr< ::ppapi::CallbackTracker> callback_tracker_; |