Changeset 262026 in webkit
- Timestamp:
- May 21, 2020 1:40:03 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r262025 r262026 1 2020-05-21 Youenn Fablet <youenn@apple.com> 2 3 Incorrect location.origin in blob workers 4 https://bugs.webkit.org/show_bug.cgi?id=211876 5 <rdar://problem/63284717> 6 7 Reviewed by Sihui Liu. 8 9 * http/tests/security/contentSecurityPolicy/worker-blob-location-expected.txt: Added. 10 * http/tests/security/contentSecurityPolicy/worker-blob-location.html: Added. 11 1 12 2020-05-21 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r262024 r262026 1 2020-05-21 Youenn Fablet <youenn@apple.com> 2 3 Incorrect location.origin in blob workers 4 https://bugs.webkit.org/show_bug.cgi?id=211876 5 <rdar://problem/63284717> 6 7 Reviewed by Sihui Liu. 8 9 Instead of computing the origin from the location URL in worker, get it directly from the WorkerGlobalScope origin. 10 This ensures we unwrap properly blob URLs. 11 12 Test: http/tests/security/contentSecurityPolicy/worker-blob-location.html 13 14 * workers/WorkerGlobalScope.cpp: 15 (WebCore::WorkerGlobalScope::location const): 16 * workers/WorkerLocation.cpp: 17 (WebCore::WorkerLocation::origin const): 18 * workers/WorkerLocation.h: 19 (WebCore::WorkerLocation::create): 20 (WebCore::WorkerLocation::url const): 21 (WebCore::WorkerLocation::WorkerLocation): 22 1 23 2020-05-21 John Wilander <wilander@apple.com> 2 24 -
trunk/Source/WebCore/workers/WorkerGlobalScope.cpp
r259298 r262026 240 240 { 241 241 if (!m_location) 242 m_location = WorkerLocation::create( m_url);242 m_location = WorkerLocation::create(URL { m_url }, origin()); 243 243 return *m_location; 244 244 } -
trunk/Source/WebCore/workers/WorkerLocation.cpp
r260707 r262026 76 76 String WorkerLocation::origin() const 77 77 { 78 return SecurityOriginData::fromURL(m_url).toString();78 return m_origin; 79 79 } 80 80 -
trunk/Source/WebCore/workers/WorkerLocation.h
r238771 r262026 34 34 class WorkerLocation : public RefCounted<WorkerLocation> { 35 35 public: 36 static Ref<WorkerLocation> create(const URL& url) 37 { 38 return adoptRef(*new WorkerLocation(url)); 39 } 36 static Ref<WorkerLocation> create(URL&& url, String&& origin) { return adoptRef(*new WorkerLocation(WTFMove(url), WTFMove(origin))); } 40 37 41 38 const URL& url() const { return m_url; } 42 43 39 String href() const; 44 40 … … 54 50 55 51 private: 56 explicit WorkerLocation(const URL& url) : m_url(url) { } 52 WorkerLocation(URL&& url, String&& origin) 53 : m_url(WTFMove(url)) 54 , m_origin(WTFMove(origin)) 55 { 56 } 57 57 58 58 URL m_url; 59 String m_origin; 59 60 }; 60 61
Note: See TracChangeset
for help on using the changeset viewer.