Changeset 240658 in webkit
- Timestamp:
- Jan 29, 2019 8:39:47 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240656 r240658 1 2 2019-01-29 Alex Christensen <achristensen@webkit.org> 3 4 Use lambdas instead of member pointer functions for TransactionOperationImpl 5 https://bugs.webkit.org/show_bug.cgi?id=193933 6 7 Reviewed by Tim Horton. 8 9 No change in behavior. This just makes it easier to add new parameters to these functions in a straightforward manner. 10 11 * Modules/indexeddb/IDBObjectStore.cpp: 12 (WebCore::IDBObjectStore::putOrAdd): 13 * Modules/indexeddb/IDBTransaction.cpp: 14 (WebCore::IDBTransaction::internalAbort): 15 (WebCore::IDBTransaction::commit): 16 (WebCore::IDBTransaction::createObjectStore): 17 (WebCore::IDBTransaction::renameObjectStore): 18 (WebCore::IDBTransaction::createIndex): 19 (WebCore::IDBTransaction::renameIndex): 20 (WebCore::IDBTransaction::doRequestOpenCursor): 21 (WebCore::IDBTransaction::iterateCursor): 22 (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): 23 (WebCore::IDBTransaction::requestGetAllIndexRecords): 24 (WebCore::IDBTransaction::requestGetRecord): 25 (WebCore::IDBTransaction::requestIndexRecord): 26 (WebCore::IDBTransaction::requestCount): 27 (WebCore::IDBTransaction::requestDeleteRecord): 28 (WebCore::IDBTransaction::requestClearObjectStore): 29 (WebCore::IDBTransaction::requestPutOrAdd): 30 (WebCore::IDBTransaction::deleteObjectStore): 31 (WebCore::IDBTransaction::deleteIndex): 32 * Modules/indexeddb/IDBTransaction.h: 33 * Modules/indexeddb/client/TransactionOperation.h: 34 (WebCore::IDBClient::TransactionOperation::doComplete): 35 (WebCore::IDBClient::createTransactionOperation): Deleted. 36 1 37 2019-01-29 Zalan Bujtas <zalan@apple.com> 2 38 -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
r239535 r240658 358 358 return Exception { DataError, "Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided."_s }; 359 359 360 return m_transaction.requestPutOrAdd(state, *this, key.get(), *serializedValue, overwriteMode);360 return m_transaction.requestPutOrAdd(state, *this, WTFMove(key), *serializedValue, overwriteMode); 361 361 } 362 362 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r239865 r240658 247 247 248 248 LOG(IndexedDBOperations, "IDB abort-on-server operation: Transaction %s", info().identifier().loggingString().utf8().data()); 249 scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::abortOnServerAndCancelRequests)); 249 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, nullptr, [protectedThis = makeRef(*this)] (auto& operation) { 250 protectedThis->abortOnServerAndCancelRequests(operation); 251 })); 250 252 } 251 253 … … 502 504 503 505 LOG(IndexedDBOperations, "IDB commit operation: Transaction %s", info().identifier().loggingString().utf8().data()); 504 scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer)); 506 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, nullptr, [protectedThis = makeRef(*this)] (auto& operation) { 507 protectedThis->commitOnServer(operation); 508 })); 505 509 } 506 510 … … 660 664 661 665 LOG(IndexedDBOperations, "IDB create object store operation: %s", info.condensedLoggingString().utf8().data()); 662 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info)); 666 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 667 protectedThis->didCreateObjectStoreOnServer(result); 668 }, [protectedThis = makeRef(*this), info = info.isolatedCopy()] (auto& operation) { 669 protectedThis->createObjectStoreOnServer(operation, info); 670 })); 663 671 664 672 return *rawObjectStore; … … 698 706 699 707 LOG(IndexedDBOperations, "IDB rename object store operation: %s to %s", objectStore.info().condensedLoggingString().utf8().data(), newName.utf8().data()); 700 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameObjectStoreOnServer, &IDBTransaction::renameObjectStoreOnServer, objectStoreIdentifier, newName)); 708 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 709 protectedThis->didRenameObjectStoreOnServer(result); 710 }, [protectedThis = makeRef(*this), objectStoreIdentifier, newName = newName.isolatedCopy()] (auto& operation) { 711 protectedThis->renameObjectStoreOnServer(operation, objectStoreIdentifier, newName); 712 })); 701 713 702 714 m_referencedObjectStores.set(newName, m_referencedObjectStores.take(objectStore.info().name())); … … 729 741 730 742 LOG(IndexedDBOperations, "IDB create index operation: %s under object store %s", info.condensedLoggingString().utf8().data(), objectStore.info().condensedLoggingString().utf8().data()); 731 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info)); 743 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 744 protectedThis->didCreateIndexOnServer(result); 745 }, [protectedThis = makeRef(*this), info = info.isolatedCopy()] (auto& operation) { 746 protectedThis->createIndexOnServer(operation, info); 747 })); 732 748 733 749 return std::make_unique<IDBIndex>(*scriptExecutionContext(), info, objectStore); … … 779 795 780 796 LOG(IndexedDBOperations, "IDB rename index operation: %s to %s under object store %" PRIu64, index.info().condensedLoggingString().utf8().data(), newName.utf8().data(), index.info().objectStoreIdentifier()); 781 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameIndexOnServer, &IDBTransaction::renameIndexOnServer, objectStoreIdentifier, indexIdentifier, newName)); 797 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 798 protectedThis->didRenameIndexOnServer(result); 799 }, [protectedThis = makeRef(*this), objectStoreIdentifier, indexIdentifier, newName = newName.isolatedCopy()] (auto& operation) { 800 protectedThis->renameIndexOnServer(operation, objectStoreIdentifier, indexIdentifier, newName); 801 })); 782 802 } 783 803 … … 831 851 832 852 LOG(IndexedDBOperations, "IDB open cursor operation: %s", cursor->info().loggingString().utf8().data()); 833 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didOpenCursorOnServer, &IDBTransaction::openCursorOnServer, cursor->info())); 853 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 854 protectedThis->didOpenCursorOnServer(request.get(), result); 855 }, [protectedThis = makeRef(*this), info = cursor->info().isolatedCopy()] (auto& operation) { 856 protectedThis->openCursorOnServer(operation, info); 857 })); 834 858 835 859 return request; … … 862 886 863 887 LOG(IndexedDBOperations, "IDB iterate cursor operation: %s %s", cursor.info().loggingString().utf8().data(), data.loggingString().utf8().data()); 864 scheduleOperation(IDBClient::createTransactionOperation(*this, *cursor.request(), &IDBTransaction::didIterateCursorOnServer, &IDBTransaction::iterateCursorOnServer, data)); 888 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, *cursor.request(), [protectedThis = makeRef(*this), request = makeRef(*cursor.request())] (const auto& result) { 889 protectedThis->didIterateCursorOnServer(request.get(), result); 890 }, [protectedThis = makeRef(*this), data = data.isolatedCopy()] (auto& operation) { 891 protectedThis->iterateCursorOnServer(operation, data); 892 })); 865 893 } 866 894 … … 896 924 897 925 LOG(IndexedDBOperations, "IDB get all object store records operation: %s", getAllRecordsData.loggingString().utf8().data()); 898 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData)); 926 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 927 protectedThis->didGetAllRecordsOnServer(request.get(), result); 928 }, [protectedThis = makeRef(*this), getAllRecordsData = getAllRecordsData.isolatedCopy()] (auto& operation) { 929 protectedThis->getAllRecordsOnServer(operation, getAllRecordsData); 930 })); 899 931 900 932 return request; … … 915 947 916 948 LOG(IndexedDBOperations, "IDB get all index records operation: %s", getAllRecordsData.loggingString().utf8().data()); 917 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData)); 949 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 950 protectedThis->didGetAllRecordsOnServer(request.get(), result); 951 }, [protectedThis = makeRef(*this), getAllRecordsData = getAllRecordsData.isolatedCopy()] (auto& operation) { 952 protectedThis->getAllRecordsOnServer(operation, getAllRecordsData); 953 })); 918 954 919 955 return request; … … 968 1004 969 1005 LOG(IndexedDBOperations, "IDB get record operation: %s %s", objectStore.info().condensedLoggingString().utf8().data(), getRecordData.loggingString().utf8().data()); 970 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData)); 1006 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1007 protectedThis->didGetRecordOnServer(request.get(), result); 1008 }, [protectedThis = makeRef(*this), getRecordData = getRecordData.isolatedCopy()] (auto& operation) { 1009 protectedThis->getRecordOnServer(operation, getRecordData); 1010 })); 971 1011 972 1012 return request; … … 1004 1044 1005 1045 LOG(IndexedDBOperations, "IDB get index record operation: %s %s", index.info().condensedLoggingString().utf8().data(), getRecordData.loggingString().utf8().data()); 1006 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData)); 1046 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1047 protectedThis->didGetRecordOnServer(request.get(), result); 1048 }, [protectedThis = makeRef(*this), getRecordData = getRecordData.isolatedCopy()] (auto& operation) { 1049 protectedThis->getRecordOnServer(operation, getRecordData); 1050 })); 1007 1051 1008 1052 return request; … … 1063 1107 1064 1108 LOG(IndexedDBOperations, "IDB object store count operation: %s, range %s", objectStore.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1065 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range)); 1109 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1110 protectedThis->didGetCountOnServer(request.get(), result); 1111 }, [protectedThis = makeRef(*this), range = range.isolatedCopy()] (auto& operation) { 1112 protectedThis->getCountOnServer(operation, range); 1113 })); 1066 1114 1067 1115 return request; … … 1081 1129 1082 1130 LOG(IndexedDBOperations, "IDB index count operation: %s, range %s", index.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1083 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range)); 1131 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1132 protectedThis->didGetCountOnServer(request.get(), result); 1133 }, [protectedThis = makeRef(*this), range = range.isolatedCopy()] (auto& operation) { 1134 protectedThis->getCountOnServer(operation, range); 1135 })); 1084 1136 1085 1137 return request; … … 1116 1168 1117 1169 LOG(IndexedDBOperations, "IDB delete record operation: %s, range %s", objectStore.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1118 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didDeleteRecordOnServer, &IDBTransaction::deleteRecordOnServer, range)); 1170 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1171 protectedThis->didDeleteRecordOnServer(request.get(), result); 1172 }, [protectedThis = makeRef(*this), range = range.isolatedCopy()] (auto& operation) { 1173 protectedThis->deleteRecordOnServer(operation, range); 1174 })); 1119 1175 return request; 1120 1176 } … … 1151 1207 1152 1208 LOG(IndexedDBOperations, "IDB clear object store operation: %s", objectStore.info().condensedLoggingString().utf8().data()); 1153 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didClearObjectStoreOnServer, &IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier)); 1209 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1210 protectedThis->didClearObjectStoreOnServer(request.get(), result); 1211 }, [protectedThis = makeRef(*this), objectStoreIdentifier] (auto& operation) { 1212 protectedThis->clearObjectStoreOnServer(operation, objectStoreIdentifier); 1213 })); 1154 1214 1155 1215 return request; … … 1173 1233 } 1174 1234 1175 Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ExecState& state, IDBObjectStore& objectStore, IDBKey*key, SerializedScriptValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)1235 Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ExecState& state, IDBObjectStore& objectStore, RefPtr<IDBKey>&& key, SerializedScriptValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode) 1176 1236 { 1177 1237 LOG(IndexedDB, "IDBTransaction::requestPutOrAdd"); … … 1187 1247 1188 1248 LOG(IndexedDBOperations, "IDB putOrAdd operation: %s key: %s", objectStore.info().condensedLoggingString().utf8().data(), key ? key->loggingString().utf8().data() : "<null key>"); 1189 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didPutOrAddOnServer, &IDBTransaction::putOrAddOnServer, key, &value, overwriteMode)); 1249 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, request.get(), [protectedThis = makeRef(*this), request = request.copyRef()] (const auto& result) { 1250 protectedThis->didPutOrAddOnServer(request.get(), result); 1251 }, [protectedThis = makeRef(*this), key, value = makeRef(value), overwriteMode] (auto& operation) { 1252 protectedThis->putOrAddOnServer(operation, key.get(), value.ptr(), overwriteMode); 1253 })); 1190 1254 1191 1255 return request; … … 1271 1335 1272 1336 LOG(IndexedDBOperations, "IDB delete object store operation: %s", objectStoreName.utf8().data()); 1273 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteObjectStoreOnServer, &IDBTransaction::deleteObjectStoreOnServer, objectStoreName)); 1337 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 1338 protectedThis->didDeleteObjectStoreOnServer(result); 1339 }, [protectedThis = makeRef(*this), objectStoreName = objectStoreName.isolatedCopy()] (auto& operation) { 1340 protectedThis->deleteObjectStoreOnServer(operation, objectStoreName); 1341 })); 1274 1342 } 1275 1343 … … 1297 1365 1298 1366 LOG(IndexedDBOperations, "IDB delete index operation: %s (%" PRIu64 ")", indexName.utf8().data(), objectStoreIdentifier); 1299 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteIndexOnServer, &IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName)); 1367 scheduleOperation(IDBClient::TransactionOperationImpl::create(*this, [protectedThis = makeRef(*this)] (const auto& result) { 1368 protectedThis->didDeleteIndexOnServer(result); 1369 }, [protectedThis = makeRef(*this), objectStoreIdentifier, indexName = indexName.isolatedCopy()] (auto& operation) { 1370 protectedThis->deleteIndexOnServer(operation, objectStoreIdentifier, indexName); 1371 })); 1300 1372 } 1301 1373 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h
r239535 r240658 114 114 void renameIndex(IDBIndex&, const String& newName); 115 115 116 Ref<IDBRequest> requestPutOrAdd(JSC::ExecState&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode);116 Ref<IDBRequest> requestPutOrAdd(JSC::ExecState&, IDBObjectStore&, RefPtr<IDBKey>&&, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode); 117 117 Ref<IDBRequest> requestGetRecord(JSC::ExecState&, IDBObjectStore&, const IDBGetRecordData&); 118 118 Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count); -
trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h
r239865 r240658 97 97 // m_completeFunction might be holding the last ref to this TransactionOperation, 98 98 // so we need to do this trick to null it out without first destroying it. 99 WTF::Function<void(const IDBResultData&)> oldCompleteFunction;99 Function<void(const IDBResultData&)> oldCompleteFunction; 100 100 std::swap(m_completeFunction, oldCompleteFunction); 101 101 … … 127 127 std::unique_ptr<IDBResourceIdentifier> m_cursorIdentifier; 128 128 IndexedDB::IndexRecordType m_indexRecordType; 129 WTF::Function<void()> m_performFunction;130 WTF::Function<void(const IDBResultData&)> m_completeFunction;129 Function<void()> m_performFunction; 130 Function<void(const IDBResultData&)> m_completeFunction; 131 131 132 132 private: … … 143 143 }; 144 144 145 template <typename... Arguments>146 145 class TransactionOperationImpl final : public TransactionOperation { 147 146 public: 148 TransactionOperationImpl(IDBTransaction& transaction, void (IDBTransaction::*completeMethod)(const IDBResultData&), void (IDBTransaction::*performMethod)(TransactionOperation&, Arguments...), Arguments&&... arguments) 147 template<typename... Args> static Ref<TransactionOperationImpl> create(Args&&... args) { return adoptRef(*new TransactionOperationImpl(std::forward<Args>(args)...)); } 148 private: 149 TransactionOperationImpl(IDBTransaction& transaction, Function<void(const IDBResultData&)> completeMethod, Function<void(TransactionOperation&)> performMethod) 149 150 : TransactionOperation(transaction) 150 151 { 151 RefPtr<TransactionOperation> protectedThis(this);152 153 152 ASSERT(performMethod); 154 m_performFunction = [protectedThis , this, performMethod, arguments...] {155 (&m_transaction.get()->*performMethod)(*this, arguments...);153 m_performFunction = [protectedThis = makeRef(*this), performMethod = WTFMove(performMethod)] { 154 performMethod(protectedThis.get()); 156 155 }; 157 156 158 157 if (completeMethod) { 159 m_completeFunction = [protectedThis, this, completeMethod](const IDBResultData& resultData) { 160 if (completeMethod) 161 (&m_transaction.get()->*completeMethod)(resultData); 158 m_completeFunction = [protectedThis = makeRef(*this), completeMethod = WTFMove(completeMethod)] (const IDBResultData& resultData) { 159 completeMethod(resultData); 162 160 }; 163 161 } 164 162 } 165 163 166 TransactionOperationImpl(IDBTransaction& transaction, IDBRequest& request, void (IDBTransaction::*completeMethod)(IDBRequest&, const IDBResultData&), void (IDBTransaction::*performMethod)(TransactionOperation&, Arguments...), Arguments&&... arguments)164 TransactionOperationImpl(IDBTransaction& transaction, IDBRequest& request, Function<void(const IDBResultData&)> completeMethod, Function<void(TransactionOperation&)> performMethod) 167 165 : TransactionOperation(transaction, request) 168 166 { 169 RefPtr<TransactionOperation> protectedThis(this);170 171 167 ASSERT(performMethod); 172 m_performFunction = [protectedThis , this, performMethod, arguments...] {173 (&m_transaction.get()->*performMethod)(*this, arguments...);168 m_performFunction = [protectedThis = makeRef(*this), performMethod = WTFMove(performMethod)] { 169 performMethod(protectedThis.get()); 174 170 }; 175 171 176 172 if (completeMethod) { 177 RefPtr<IDBRequest> refRequest(&request); 178 m_completeFunction = [protectedThis, this, refRequest, completeMethod](const IDBResultData& resultData) { 179 if (completeMethod) 180 (&m_transaction.get()->*completeMethod)(*refRequest, resultData); 173 m_completeFunction = [protectedThis = makeRef(*this), completeMethod = WTFMove(completeMethod)] (const IDBResultData& resultData) { 174 completeMethod(resultData); 181 175 }; 182 176 } … … 184 178 }; 185 179 186 inline Ref<TransactionOperation> createTransactionOperation(187 IDBTransaction& transaction,188 void (IDBTransaction::*complete)(const IDBResultData&),189 void (IDBTransaction::*perform)(TransactionOperation&))190 {191 return adoptRef(*new TransactionOperationImpl<>(transaction, complete, perform));192 }193 194 template<typename MP1, typename P1>195 Ref<TransactionOperation> createTransactionOperation(196 IDBTransaction& transaction,197 void (IDBTransaction::*complete)(const IDBResultData&),198 void (IDBTransaction::*perform)(TransactionOperation&, MP1),199 const P1& parameter1)200 {201 return adoptRef(*new TransactionOperationImpl<MP1>(transaction, complete, perform, parameter1));202 }203 204 template<typename MP1, typename P1, typename MP2, typename P2>205 Ref<TransactionOperation> createTransactionOperation(206 IDBTransaction& transaction,207 void (IDBTransaction::*complete)(const IDBResultData&),208 void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2),209 const P1& parameter1,210 const P2& parameter2)211 {212 return adoptRef(*new TransactionOperationImpl<MP1, MP2>(transaction, complete, perform, parameter1, parameter2));213 }214 215 template<typename MP1, typename P1, typename MP2, typename P2, typename MP3, typename P3>216 Ref<TransactionOperation> createTransactionOperation(217 IDBTransaction& transaction,218 void (IDBTransaction::*complete)(const IDBResultData&),219 void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2, MP3),220 const P1& parameter1,221 const P2& parameter2,222 const P3& parameter3)223 {224 return adoptRef(*new TransactionOperationImpl<MP1, MP2, MP3>(transaction, complete, perform, parameter1, parameter2, parameter3));225 }226 227 template<typename MP1, typename P1>228 Ref<TransactionOperation> createTransactionOperation(229 IDBTransaction& transaction,230 IDBRequest& request,231 void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&),232 void (IDBTransaction::*perform)(TransactionOperation&, MP1),233 const P1& parameter1)234 {235 return adoptRef(*new TransactionOperationImpl<MP1>(transaction, request, complete, perform, parameter1));236 }237 238 template<typename MP1, typename P1, typename MP2, typename P2>239 Ref<TransactionOperation> createTransactionOperation(240 IDBTransaction& transaction,241 IDBRequest& request,242 void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&),243 void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2),244 const P1& parameter1,245 const P2& parameter2)246 {247 return adoptRef(*new TransactionOperationImpl<MP1, MP2>(transaction, request, complete, perform, parameter1, parameter2));248 }249 250 template<typename MP1, typename MP2, typename MP3, typename P1, typename P2, typename P3>251 Ref<TransactionOperation> createTransactionOperation(252 IDBTransaction& transaction,253 IDBRequest& request,254 void (IDBTransaction::*complete)(IDBRequest&, const IDBResultData&),255 void (IDBTransaction::*perform)(TransactionOperation&, MP1, MP2, MP3),256 const P1& parameter1,257 const P2& parameter2,258 const P3& parameter3)259 {260 return adoptRef(*new TransactionOperationImpl<MP1, MP2, MP3>(transaction, request, complete, perform, parameter1, parameter2, parameter3));261 }262 263 180 } // namespace IDBClient 264 181 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.