MCPcopy Create free account
hub / github.com/anyrtcIO-Community/anyRTC-RTMP-OpenSource / GetOrCreateEntry

Method GetOrCreateEntry

webrtc/base/diskcache.cc:301–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301DiskCache::Entry* DiskCache::GetOrCreateEntry(const std::string& id,
302 bool create) {
303 EntryMap::iterator it = map_.find(id);
304 if (it != map_.end())
305 return &it->second;
306 if (!create)
307 return NULL;
308 Entry e;
309 e.lock_state = LS_UNLOCKED;
310 e.accessors = 0;
311 e.size = 0;
312 e.streams = 0;
313 e.last_modified = time(0);
314 it = map_.insert(EntryMap::value_type(id, e)).first;
315 return &it->second;
316}
317
318void DiskCache::ReleaseResource(const std::string& id, size_t index) const {
319 const Entry* entry = GetEntry(id);

Callers 2

ReleaseResourceMethod · 0.80
GetEntryMethod · 0.80

Calls 2

insertMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected