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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp

Issue 2673543003: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 DatabaseSet* databaseSet = nameMap->get(name); 127 DatabaseSet* databaseSet = nameMap->get(name);
128 if (!databaseSet) 128 if (!databaseSet)
129 return; 129 return;
130 130
131 DatabaseSet::iterator found = databaseSet->find(database); 131 DatabaseSet::iterator found = databaseSet->find(database);
132 if (found == databaseSet->end()) 132 if (found == databaseSet->end())
133 return; 133 return;
134 134
135 databaseSet->remove(found); 135 databaseSet->remove(found);
136 if (databaseSet->isEmpty()) { 136 if (databaseSet->isEmpty()) {
137 nameMap->remove(name); 137 nameMap->erase(name);
138 delete databaseSet; 138 delete databaseSet;
139 if (nameMap->isEmpty()) { 139 if (nameMap->isEmpty()) {
140 m_openDatabaseMap->remove(originString); 140 m_openDatabaseMap->erase(originString);
141 delete nameMap; 141 delete nameMap;
142 } 142 }
143 } 143 }
144 } 144 }
145 databaseClosed(database); 145 databaseClosed(database);
146 } 146 }
147 147
148 void DatabaseTracker::prepareToOpenDatabase(Database* database) { 148 void DatabaseTracker::prepareToOpenDatabase(Database* database) {
149 ASSERT( 149 ASSERT(
150 database->getDatabaseContext()->getExecutionContext()->isContextThread()); 150 database->getDatabaseContext()->getExecutionContext()->isContextThread());
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (found == databaseSet->end()) 234 if (found == databaseSet->end())
235 return; 235 return;
236 } 236 }
237 237
238 // And we have to call closeImmediately() without our collection lock being 238 // And we have to call closeImmediately() without our collection lock being
239 // held. 239 // held.
240 database->closeImmediately(); 240 database->closeImmediately();
241 } 241 }
242 242
243 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698