Changeset 206122 in webkit
- Timestamp:
- Sep 19, 2016 3:33:56 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206121 r206122 1 2016-09-19 Daniel Bates <dabates@apple.com> 2 3 Cleanup: Remove an extraneous copy of SecurityOrigin 4 https://bugs.webkit.org/show_bug.cgi?id=162118 5 6 Reviewed by Youenn Fablet. 7 8 Share one isolated copy of the SecurityOrigin between the ContentSecurityPolicy and 9 LoaderTaskOptions objects instead of creating two isolated copies of the SecurityOrigin. 10 This is safe because both ContentSecurityPolicy and LoaderTaskOptions are instantiated 11 in WorkerThreadableLoader::MainThreadBridge for use on the main thread only. 12 13 * loader/WorkerThreadableLoader.cpp: 14 (WebCore::LoaderTaskOptions::LoaderTaskOptions): 15 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): 16 1 17 2016-09-19 Antti Koivisto <antti@apple.com> 2 18 -
trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp
r206074 r206122 86 86 87 87 struct LoaderTaskOptions { 88 LoaderTaskOptions(const ThreadableLoaderOptions&, const String&, const SecurityOrigin&);88 LoaderTaskOptions(const ThreadableLoaderOptions&, const String&, Ref<SecurityOrigin>&&); 89 89 ThreadableLoaderOptions options; 90 90 String referrer; 91 Ref Ptr<SecurityOrigin> origin;91 Ref<SecurityOrigin> origin; 92 92 }; 93 93 94 LoaderTaskOptions::LoaderTaskOptions(const ThreadableLoaderOptions& options, const String& referrer, const SecurityOrigin& origin)94 LoaderTaskOptions::LoaderTaskOptions(const ThreadableLoaderOptions& options, const String& referrer, Ref<SecurityOrigin>&& origin) 95 95 : options(options, options.preflightPolicy, options.contentSecurityPolicyEnforcement, options.initiator.isolatedCopy(), options.opaqueResponse) 96 96 , referrer(referrer.isolatedCopy()) 97 , origin( origin.isolatedCopy())97 , origin(WTFMove(origin)) 98 98 { 99 99 } … … 109 109 ASSERT(contentSecurityPolicy); 110 110 111 auto contentSecurityPolicyCopy = std::make_unique<ContentSecurityPolicy>(securityOrigin->isolatedCopy()); 111 auto securityOriginCopy = securityOrigin->isolatedCopy(); 112 auto contentSecurityPolicyCopy = std::make_unique<ContentSecurityPolicy>(securityOriginCopy); 112 113 contentSecurityPolicyCopy->copyStateFrom(contentSecurityPolicy); 113 114 114 auto optionsCopy = std::make_unique<LoaderTaskOptions>(options, request.httpReferrer().isNull() ? outgoingReferrer : request.httpReferrer(), *securityOrigin);115 auto optionsCopy = std::make_unique<LoaderTaskOptions>(options, request.httpReferrer().isNull() ? outgoingReferrer : request.httpReferrer(), WTFMove(securityOriginCopy)); 115 116 116 117 // Can we benefit from request being an r-value to create more efficiently its isolated copy?
Note: See TracChangeset
for help on using the changeset viewer.