Changeset 184081 in webkit
- Timestamp:
- May 11, 2015, 5:01:21 AM (11 years ago)
- Location:
- releases/WebKitGTK/webkit-2.8/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
loader/ThreadableLoader.cpp (modified) (1 diff)
-
loader/ThreadableLoader.h (modified) (1 diff)
-
loader/WorkerThreadableLoader.cpp (modified) (2 diffs)
-
platform/CrossThreadCopier.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog
r184080 r184081 1 2015-04-15 Alexey Proskuryakov <ap@apple.com> 2 3 No thread safety when passing ThreadableLoaderOptions from a worker thread 4 https://bugs.webkit.org/show_bug.cgi?id=143790 5 6 Reviewed by Geoffrey Garen. 7 8 * loader/ThreadableLoader.h: 9 * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added. 10 11 * loader/WorkerThreadableLoader.cpp: 12 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send 13 a structure with strings to a different thread, that's bad. 14 15 * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug, 16 just removing a clearly wrong specialization. 17 1 18 2015-04-13 Joonghun Park <jh718.park@samsung.com> 2 19 -
releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/ThreadableLoader.cpp
r174225 r184081 52 52 } 53 53 54 std::unique_ptr<ThreadableLoaderOptions> ThreadableLoaderOptions::isolatedCopy() const 55 { 56 std::unique_ptr<ThreadableLoaderOptions> copy = std::make_unique<ThreadableLoaderOptions>(); 57 copy->preflightPolicy = preflightPolicy; 58 copy->crossOriginRequestPolicy = crossOriginRequestPolicy; 59 if (securityOrigin) 60 copy->securityOrigin = securityOrigin->isolatedCopy(); 61 copy->initiator = initiator.string().isolatedCopy(); 62 return copy; 63 } 64 54 65 PassRefPtr<ThreadableLoader> ThreadableLoader::create(ScriptExecutionContext* context, ThreadableLoaderClient* client, const ResourceRequest& request, const ThreadableLoaderOptions& options) 55 66 { -
releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/ThreadableLoader.h
r149876 r184081 67 67 ~ThreadableLoaderOptions(); 68 68 69 std::unique_ptr<ThreadableLoaderOptions> isolatedCopy() const; 70 69 71 PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed. 70 72 CrossOriginRequestPolicy crossOriginRequestPolicy; -
releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/WorkerThreadableLoader.cpp
r184080 r184081 92 92 93 93 auto* requestData = request.copyData().release(); 94 auto* optionsCopy = options.isolatedCopy().release(); 94 95 StringCapture capturedOutgoingReferrer(outgoingReferrer); 95 m_loaderProxy.postTaskToLoader([this, requestData, options , capturedOutgoingReferrer](ScriptExecutionContext& context) {96 m_loaderProxy.postTaskToLoader([this, requestData, optionsCopy, capturedOutgoingReferrer](ScriptExecutionContext& context) { 96 97 ASSERT(isMainThread()); 97 98 Document& document = downcast<Document>(context); … … 99 100 auto request = ResourceRequest::adopt(std::unique_ptr<CrossThreadResourceRequestData>(requestData)); 100 101 request->setHTTPReferrer(capturedOutgoingReferrer.string()); 102 103 auto options = std::unique_ptr<ThreadableLoaderOptions>(optionsCopy); 101 104 102 105 // FIXME: If the a site requests a local resource, then this will return a non-zero value but the sync path 103 106 // will return a 0 value. Either this should return 0 or the other code path should do a callback with 104 107 // a failure. 105 m_mainThreadLoader = DocumentThreadableLoader::create(document, *this, *request, options);108 m_mainThreadLoader = DocumentThreadableLoader::create(document, *this, *request, *options); 106 109 ASSERT(m_mainThreadLoader); 107 110 }); -
releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/CrossThreadCopier.h
r184080 r184081 93 93 // To allow a type to be passed across threads using its copy constructor, add a forward declaration of the type and 94 94 // a CopyThreadCopierBase<false, false, TypeName> : public CrossThreadCopierPassThrough<TypeName> { }; to this file. 95 template<> struct CrossThreadCopierBase<false, false, ThreadableLoaderOptions> : public CrossThreadCopierPassThrough<ThreadableLoaderOptions> {96 };97 98 95 template<> struct CrossThreadCopierBase<false, false, IntRect> : public CrossThreadCopierPassThrough<IntRect> { 99 96 };
Note:
See TracChangeset
for help on using the changeset viewer.