Lines Matching refs:resource
41 virtual void AddObserverTypeProxy(const void* resource) = 0;
42 virtual void RemoveObserverTypeProxy(const void* resource) = 0;
44 int AddImpl(const void* resource);
45 void RemoveImpl(const void* resource);
47 bool ContainsResourceImpl(const void* resource);
50 int GetHandleImpl(const void* resource);
51 void HandleCloseNotification(const void* resource);
66 // a particular kind of application resource (like windows or tabs) for
68 // define are AddObserver and RemoveObserver for the given resource's
79 // resource closing notification.
80 virtual void AddObserver(T resource) = 0;
81 virtual void RemoveObserver(T resource) = 0;
83 // Adds the given resource to this tracker, and returns a handle that
84 // can be used to refer to that resource. If the resource is already
86 int Add(T resource) {
87 return AddImpl(resource);
90 // Removes the given resource from this tracker. If the resource is not
92 void Remove(T resource) {
93 RemoveImpl(resource);
96 // Returns true if this tracker currently tracks the resource pointed to
98 bool ContainsResource(T resource) {
99 return ContainsResourceImpl(resource);
107 // Returns the resource pointer associated with a given handle, or NULL
114 // Returns the handle associated with a given resource pointer, or 0 if
115 // the resource is not currently in the mapping.
116 int GetHandle(T resource) {
117 return GetHandleImpl(resource);
126 T resource =
129 CloseResource(resource);
133 // Removes |resource| from the tracker, and handles sending the close
136 // for the resource type.
137 void CloseResource(T resource) {
138 HandleCloseNotification(resource);
143 virtual void AddObserverTypeProxy(const void* resource) {
144 AddObserver(static_cast<T>(const_cast<void*>(resource)));
146 virtual void RemoveObserverTypeProxy(const void* resource) {
147 RemoveObserver(static_cast<T>(const_cast<void*>(resource)));