diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 00:26:43 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-21 00:26:43 +0000 |
commit | 4614f1974881ecfd0a0118683bac628c6128c2a9 (patch) | |
tree | c69836459560dd8003f7e18ca554f2e1d7f79b4d /ppapi/proxy/plugin_resource.h | |
parent | b8e6654fb91108033580f510e2d411093936fc2f (diff) | |
download | chromium_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_resource.h')
-rw-r--r-- | ppapi/proxy/plugin_resource.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ppapi/proxy/plugin_resource.h b/ppapi/proxy/plugin_resource.h index 780a2bd..8eee931 100644 --- a/ppapi/proxy/plugin_resource.h +++ b/ppapi/proxy/plugin_resource.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #define PPAPI_PROXY_PLUGIN_RESOURCE_H_ #include "base/basictypes.h" +#include "ppapi/c/pp_instance.h" #include "ppapi/proxy/plugin_dispatcher.h" #include "ppapi/proxy/plugin_resource_tracker.h" @@ -32,19 +33,20 @@ FOR_ALL_PLUGIN_RESOURCES(DECLARE_RESOURCE_CLASS) class PluginResource { public: - PluginResource(); + PluginResource(PP_Instance instance); virtual ~PluginResource(); // Returns NULL if the resource is invalid or is a different type. template<typename T> static T* GetAs(PP_Resource res) { PluginResource* resource = - PluginDispatcher::Get()->plugin_resource_tracker()->GetResourceObject( - res); + PluginResourceTracker::GetInstance()->GetResourceObject(res); return resource ? resource->Cast<T>() : NULL; } template <typename T> T* Cast() { return NULL; } + PP_Instance instance() const { return instance_; } + private: // Type-specific getters for individual resource types. These will return // NULL if the resource does not match the specified type. Used by the Cast() @@ -54,6 +56,9 @@ class PluginResource { FOR_ALL_PLUGIN_RESOURCES(DEFINE_TYPE_GETTER) #undef DEFINE_TYPE_GETTER + // Instance this resource is associated with. + PP_Instance instance_; + DISALLOW_COPY_AND_ASSIGN(PluginResource); }; |