| 209 | } |
| 210 | |
| 211 | Status ResourceMgr::DoDelete(const string& container, uint64 type_hash_code, |
| 212 | const string& resource_name, |
| 213 | const string& type_name) { |
| 214 | ResourceAndName resource_and_name; |
| 215 | { |
| 216 | mutex_lock l(mu_); |
| 217 | Container* b = gtl::FindPtrOrNull(containers_, container); |
| 218 | if (b == nullptr) { |
| 219 | return errors::NotFound("Container ", container, " does not exist."); |
| 220 | } |
| 221 | auto iter = b->find({type_hash_code, resource_name}); |
| 222 | if (iter == b->end()) { |
| 223 | return errors::NotFound("Resource ", container, "/", resource_name, "/", |
| 224 | type_name, " does not exist."); |
| 225 | } |
| 226 | std::swap(resource_and_name, iter->second); |
| 227 | b->erase(iter); |
| 228 | } |
| 229 | DCHECK(resource_and_name.resource != nullptr); |
| 230 | return Status::OK(); |
| 231 | } |
| 232 | |
| 233 | Status ResourceMgr::DoDelete(const string& container, TypeIndex type, |
| 234 | const string& resource_name) { |