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

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

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 String MemoryCache::defaultCacheIdentifier() { 119 String MemoryCache::defaultCacheIdentifier() {
120 return emptyString; 120 return emptyString;
121 } 121 }
122 122
123 MemoryCache::ResourceMap* MemoryCache::ensureResourceMap( 123 MemoryCache::ResourceMap* MemoryCache::ensureResourceMap(
124 const String& cacheIdentifier) { 124 const String& cacheIdentifier) {
125 if (!m_resourceMaps.contains(cacheIdentifier)) { 125 if (!m_resourceMaps.contains(cacheIdentifier)) {
126 ResourceMapIndex::AddResult result = 126 ResourceMapIndex::AddResult result =
127 m_resourceMaps.add(cacheIdentifier, new ResourceMap); 127 m_resourceMaps.insert(cacheIdentifier, new ResourceMap);
128 CHECK(result.isNewEntry); 128 CHECK(result.isNewEntry);
129 } 129 }
130 return m_resourceMaps.get(cacheIdentifier); 130 return m_resourceMaps.get(cacheIdentifier);
131 } 131 }
132 132
133 void MemoryCache::add(Resource* resource) { 133 void MemoryCache::add(Resource* resource) {
134 DCHECK(resource); 134 DCHECK(resource);
135 ResourceMap* resources = ensureResourceMap(resource->cacheIdentifier()); 135 ResourceMap* resources = ensureResourceMap(resource->cacheIdentifier());
136 addInternal(resources, MemoryCacheEntry::create(resource)); 136 addInternal(resources, MemoryCacheEntry::create(resource));
137 RESOURCE_LOADING_DVLOG(1) << "MemoryCache::add Added " 137 RESOURCE_LOADING_DVLOG(1) << "MemoryCache::add Added "
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 } 459 }
460 return true; 460 return true;
461 } 461 }
462 462
463 void MemoryCache::onMemoryPressure(WebMemoryPressureLevel level) { 463 void MemoryCache::onMemoryPressure(WebMemoryPressureLevel level) {
464 pruneAll(); 464 pruneAll();
465 } 465 }
466 466
467 } // namespace blink 467 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698