Changeset 209873 in webkit
- Timestamp:
- Dec 15, 2016 2:08:26 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r209871 r209873 1 2016-12-15 Brady Eidson <beidson@apple.com> 2 3 Add a new Logging Channel for IndexedDB Operation scheduling. 4 https://bugs.webkit.org/show_bug.cgi?id=165912 5 6 Reviewed by Alex Christensen. 7 8 No new tests (No behavior change). 9 10 * Modules/indexeddb/IDBDatabase.cpp: 11 (WebCore::IDBDatabase::transaction): 12 13 * Modules/indexeddb/IDBFactory.cpp: 14 (WebCore::IDBFactory::openInternal): 15 (WebCore::IDBFactory::deleteDatabase): 16 17 * Modules/indexeddb/IDBTransaction.cpp: 18 (WebCore::IDBTransaction::internalAbort): 19 (WebCore::IDBTransaction::commit): 20 (WebCore::IDBTransaction::createObjectStore): 21 (WebCore::IDBTransaction::renameObjectStore): 22 (WebCore::IDBTransaction::createIndex): 23 (WebCore::IDBTransaction::renameIndex): 24 (WebCore::IDBTransaction::doRequestOpenCursor): 25 (WebCore::IDBTransaction::iterateCursor): 26 (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): 27 (WebCore::IDBTransaction::requestGetAllIndexRecords): 28 (WebCore::IDBTransaction::requestGetRecord): 29 (WebCore::IDBTransaction::requestIndexRecord): 30 (WebCore::IDBTransaction::requestCount): 31 (WebCore::IDBTransaction::requestDeleteRecord): 32 (WebCore::IDBTransaction::requestClearObjectStore): 33 (WebCore::IDBTransaction::requestPutOrAdd): 34 (WebCore::IDBTransaction::deleteObjectStore): 35 (WebCore::IDBTransaction::deleteIndex): 36 37 * Modules/indexeddb/shared/IDBCursorInfo.cpp: 38 (WebCore::IDBCursorInfo::loggingString): 39 * Modules/indexeddb/shared/IDBCursorInfo.h: 40 41 * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: 42 (WebCore::IDBGetAllRecordsData::loggingString): 43 * Modules/indexeddb/shared/IDBGetAllRecordsData.h: 44 45 * Modules/indexeddb/shared/IDBGetRecordData.cpp: 46 (WebCore::IDBGetRecordData::loggingString): 47 * Modules/indexeddb/shared/IDBGetRecordData.h: 48 49 * Modules/indexeddb/shared/IDBIndexInfo.cpp: 50 (WebCore::IDBIndexInfo::condensedLoggingString): 51 * Modules/indexeddb/shared/IDBIndexInfo.h: 52 53 * Modules/indexeddb/shared/IDBIterateCursorData.cpp: 54 (WebCore::IDBIterateCursorData::loggingString): 55 * Modules/indexeddb/shared/IDBIterateCursorData.h: 56 57 * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: 58 (WebCore::IDBObjectStoreInfo::condensedLoggingString): 59 * Modules/indexeddb/shared/IDBObjectStoreInfo.h: 60 61 * platform/Logging.h: 62 1 63 2016-12-15 Konstantin Tokarev <annulen@yandex.ru> 2 64 -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
r209446 r209873 204 204 205 205 auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy.get(), objectStores, mode); 206 207 LOG(IndexedDBOperations, "IDB creating transaction: %s", info.loggingString().utf8().data()); 206 208 auto transaction = IDBTransaction::create(*this, info); 207 209 -
trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
r208985 r209873 101 101 return Exception { TypeError, ASCIILiteral("IDBFactory.open() called with an invalid security origin") }; 102 102 103 LOG(IndexedDBOperations, "IDB opening database: %s %" PRIu64, name.utf8().data(), version); 104 103 105 return m_connectionProxy->openDatabase(context, databaseIdentifier, version); 104 106 } … … 119 121 if (!databaseIdentifier.isValid()) 120 122 return Exception { TypeError, ASCIILiteral("IDBFactory.deleteDatabase() called with an invalid security origin") }; 123 124 LOG(IndexedDBOperations, "IDB deleting database: %s", name.utf8().data()); 121 125 122 126 return m_connectionProxy->deleteDatabase(context, databaseIdentifier); -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r209446 r209873 250 250 m_abortQueue.swap(m_pendingTransactionOperationQueue); 251 251 252 LOG(IndexedDBOperations, "IDB abort-on-server operation: Transaction %s", info().identifier().loggingString().utf8().data()); 252 253 scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::abortOnServerAndCancelRequests)); 253 254 } … … 500 501 m_database->willCommitTransaction(*this); 501 502 503 LOG(IndexedDBOperations, "IDB commit operation: Transaction %s", info().identifier().loggingString().utf8().data()); 502 504 scheduleOperation(IDBClient::createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer)); 503 505 } … … 661 663 m_referencedObjectStores.set(info.name(), WTFMove(objectStore)); 662 664 665 LOG(IndexedDBOperations, "IDB create object store operation: %s", info.condensedLoggingString().utf8().data()); 663 666 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info)); 664 667 … … 697 700 698 701 uint64_t objectStoreIdentifier = objectStore.info().identifier(); 702 703 LOG(IndexedDBOperations, "IDB rename object store operation: %s to %s", objectStore.info().condensedLoggingString().utf8().data(), newName.utf8().data()); 699 704 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameObjectStoreOnServer, &IDBTransaction::renameObjectStoreOnServer, objectStoreIdentifier, newName)); 700 705 … … 727 732 return nullptr; 728 733 734 LOG(IndexedDBOperations, "IDB create index operation: %s under object store %s", info.condensedLoggingString().utf8().data(), objectStore.info().condensedLoggingString().utf8().data()); 729 735 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info)); 730 736 … … 775 781 uint64_t objectStoreIdentifier = index.objectStore().info().identifier(); 776 782 uint64_t indexIdentifier = index.info().identifier(); 783 784 LOG(IndexedDBOperations, "IDB rename index operation: %s to %s under object store %" PRIu64, index.info().condensedLoggingString().utf8().data(), newName.utf8().data(), index.info().objectStoreIdentifier()); 777 785 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didRenameIndexOnServer, &IDBTransaction::renameIndexOnServer, objectStoreIdentifier, indexIdentifier, newName)); 778 786 } … … 826 834 addRequest(request.get()); 827 835 836 LOG(IndexedDBOperations, "IDB open cursor operation: %s", cursor->info().loggingString().utf8().data()); 828 837 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didOpenCursorOnServer, &IDBTransaction::openCursorOnServer, cursor->info())); 829 838 … … 856 865 addRequest(*cursor.request()); 857 866 867 LOG(IndexedDBOperations, "IDB iterate cursor operation: %s", data.loggingString().utf8().data()); 858 868 scheduleOperation(IDBClient::createTransactionOperation(*this, *cursor.request(), &IDBTransaction::didIterateCursorOnServer, &IDBTransaction::iterateCursorOnServer, data)); 859 869 } … … 889 899 IDBGetAllRecordsData getAllRecordsData { keyRangeData, getAllType, count, objectStore.info().identifier(), 0 }; 890 900 901 LOG(IndexedDBOperations, "IDB get all object store records operation: %s", getAllRecordsData.loggingString().utf8().data()); 891 902 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData)); 892 903 … … 907 918 IDBGetAllRecordsData getAllRecordsData { keyRangeData, getAllType, count, index.objectStore().info().identifier(), index.info().identifier() }; 908 919 920 LOG(IndexedDBOperations, "IDB get all index records operation: %s", getAllRecordsData.loggingString().utf8().data()); 909 921 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData)); 910 922 … … 959 971 addRequest(request.get()); 960 972 973 LOG(IndexedDBOperations, "IDB get record operation: %s", getRecordData.loggingString().utf8().data()); 961 974 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData)); 962 975 … … 993 1006 994 1007 IDBGetRecordData getRecordData = { range, IDBGetRecordDataType::KeyAndValue }; 1008 1009 LOG(IndexedDBOperations, "IDB get index record operation: %s", getRecordData.loggingString().utf8().data()); 995 1010 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, getRecordData)); 996 1011 … … 1051 1066 addRequest(request.get()); 1052 1067 1068 LOG(IndexedDBOperations, "IDB object store count operation: %s, range %s", objectStore.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1053 1069 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range)); 1054 1070 … … 1068 1084 addRequest(request.get()); 1069 1085 1086 LOG(IndexedDBOperations, "IDB index count operation: %s, range %s", index.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1070 1087 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didGetCountOnServer, &IDBTransaction::getCountOnServer, range)); 1071 1088 … … 1102 1119 addRequest(request.get()); 1103 1120 1121 LOG(IndexedDBOperations, "IDB delete record operation: %s, range %s", objectStore.info().condensedLoggingString().utf8().data(), range.loggingString().utf8().data()); 1104 1122 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didDeleteRecordOnServer, &IDBTransaction::deleteRecordOnServer, range)); 1105 1123 return request; … … 1135 1153 1136 1154 uint64_t objectStoreIdentifier = objectStore.info().identifier(); 1155 1156 LOG(IndexedDBOperations, "IDB clear object store operation: %s", objectStore.info().condensedLoggingString().utf8().data()); 1137 1157 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didClearObjectStoreOnServer, &IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier)); 1138 1158 … … 1170 1190 addRequest(request.get()); 1171 1191 1192 LOG(IndexedDBOperations, "IDB putOrAdd operation: %s", key ? key->loggingString().utf8().data() : "<null key>"); 1172 1193 scheduleOperation(IDBClient::createTransactionOperation(*this, request.get(), &IDBTransaction::didPutOrAddOnServer, &IDBTransaction::putOrAddOnServer, key, &value, overwriteMode)); 1173 1194 … … 1253 1274 } 1254 1275 1276 LOG(IndexedDBOperations, "IDB delete object store operation: %s", objectStoreName.utf8().data()); 1255 1277 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteObjectStoreOnServer, &IDBTransaction::deleteObjectStoreOnServer, objectStoreName)); 1256 1278 } … … 1278 1300 ASSERT(isVersionChange()); 1279 1301 1302 LOG(IndexedDBOperations, "IDB delete index operation: %s (%" PRIu64 ")", indexName.utf8().data(), objectStoreIdentifier); 1280 1303 scheduleOperation(IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteIndexOnServer, &IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName)); 1281 1304 } -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.cpp
r207845 r209873 100 100 } 101 101 102 #if !LOG_DISABLED 103 String IDBCursorInfo::loggingString() const 104 { 105 if (m_source == IndexedDB::CursorSource::Index) 106 return String::format("<Crsr: Idx %" PRIu64 ", OS %" PRIu64 ", tx %s>", m_sourceIdentifier, m_objectStoreIdentifier, m_transactionIdentifier.loggingString().utf8().data()); 107 108 return String::format("<Crsr: OS %" PRIu64 ", tx %s>", m_objectStoreIdentifier, m_transactionIdentifier.loggingString().utf8().data()); 109 } 110 #endif 111 102 112 } // namespace WebCore 103 113 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBCursorInfo.h
r208646 r209873 71 71 template<class Decoder> static bool decode(Decoder&, IDBCursorInfo&); 72 72 73 #if !LOG_DISABLED 74 String loggingString() const; 75 #endif 76 73 77 private: 74 78 IDBCursorInfo(IDBTransaction&, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IndexedDB::CursorDirection, IndexedDB::CursorType); -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.cpp
r208194 r209873 38 38 } 39 39 40 #if !LOG_DISABLED 41 String IDBGetAllRecordsData::loggingString() const 42 { 43 if (indexIdentifier) 44 return String::format("<GetAllRecords: Idx %" PRIu64 ", OS %" PRIu64 ", %s, range %s>", indexIdentifier, objectStoreIdentifier, getAllType == IndexedDB::GetAllType::Keys ? "Keys" : "Values", keyRangeData.loggingString().utf8().data()); 45 return String::format("<GetAllRecords: OS %" PRIu64 ", %s, range %s>", objectStoreIdentifier, getAllType == IndexedDB::GetAllType::Keys ? "Keys" : "Values", keyRangeData.loggingString().utf8().data()); 46 } 47 #endif 48 40 49 } // namespace WebCore 41 50 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h
r208985 r209873 47 47 IDBGetAllRecordsData isolatedCopy() const; 48 48 49 #if !LOG_DISABLED 50 String loggingString() const; 51 #endif 52 49 53 template<class Encoder> void encode(Encoder&) const; 50 54 template<class Decoder> static bool decode(Decoder&, IDBGetAllRecordsData&); -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.cpp
r209197 r209873 38 38 } 39 39 40 #if !LOG_DISABLED 41 String IDBGetRecordData::loggingString() const 42 { 43 return String::format("<GetRecord: %s %s>", type == IDBGetRecordDataType::KeyOnly ? "KeyOnly" : "Key+Value", keyRangeData.loggingString().utf8().data()); 44 } 45 #endif 46 40 47 } // namespace WebCore 41 48 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetRecordData.h
r209197 r209873 43 43 IDBGetRecordData isolatedCopy() const; 44 44 45 #if !LOG_DISABLED 46 String loggingString() const; 47 #endif 48 45 49 template<class Encoder> void encode(Encoder&) const; 46 50 template<class Decoder> static bool decode(Decoder&, IDBGetRecordData&); -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp
r207931 r209873 59 59 return makeString(indentString, "Index: ", m_name, String::format(" (%" PRIu64 ") \n", m_identifier)); 60 60 } 61 62 String IDBIndexInfo::condensedLoggingString() const 63 { 64 return String::format("<Idx: %s (%" PRIu64 "), OS (%" PRIu64 ")>", m_name.utf8().data(), m_identifier, m_objectStoreIdentifier); 65 } 61 66 #endif 62 67 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h
r208646 r209873 54 54 #if !LOG_DISABLED 55 55 String loggingString(int indent = 0) const; 56 String condensedLoggingString() const; 56 57 #endif 57 58 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.cpp
r208500 r209873 36 36 } 37 37 38 #if !LOG_DISABLED 39 String IDBIterateCursorData::loggingString() const 40 { 41 return String::format("<Itr8Crsr: key %s, primaryKey %s, count %u", keyData.loggingString().utf8().data(), primaryKeyData.loggingString().utf8().data(), count); 42 } 43 #endif 44 38 45 } // namespace WebCore 39 46 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBIterateCursorData.h
r208500 r209873 39 39 IDBIterateCursorData isolatedCopy() const; 40 40 41 #if !LOG_DISABLED 42 String loggingString() const; 43 #endif 44 41 45 template<class Encoder> void encode(Encoder&) const; 42 46 template<class Decoder> static bool decode(Decoder&, IDBIterateCursorData&); -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp
r208985 r209873 151 151 return builder.toString(); 152 152 } 153 154 String IDBObjectStoreInfo::condensedLoggingString() const 155 { 156 return String::format("<OS: %s (%" PRIu64 ")>", m_name.utf8().data(), m_identifier); 157 } 158 153 159 #endif 154 160 -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h
r208985 r209873 68 68 #if !LOG_DISABLED 69 69 String loggingString(int indent = 0) const; 70 String condensedLoggingString() const; 70 71 #endif 71 72 -
trunk/Source/WebCore/platform/Logging.h
r209181 r209873 56 56 M(Images) \ 57 57 M(IndexedDB) \ 58 M(IndexedDBOperations) \ 58 59 M(Layers) \ 59 60 M(Layout) \
Note: See TracChangeset
for help on using the changeset viewer.