Changeset 253967 in webkit
- Timestamp:
- Jan 1, 2020 5:05:01 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r253966 r253967 1 2020-01-01 youenn fablet <youenn@apple.com> 2 3 ServiceWorkerJobData should have a move constructor 4 https://bugs.webkit.org/show_bug.cgi?id=205555 5 <rdar://problem/57853373> 6 7 Reviewed by Darin Adler. 8 9 Previously, ServiceWorkerJobData did not have a move constructor. 10 Refactor code to enable it. 11 This improves efficiency and ensures that strings and other ref counted fields are 12 properly moved and isolated. 13 Covered by existing tests. 14 15 * workers/service/ServiceWorkerJobData.cpp: 16 (WebCore::ServiceWorkerJobData::isolatedCopy const): 17 * workers/service/ServiceWorkerJobData.h: 18 (WebCore::ServiceWorkerJobData::decode): 19 1 20 2020-01-01 youenn fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/workers/service/ServiceWorkerJobData.cpp
r253102 r253967 31 31 namespace WebCore { 32 32 33 ServiceWorkerJobData::ServiceWorkerJobData(const Identifier& identifier)34 : m_identifier(identifier)35 {36 }37 38 33 ServiceWorkerJobData::ServiceWorkerJobData(SWServerConnectionIdentifier connectionIdentifier, const DocumentOrWorkerIdentifier& localSourceContext) 39 34 : m_identifier { connectionIdentifier, ServiceWorkerJobIdentifier::generateThreadSafe() } … … 55 50 ServiceWorkerJobData ServiceWorkerJobData::isolatedCopy() const 56 51 { 57 ServiceWorkerJobData result { identifier() }; 52 ServiceWorkerJobData result; 53 result.m_identifier = identifier(); 58 54 result.sourceContext = sourceContext; 59 55 result.type = type; -
trunk/Source/WebCore/workers/service/ServiceWorkerJobData.h
r253102 r253967 42 42 using Identifier = ServiceWorkerJobDataIdentifier; 43 43 ServiceWorkerJobData(SWServerConnectionIdentifier, const DocumentOrWorkerIdentifier& sourceContext); 44 ServiceWorkerJobData(const ServiceWorkerJobData&) = default;45 ServiceWorkerJobData() = default;46 44 47 45 SWServerConnectionIdentifier connectionIdentifier() const { return m_identifier.connectionIdentifier; } … … 66 64 67 65 private: 68 WEBCORE_EXPORT explicit ServiceWorkerJobData(const Identifier&);66 ServiceWorkerJobData() = default; 69 67 70 68 Identifier m_identifier; … … 94 92 return WTF::nullopt; 95 93 96 ServiceWorkerJobData jobData { WTFMove(*identifier) }; 94 ServiceWorkerJobData jobData; 95 jobData.m_identifier = *identifier; 97 96 98 97 if (!decoder.decode(jobData.scriptURL))
Note: See TracChangeset
for help on using the changeset viewer.