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

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

Issue 2696183002: Migrate WTF::HashSet::remove() to ::erase() [part 1] (Closed)
Patch Set: one more platform-specific reference 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 String dbIdentifier = getDatabaseIdentifier(transaction); 98 String dbIdentifier = getDatabaseIdentifier(transaction);
99 99
100 CoordinationInfoHeapMap::iterator coordinationInfoIterator = 100 CoordinationInfoHeapMap::iterator coordinationInfoIterator =
101 m_coordinationInfoMap.find(dbIdentifier); 101 m_coordinationInfoMap.find(dbIdentifier);
102 SECURITY_DCHECK(coordinationInfoIterator != m_coordinationInfoMap.end()); 102 SECURITY_DCHECK(coordinationInfoIterator != m_coordinationInfoMap.end());
103 CoordinationInfo& info = coordinationInfoIterator->value; 103 CoordinationInfo& info = coordinationInfoIterator->value;
104 104
105 if (transaction->isReadOnly()) { 105 if (transaction->isReadOnly()) {
106 ASSERT(info.activeReadTransactions.contains(transaction)); 106 ASSERT(info.activeReadTransactions.contains(transaction));
107 info.activeReadTransactions.remove(transaction); 107 info.activeReadTransactions.erase(transaction);
108 } else { 108 } else {
109 ASSERT(info.activeWriteTransaction == transaction); 109 ASSERT(info.activeWriteTransaction == transaction);
110 info.activeWriteTransaction = nullptr; 110 info.activeWriteTransaction = nullptr;
111 } 111 }
112 112
113 processPendingTransactions(info); 113 processPendingTransactions(info);
114 } 114 }
115 115
116 void SQLTransactionCoordinator::shutdown() { 116 void SQLTransactionCoordinator::shutdown() {
117 // Prevent releaseLock() from accessing / changing the coordinationInfo 117 // Prevent releaseLock() from accessing / changing the coordinationInfo
(...skipping 24 matching lines...) Expand all
142 SQLTransactionBackend* transaction = info.pendingTransactions.takeFirst(); 142 SQLTransactionBackend* transaction = info.pendingTransactions.takeFirst();
143 transaction->notifyDatabaseThreadIsShuttingDown(); 143 transaction->notifyDatabaseThreadIsShuttingDown();
144 } 144 }
145 } 145 }
146 146
147 // Clean up all pending transactions for all databases 147 // Clean up all pending transactions for all databases
148 m_coordinationInfoMap.clear(); 148 m_coordinationInfoMap.clear();
149 } 149 }
150 150
151 } // namespace blink 151 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698