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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (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) 2007, 2008, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2013 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up. 125 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up.
126 m_cleanupSync->signal(); 126 m_cleanupSync->signal();
127 } 127 }
128 128
129 void DatabaseThread::recordDatabaseOpen(Database* database) { 129 void DatabaseThread::recordDatabaseOpen(Database* database) {
130 ASSERT(isDatabaseThread()); 130 ASSERT(isDatabaseThread());
131 ASSERT(database); 131 ASSERT(database);
132 ASSERT(!m_openDatabaseSet.contains(database)); 132 ASSERT(!m_openDatabaseSet.contains(database));
133 MutexLocker lock(m_terminationRequestedMutex); 133 MutexLocker lock(m_terminationRequestedMutex);
134 if (!m_terminationRequested) 134 if (!m_terminationRequested)
135 m_openDatabaseSet.add(database); 135 m_openDatabaseSet.insert(database);
136 } 136 }
137 137
138 void DatabaseThread::recordDatabaseClosed(Database* database) { 138 void DatabaseThread::recordDatabaseClosed(Database* database) {
139 ASSERT(isDatabaseThread()); 139 ASSERT(isDatabaseThread());
140 ASSERT(database); 140 ASSERT(database);
141 #if DCHECK_IS_ON() 141 #if DCHECK_IS_ON()
142 { 142 {
143 MutexLocker lock(m_terminationRequestedMutex); 143 MutexLocker lock(m_terminationRequestedMutex);
144 ASSERT(m_terminationRequested || m_openDatabaseSet.contains(database)); 144 ASSERT(m_terminationRequested || m_openDatabaseSet.contains(database));
145 } 145 }
(...skipping 21 matching lines...) Expand all
167 MutexLocker lock(m_terminationRequestedMutex); 167 MutexLocker lock(m_terminationRequestedMutex);
168 ASSERT(!m_terminationRequested); 168 ASSERT(!m_terminationRequested);
169 } 169 }
170 #endif 170 #endif
171 // WebThread takes ownership of the task. 171 // WebThread takes ownership of the task.
172 m_thread->postTask(BLINK_FROM_HERE, 172 m_thread->postTask(BLINK_FROM_HERE,
173 crossThreadBind(&DatabaseTask::run, std::move(task))); 173 crossThreadBind(&DatabaseTask::run, std::move(task)));
174 } 174 }
175 175
176 } // namespace blink 176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698