summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/plugin_dispatcher.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 00:26:43 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 00:26:43 +0000
commit4614f1974881ecfd0a0118683bac628c6128c2a9 (patch)
treec69836459560dd8003f7e18ca554f2e1d7f79b4d /ppapi/proxy/plugin_dispatcher.h
parentb8e6654fb91108033580f510e2d411093936fc2f (diff)
downloadchromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.zip
chromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.tar.gz
chromium_src-4614f1974881ecfd0a0118683bac628c6128c2a9.tar.bz2
First pass at making the proxy handle multiple renderers. This associates the
instance with resources and has most callers retrieve the dispatcher according to the appropriate instance. This isn't hooked up to anything yet. This changes some PPB_Flash interface methods to use PP_Bool. The most challenging part of the change is in the plugin_var_tracker which now needs to track which dispatcher each var object came from, and remap var IDs since each renderer will be generating var IDs in its own space, which will likely overlap. A similar system will need to be done for resources which is not implemented yet. I added some null checks in audio_impl because audio_ can be NULL in some cases when using the trusted API. I discovered this when testing NaCl for this patch. Review URL: http://codereview.chromium.org/6282007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_dispatcher.h')
-rw-r--r--ppapi/proxy/plugin_dispatcher.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 924b611..6ce5c14 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -9,10 +9,8 @@
#include "base/process.h"
#include "base/scoped_ptr.h"
-#include "ppapi/proxy/callback_tracker.h"
+#include "ppapi/c/pp_instance.h"
#include "ppapi/proxy/dispatcher.h"
-#include "ppapi/proxy/plugin_resource_tracker.h"
-#include "ppapi/proxy/plugin_var_tracker.h"
class MessageLoop;
@@ -36,30 +34,30 @@ class PluginDispatcher : public Dispatcher {
ShutdownModuleFunc shutdown_module);
~PluginDispatcher();
- // The plugin maintains a global Dispatcher pointer. There is only one since
- // there is only one connection to the browser. Don't call this on the
- // browser side, see GetForInstnace.
+ // Sets/gets the global dispatcher pointer. New code should use the
+ // GetForInstance version below, this is currently here as a stopgap while
+ // the transition is being made.
+ //
+ // TODO(brettw) remove this.
static PluginDispatcher* Get();
static void SetGlobal(PluginDispatcher* dispatcher);
+ // The plugin side maintains a mapping from PP_Instance to Dispatcher so
+ // that we can send the messages to the right channel if there are multiple
+ // renderers sharing the same plugin.
+ static PluginDispatcher* GetForInstance(PP_Instance instance);
+ /* TODO(brettw) enable this when Get() is removed.
+ static void SetForInstance(PP_Instance instance,
+ PluginDispatcher* dispatcher);
+ static void RemoveForInstance(PP_Instance instance);
+ */
+
// Dispatcher overrides.
virtual bool IsPlugin() const;
// IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
- // Returns the resource tracker for the plugin. In the browser process this
- // will return NULL.
- PluginResourceTracker* plugin_resource_tracker() {
- return plugin_resource_tracker_.get();
- }
-
- // Returns the var tracker for the plugin. In the browser process this
- // will return NULL.
- PluginVarTracker* plugin_var_tracker() {
- return plugin_var_tracker_.get();
- }
-
private:
// IPC message handlers.
void OnMsgInitializeModule(PP_Module pp_module, bool* result);
@@ -68,9 +66,6 @@ class PluginDispatcher : public Dispatcher {
InitModuleFunc init_module_;
ShutdownModuleFunc shutdown_module_;
- scoped_ptr<PluginResourceTracker> plugin_resource_tracker_;
- scoped_ptr<PluginVarTracker> plugin_var_tracker_;
-
DISALLOW_COPY_AND_ASSIGN(PluginDispatcher);
};