Changeset 247159 in webkit
- Timestamp:
- Jul 5, 2019 9:24:26 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247153 r247159 1 2019-07-05 Youenn Fablet <youenn@apple.com> 2 3 ASSERT that a sessionID is valid when encoding it 4 https://bugs.webkit.org/show_bug.cgi?id=199302 5 6 Reviewed by Darin Adler. 7 8 For IDBValue, instead of encoding an invalid session ID, encode a boolean that tells there is no sessionID. 9 For IDBRequestData, keep track of whether there is an IDBDatabaseIdentifier 10 and encode/decode accordingly to not encode an invalid sessionID. 11 No observable change of behavior. 12 13 * Modules/indexeddb/IDBValue.h: 14 (WebCore::IDBValue::sessionID const): 15 (WebCore::IDBValue::encode const): 16 (WebCore::IDBValue::decode): 17 * Modules/indexeddb/shared/IDBRequestData.cpp: 18 (WebCore::IDBRequestData::isolatedCopy): 19 * Modules/indexeddb/shared/IDBRequestData.h: 20 (WebCore::IDBRequestData::databaseIdentifier const): 21 (WebCore::IDBRequestData::decode): 22 1 23 2019-07-05 Zalan Bujtas <zalan@apple.com> 2 24 -
trunk/Source/WebCore/Modules/indexeddb/IDBValue.h
r243163 r247159 51 51 const ThreadSafeDataBuffer& data() const { return m_data; } 52 52 const Vector<String>& blobURLs() const { return m_blobURLs; } 53 const PAL::SessionID& sessionID() const { return m_sessionID; }53 const PAL::SessionID& sessionID() const; 54 54 const Vector<String>& blobFilePaths() const { return m_blobFilePaths; } 55 55 … … 60 60 ThreadSafeDataBuffer m_data; 61 61 Vector<String> m_blobURLs; 62 PAL::SessionIDm_sessionID;62 mutable Optional<PAL::SessionID> m_sessionID; 63 63 Vector<String> m_blobFilePaths; 64 64 }; 65 65 66 inline const PAL::SessionID& IDBValue::sessionID() const 67 { 68 // FIXME: We should assert m_sessionID is valid or remove m_sessionID. 69 if (!m_sessionID) 70 m_sessionID = PAL::SessionID { }; 71 return *m_sessionID; 72 } 66 73 67 74 template<class Encoder> -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.cpp
r200495 r247159 99 99 destination.m_requestType = source.m_requestType; 100 100 101 destination.m_databaseIdentifier = source.m_databaseIdentifier.isolatedCopy(); 101 if (source.m_databaseIdentifier) 102 destination.m_databaseIdentifier = source.m_databaseIdentifier->isolatedCopy(); 102 103 103 104 if (source.m_requestIdentifier) -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h
r243460 r247159 66 66 IDBResourceIdentifier cursorIdentifier() const; 67 67 68 const IDBDatabaseIdentifier& databaseIdentifier() const { return m_databaseIdentifier; }68 const IDBDatabaseIdentifier& databaseIdentifier() const; 69 69 uint64_t requestedVersion() const; 70 70 … … 90 90 IndexedDB::IndexRecordType m_indexRecordType; 91 91 92 IDBDatabaseIdentifierm_databaseIdentifier;92 mutable Optional<IDBDatabaseIdentifier> m_databaseIdentifier; 93 93 uint64_t m_requestedVersion { 0 }; 94 94 95 95 IndexedDB::RequestType m_requestType { IndexedDB::RequestType::Other }; 96 96 }; 97 98 inline const IDBDatabaseIdentifier& IDBRequestData::databaseIdentifier() const 99 { 100 ASSERT(m_databaseIdentifier); 101 if (!m_databaseIdentifier) 102 m_databaseIdentifier = IDBDatabaseIdentifier { }; 103 return *m_databaseIdentifier; 104 } 97 105 98 106 template<class Encoder> … … 129 137 return false; 130 138 131 Optional< IDBDatabaseIdentifier> databaseIdentifier;139 Optional<Optional<IDBDatabaseIdentifier>> databaseIdentifier; 132 140 decoder >> databaseIdentifier; 133 141 if (!databaseIdentifier) -
trunk/Source/WebCore/PAL/ChangeLog
r247117 r247159 1 2019-07-05 Youenn Fablet <youenn@apple.com> 2 3 ASSERT that a sessionID is valid when encoding it 4 https://bugs.webkit.org/show_bug.cgi?id=199302 5 6 Reviewed by Darin Adler. 7 8 ASSERT that a sessionID is valid at encoding/decoding time. 9 10 * pal/SessionID.h: 11 (PAL::SessionID::encode const): 12 (PAL::SessionID::decode): 13 1 14 2019-07-03 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Source/WebCore/PAL/pal/SessionID.h
r239427 r247159 81 81 void SessionID::encode(Encoder& encoder) const 82 82 { 83 // FIXME: Eliminate places that encode invalid SessionIDs, then ASSERT here that the sessionID is valid.83 ASSERT(isValid()); 84 84 encoder << m_sessionID; 85 85 } … … 105 105 return WTF::nullopt; 106 106 107 // FIXME: Eliminate places that encode invalid SessionIDs, then fail to decode an invalid sessionID. 107 // FIXME: We should fail to decode an invalid sessionID. 108 ASSERT(SessionID { *sessionID }.isValid()); 108 109 return SessionID { *sessionID }; 109 110 }
Note: See TracChangeset
for help on using the changeset viewer.