Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
index 3fb2c7c5dd72959b5a8581cc0cff544e06140084..4a1d61dc5ee79e26b30086f03c3e9dd1e3a28d5d 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
@@ -127,7 +127,7 @@ MemoryCache::ResourceMap* MemoryCache::ensureResourceMap(
m_resourceMaps.insert(cacheIdentifier, new ResourceMap);
CHECK(result.isNewEntry);
}
- return m_resourceMaps.get(cacheIdentifier);
+ return m_resourceMaps.at(cacheIdentifier);
}
void MemoryCache::add(Resource* resource) {
@@ -168,7 +168,7 @@ void MemoryCache::remove(Resource* resource) {
TRACE_EVENT1("blink", "MemoryCache::evict", "resource",
resource->url().getString().utf8());
- ResourceMap* resources = m_resourceMaps.get(resource->cacheIdentifier());
+ ResourceMap* resources = m_resourceMaps.at(resource->cacheIdentifier());
if (!resources)
return;
@@ -194,12 +194,11 @@ void MemoryCache::removeInternal(ResourceMap* resourceMap,
bool MemoryCache::contains(const Resource* resource) const {
if (!resource || resource->url().isEmpty())
return false;
- const ResourceMap* resources =
- m_resourceMaps.get(resource->cacheIdentifier());
+ const ResourceMap* resources = m_resourceMaps.at(resource->cacheIdentifier());
if (!resources)
return false;
KURL url = removeFragmentIdentifierIfNeeded(resource->url());
- MemoryCacheEntry* entry = resources->get(url);
+ MemoryCacheEntry* entry = resources->at(url);
return entry && resource == entry->resource();
}
@@ -213,11 +212,11 @@ Resource* MemoryCache::resourceForURL(const KURL& resourceURL,
if (!resourceURL.isValid() || resourceURL.isNull())
return nullptr;
DCHECK(!cacheIdentifier.isNull());
- const ResourceMap* resources = m_resourceMaps.get(cacheIdentifier);
+ const ResourceMap* resources = m_resourceMaps.at(cacheIdentifier);
if (!resources)
return nullptr;
MemoryCacheEntry* entry =
- resources->get(removeFragmentIdentifierIfNeeded(resourceURL));
+ resources->at(removeFragmentIdentifierIfNeeded(resourceURL));
if (!entry)
return nullptr;
return entry->resource();
@@ -229,7 +228,7 @@ HeapVector<Member<Resource>> MemoryCache::resourcesForURL(
KURL url = removeFragmentIdentifierIfNeeded(resourceURL);
HeapVector<Member<Resource>> results;
for (const auto& resourceMapIter : m_resourceMaps) {
- if (MemoryCacheEntry* entry = resourceMapIter.value->get(url)) {
+ if (MemoryCacheEntry* entry = resourceMapIter.value->at(url)) {
Resource* resource = entry->resource();
DCHECK(resource);
results.push_back(resource);

Powered by Google App Engine
This is Rietveld 408576698