Lines Matching refs:RESOURCE
19 // All resource types should be added here. This implements our hand-rolled
100 // Forward declare all the resource APIs.
102 #define DECLARE_RESOURCE_CLASS(RESOURCE) class RESOURCE;
108 // in-process ("impl") resource in the host (renderer) process, or when they're
109 // a proxied resource in the plugin process. This enum differentiates those
116 class PPAPI_SHARED_EXPORT Resource : public base::RefCounted<Resource> {
121 // associated instance, and generates a new resource ID. The host resource
122 // will be the same as the newly-generated resource ID. For all objects in
128 // host. If you have a host resource ID, use the constructor below which
130 Resource(ResourceObjectType type, PP_Instance instance);
132 // For constructing given a host resource.
134 // For OBJECT_IS_PROXY objects, this takes the resource generated in the host
135 // side, stores it, and allocates a "local" resource ID for use in the
138 // For OBJECT_IS_IMPL, the host resource ID must be 0, since there should be
139 // no host resource generated (impl objects should generate their own). The
141 // some shared objects use a host resource for both modes to keep things the
143 Resource(ResourceObjectType type, const HostResource& host_resource);
148 // PPB_MessageLoop resource for the main thread.
150 explicit Resource(Untracked);
152 virtual ~Resource();
156 // Returns the resource ID for this object in the current process without
160 // Returns the host resource which identifies the resource in the host side
162 // this just identifies the in-process resource ID & instance.
165 // Adds a ref on behalf of the plugin and returns the resource ID. This is
166 // normally used when returning a resource to the plugin, where it's
167 // expecting the returned resource to have ownership of a ref passed.
171 // Called by the resource tracker when the last reference from the plugin
172 // was released. For a few types of resources, the resource could still
180 // Called by the resource tracker when the instance is going away but the
183 // resource alive.
185 // You will want to override this if your resource does some kind of
196 #define DEFINE_TYPE_GETTER(RESOURCE) \
197 virtual thunk::RESOURCE* As##RESOURCE();
203 // resource (or if a developer forgets to add the resource to the list in
221 // Logs a message to the console from this resource.
224 // Removes the resource from the ResourceTracker's tables. This normally
225 // happens as part of Resource destruction, but if a subclass destructor
228 // with the destruction. If the resource is not in the ResourceTracker's
241 DISALLOW_IMPLICIT_CONSTRUCTORS(Resource);
246 #define DEFINE_RESOURCE_CAST(RESOURCE) \
247 template<> inline thunk::RESOURCE* Resource::GetAs() { \
248 return As##RESOURCE(); \