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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 m_openDatabaseMap->set(originString, nameMap); 104 m_openDatabaseMap->set(originString, nameMap);
105 } 105 }
106 106
107 String name(database->stringIdentifier()); 107 String name(database->stringIdentifier());
108 DatabaseSet* databaseSet = nameMap->get(name); 108 DatabaseSet* databaseSet = nameMap->get(name);
109 if (!databaseSet) { 109 if (!databaseSet) {
110 databaseSet = new DatabaseSet(); 110 databaseSet = new DatabaseSet();
111 nameMap->set(name, databaseSet); 111 nameMap->set(name, databaseSet);
112 } 112 }
113 113
114 databaseSet->add(database); 114 databaseSet->insert(database);
115 } 115 }
116 116
117 void DatabaseTracker::removeOpenDatabase(Database* database) { 117 void DatabaseTracker::removeOpenDatabase(Database* database) {
118 { 118 {
119 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); 119 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
120 String originString = database->getSecurityOrigin()->toRawString(); 120 String originString = database->getSecurityOrigin()->toRawString();
121 ASSERT(m_openDatabaseMap); 121 ASSERT(m_openDatabaseMap);
122 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString); 122 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString);
123 if (!nameMap) 123 if (!nameMap)
124 return; 124 return;
(...skipping 109 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