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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/SQLTransactionCoordinator.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) 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 void SQLTransactionCoordinator::processPendingTransactions( 50 void SQLTransactionCoordinator::processPendingTransactions(
51 CoordinationInfo& info) { 51 CoordinationInfo& info) {
52 if (info.activeWriteTransaction || info.pendingTransactions.isEmpty()) 52 if (info.activeWriteTransaction || info.pendingTransactions.isEmpty())
53 return; 53 return;
54 54
55 SQLTransactionBackend* firstPendingTransaction = 55 SQLTransactionBackend* firstPendingTransaction =
56 info.pendingTransactions.first(); 56 info.pendingTransactions.first();
57 if (firstPendingTransaction->isReadOnly()) { 57 if (firstPendingTransaction->isReadOnly()) {
58 do { 58 do {
59 firstPendingTransaction = info.pendingTransactions.takeFirst(); 59 firstPendingTransaction = info.pendingTransactions.takeFirst();
60 info.activeReadTransactions.add(firstPendingTransaction); 60 info.activeReadTransactions.insert(firstPendingTransaction);
61 firstPendingTransaction->lockAcquired(); 61 firstPendingTransaction->lockAcquired();
62 } while (!info.pendingTransactions.isEmpty() && 62 } while (!info.pendingTransactions.isEmpty() &&
63 info.pendingTransactions.first()->isReadOnly()); 63 info.pendingTransactions.first()->isReadOnly());
64 } else if (info.activeReadTransactions.isEmpty()) { 64 } else if (info.activeReadTransactions.isEmpty()) {
65 info.pendingTransactions.removeFirst(); 65 info.pendingTransactions.removeFirst();
66 info.activeWriteTransaction = firstPendingTransaction; 66 info.activeWriteTransaction = firstPendingTransaction;
67 firstPendingTransaction->lockAcquired(); 67 firstPendingTransaction->lockAcquired();
68 } 68 }
69 } 69 }
70 70
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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