Changeset 291730 in webkit
- Timestamp:
- Mar 22, 2022, 5:58:41 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/URL.cpp (modified) (3 diffs)
-
WTF/wtf/URL.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/History.cpp (modified) (1 diff)
-
WebCore/platform/network/BlobRegistryImpl.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r291630 r291730 1 2022-03-22 Chris Dumez <cdumez@apple.com> 2 3 Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView 4 https://bugs.webkit.org/show_bug.cgi?id=238221 5 6 Reviewed by Geoffrey Garen. 7 8 * wtf/URL.cpp: 9 (WTF::URL::viewWithoutQueryOrFragmentIdentifier const): 10 (WTF::URL::viewWithoutFragmentIdentifier const): 11 (WTF::URL::stringWithoutFragmentIdentifier const): 12 (WTF::equalIgnoringFragmentIdentifier): 13 (WTF::URL::stringWithoutQueryOrFragmentIdentifier const): Deleted. 14 * wtf/URL.h: 15 1 16 2022-03-22 Per Arne Vollan <pvollan@apple.com> 2 17 -
trunk/Source/WTF/wtf/URL.cpp
r290846 r291730 709 709 } 710 710 711 StringView URL:: stringWithoutQueryOrFragmentIdentifier() const711 StringView URL::viewWithoutQueryOrFragmentIdentifier() const 712 712 { 713 713 if (!m_isValid) … … 717 717 } 718 718 719 StringView URL:: stringWithoutFragmentIdentifier() const719 StringView URL::viewWithoutFragmentIdentifier() const 720 720 { 721 721 if (!m_isValid) … … 725 725 } 726 726 727 String URL::stringWithoutFragmentIdentifier() const 728 { 729 if (!m_isValid) 730 return m_string; 731 732 return m_string.left(m_queryEnd); 733 } 734 727 735 bool equalIgnoringFragmentIdentifier(const URL& a, const URL& b) 728 736 { 729 return a. stringWithoutFragmentIdentifier() == b.stringWithoutFragmentIdentifier();737 return a.viewWithoutFragmentIdentifier() == b.viewWithoutFragmentIdentifier(); 730 738 } 731 739 -
trunk/Source/WTF/wtf/URL.h
r290350 r291730 118 118 WTF_EXPORT_PRIVATE StringView queryWithLeadingQuestionMark() const; 119 119 WTF_EXPORT_PRIVATE StringView fragmentIdentifierWithLeadingNumberSign() const; 120 WTF_EXPORT_PRIVATE StringView stringWithoutQueryOrFragmentIdentifier() const; 121 WTF_EXPORT_PRIVATE StringView stringWithoutFragmentIdentifier() const; 120 WTF_EXPORT_PRIVATE StringView viewWithoutQueryOrFragmentIdentifier() const; 121 WTF_EXPORT_PRIVATE StringView viewWithoutFragmentIdentifier() const; 122 WTF_EXPORT_PRIVATE String stringWithoutFragmentIdentifier() const; 122 123 123 124 WTF_EXPORT_PRIVATE String protocolHostAndPort() const; -
trunk/Source/WebCore/ChangeLog
r291726 r291730 1 2022-03-22 Chris Dumez <cdumez@apple.com> 2 3 Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView 4 https://bugs.webkit.org/show_bug.cgi?id=238221 5 6 Reviewed by Geoffrey Garen. 7 8 * page/History.cpp: 9 (WebCore::History::stateObjectAdded): 10 * platform/network/BlobRegistryImpl.cpp: 11 (WebCore::BlobRegistryImpl::getBlobDataFromURL const): 12 (WebCore::BlobRegistryImpl::registerBlobURLHandle): 13 (WebCore::BlobRegistryImpl::unregisterBlobURLHandle): 14 (WebCore::blobURLWithoutFragment): Deleted. 15 1 16 2022-03-22 Sihui Liu <sihui_liu@apple.com> 2 17 -
trunk/Source/WebCore/page/History.cpp
r290566 r291730 209 209 // See https://bugs.webkit.org/show_bug.cgi?id=183028 for the compatibility concerns. 210 210 bool allowSandboxException = (documentSecurityOrigin.isLocal() || documentSecurityOrigin.isUnique()) 211 && documentURL. stringWithoutQueryOrFragmentIdentifier() == fullURL.stringWithoutQueryOrFragmentIdentifier();211 && documentURL.viewWithoutQueryOrFragmentIdentifier() == fullURL.viewWithoutQueryOrFragmentIdentifier(); 212 212 213 213 if (!allowSandboxException && !documentSecurityOrigin.canRequest(fullURL) && (fullURL.path() != documentURL.path() || fullURL.query() != documentURL.query())) -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp
r291689 r291730 51 51 namespace WebCore { 52 52 53 static String blobURLWithoutFragment(const URL& url)54 {55 return url.hasFragmentIdentifier() ? url.stringWithoutFragmentIdentifier().toString() : url.string();56 }57 58 53 BlobRegistryImpl::~BlobRegistryImpl() = default; 59 54 … … 236 231 ASSERT(isMainThread()); 237 232 if (url.hasFragmentIdentifier()) 238 return m_blobs.get(url. stringWithoutFragmentIdentifier().toStringWithoutCopying());233 return m_blobs.get(url.viewWithoutFragmentIdentifier().toStringWithoutCopying()); 239 234 return m_blobs.get(url.string()); 240 235 } … … 381 376 void BlobRegistryImpl::registerBlobURLHandle(const URL& url) 382 377 { 383 auto urlKey = blobURLWithoutFragment(url);378 auto urlKey = url.stringWithoutFragmentIdentifier(); 384 379 if (m_blobs.contains(urlKey)) 385 380 m_blobReferences.add(urlKey); … … 388 383 void BlobRegistryImpl::unregisterBlobURLHandle(const URL& url) 389 384 { 390 auto urlKey = blobURLWithoutFragment(url);385 auto urlKey = url.stringWithoutFragmentIdentifier(); 391 386 if (m_blobReferences.remove(urlKey)) 392 387 m_blobs.remove(urlKey);
Note:
See TracChangeset
for help on using the changeset viewer.