Changeset 280935 in webkit
- Timestamp:
- Aug 11, 2021, 3:33:17 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/cache/NetworkCacheIOChannel.h (modified) (4 diffs)
-
NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm (modified) (1 diff)
-
NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp (modified) (2 diffs)
-
NetworkProcess/cache/NetworkCacheIOChannelGLib.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r280934 r280935 1 2021-08-11 David Kilzer <ddkilzer@apple.com> 2 3 ThreadSanitizer: data race in WTF::StringImpl::deref() under WebKit::NetworkCache::IOChannel::~IOChannel() 4 <https://webkit.org/b/229003> 5 <rdar://problem/81795626> 6 7 Reviewed by Chris Dumez. 8 9 Covered by 3245 layout tests running with TSan including: 10 http/wpt/service-workers/file-upload.html 11 12 * NetworkProcess/cache/NetworkCacheIOChannel.h: 13 (WebKit::NetworkCache::IOChannel::open): 14 - Update to use #pragma once. 15 - Make an isolatedCopy() for m_path. 16 (WebKit::NetworkCache::IOChannel::IOChannel): 17 - Switch to using an rvalue reference. 18 * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: 19 (WebKit::NetworkCache::IOChannel::IOChannel): Ditto. 20 * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: 21 (WebKit::NetworkCache::IOChannel::IOChannel): Ditto. 22 * NetworkProcess/cache/NetworkCacheIOChannelGLib.cpp: 23 (WebKit::NetworkCache::IOChannel::IOChannel): Ditto. 24 - Switch to use m_path instead of filePath to prevent 25 use-after-move. 26 1 27 2021-08-11 Sihui Liu <sihui_liu@apple.com> 2 28 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannel.h
r278253 r280935 24 24 */ 25 25 26 #ifndef NetworkCacheIOChannel_h 27 #define NetworkCacheIOChannel_h 26 #pragma once 28 27 29 28 #include "NetworkCacheData.h" … … 47 46 public: 48 47 enum class Type { Read, Write, Create }; 49 static Ref<IOChannel> open(const String& file, Type type, std::optional<WorkQueue::QOS> qos = { }) { return adoptRef(*new IOChannel(file , type, qos)); }48 static Ref<IOChannel> open(const String& file, Type type, std::optional<WorkQueue::QOS> qos = { }) { return adoptRef(*new IOChannel(file.isolatedCopy(), type, qos)); } 50 49 51 50 // Using nullptr as queue submits the result to the main queue. … … 66 65 67 66 private: 68 IOChannel( const String& filePath, IOChannel::Type, std::optional<WorkQueue::QOS>);67 IOChannel(String&& filePath, IOChannel::Type, std::optional<WorkQueue::QOS>); 69 68 70 69 #if USE(GLIB) … … 89 88 }; 90 89 91 } 92 } 93 94 #endif 90 } // namespace NetworkCache 91 } // namespace WebKit -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm
r278253 r280935 52 52 } 53 53 54 IOChannel::IOChannel( const String& filePath, Type type, std::optional<WorkQueue::QOS> qos)55 : m_path( filePath)54 IOChannel::IOChannel(String&& filePath, Type type, std::optional<WorkQueue::QOS> qos) 55 : m_path(WTFMove(filePath)) 56 56 , m_type(type) 57 57 { 58 auto path = FileSystem::fileSystemRepresentation( filePath);58 auto path = FileSystem::fileSystemRepresentation(m_path); 59 59 int oflag; 60 60 mode_t mode; -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp
r278521 r280935 32 32 namespace NetworkCache { 33 33 34 IOChannel::IOChannel( const String& filePath, Type type, std::optional<WorkQueue::QOS>)35 : m_path( filePath)34 IOChannel::IOChannel(String&& filePath, Type type, std::optional<WorkQueue::QOS>) 35 : m_path(WTFMove(filePath)) 36 36 , m_type(type) 37 37 { … … 48 48 break; 49 49 } 50 m_fileDescriptor = FileSystem::openFile( filePath, mode);50 m_fileDescriptor = FileSystem::openFile(m_path, mode); 51 51 } 52 52 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelGLib.cpp
r278253 r280935 38 38 static const size_t gDefaultReadBufferSize = 4096; 39 39 40 IOChannel::IOChannel( const String& filePath, Type type, std::optional<WorkQueue::QOS>)41 : m_path( filePath)40 IOChannel::IOChannel(String&& filePath, Type type, std::optional<WorkQueue::QOS>) 41 : m_path(WTFMove(filePath)) 42 42 , m_type(type) 43 43 { 44 auto path = FileSystem::fileSystemRepresentation( filePath);44 auto path = FileSystem::fileSystemRepresentation(m_path); 45 45 GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path.data())); 46 46 switch (m_type) {
Note:
See TracChangeset
for help on using the changeset viewer.