Changeset 276677 in webkit
- Timestamp:
- Apr 27, 2021, 4:01:41 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/files/blob-content-type-expected.txt (added)
-
LayoutTests/fast/files/blob-content-type.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/fileapi/Blob.cpp (modified) (1 diff)
-
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (modified) (1 diff)
-
Source/WebCore/fileapi/ThreadableBlobRegistry.h (modified) (1 diff)
-
Source/WebCore/platform/network/BlobRegistry.h (modified) (1 diff)
-
Source/WebCore/platform/network/BlobRegistryImpl.cpp (modified) (2 diffs)
-
Source/WebCore/platform/network/BlobRegistryImpl.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (modified) (2 diffs)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm (modified) (1 diff)
-
Source/WebKitLegacy/win/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276673 r276677 1 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 3 charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost 4 https://bugs.webkit.org/show_bug.cgi?id=225057 5 6 Reviewed by Chris Dumez. 7 8 * fast/files/blob-content-type-expected.txt: Added. 9 * fast/files/blob-content-type.html: Added. 10 1 11 2021-04-27 Aditya Keerthi <akeerthi@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r276660 r276677 1 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 3 charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost 4 https://bugs.webkit.org/show_bug.cgi?id=225057 5 6 Reviewed by Chris Dumez. 7 8 When calling Blob.slice, use the content type from the call, not from the sliced-from blob. 9 This matches Chrome and Firefox. 10 11 When no content type is given, browsers disagree on what happens, so keep existing behavior in that case. 12 13 Test: fast/files/blob-content-type.html 14 15 * fileapi/Blob.cpp: 16 (WebCore::Blob::Blob): 17 * fileapi/ThreadableBlobRegistry.cpp: 18 (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice): 19 * fileapi/ThreadableBlobRegistry.h: 20 * platform/network/BlobRegistry.h: 21 * platform/network/BlobRegistryImpl.cpp: 22 (WebCore::BlobRegistryImpl::registerBlobURLForSlice): 23 * platform/network/BlobRegistryImpl.h: 24 1 25 2021-04-27 Alexey Shvayka <shvaikalesh@gmail.com> 2 26 -
trunk/Source/WebCore/fileapi/Blob.cpp
r273890 r276677 161 161 { 162 162 m_internalURL = BlobURL::createInternalURL(); 163 ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end );163 ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end, m_type); 164 164 } 165 165 -
trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
r276230 r276677 127 127 } 128 128 129 void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end )129 void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end, const String& contentType) 130 130 { 131 131 if (isMainThread()) { 132 blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end );132 blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end, contentType); 133 133 return; 134 134 } 135 135 136 callOnMainThread([newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end ] {137 blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end );136 callOnMainThread([newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end, contentType = contentType.isolatedCopy()] { 137 blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end, contentType); 138 138 }); 139 139 } -
trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h
r263830 r276677 45 45 static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL); 46 46 static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType); 47 static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end );47 static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end, const String& contentType); 48 48 static void unregisterBlobURL(const URL&); 49 49 -
trunk/Source/WebCore/platform/network/BlobRegistry.h
r263830 r276677 60 60 61 61 // Negative start and end values select from the end. 62 virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end ) = 0;62 virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) = 0; 63 63 64 64 virtual void unregisterBlobURL(const URL&) = 0; -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp
r270269 r276677 179 179 } 180 180 181 void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end )181 void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) 182 182 { 183 183 ASSERT(isMainThread()); … … 208 208 209 209 unsigned long long newLength = end - start; 210 auto newData = BlobData::create( originalData->contentType());210 auto newData = BlobData::create(contentType.isEmpty() ? originalData->contentType() : contentType); 211 211 212 212 appendStorageItems(newData.ptr(), originalData->items(), start, newLength); -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.h
r248593 r276677 63 63 void registerBlobURL(const URL&, const URL& srcURL); 64 64 void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType); 65 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end );65 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType); 66 66 void unregisterBlobURL(const URL&); 67 67 -
trunk/Source/WebKit/ChangeLog
r276671 r276677 1 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 3 charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost 4 https://bugs.webkit.org/show_bug.cgi?id=225057 5 6 Reviewed by Chris Dumez. 7 8 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 9 (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): 10 * NetworkProcess/NetworkConnectionToWebProcess.h: 11 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: 12 * NetworkProcess/NetworkProcessPlatformStrategies.cpp: 13 (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry): 14 * WebProcess/FileAPI/BlobRegistryProxy.cpp: 15 (WebKit::BlobRegistryProxy::registerBlobURLForSlice): 16 * WebProcess/FileAPI/BlobRegistryProxy.h: 17 1 18 2021-04-27 Fujii Hironori <Hironori.Fujii@sony.com> 2 19 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r275846 r276677 839 839 } 840 840 841 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end )841 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end, const String& contentType) 842 842 { 843 843 auto* session = networkSession(); … … 845 845 return; 846 846 847 session->blobRegistry().registerBlobURLForSlice(url, srcURL, start, end );847 session->blobRegistry().registerBlobURLForSlice(url, srcURL, start, end, contentType); 848 848 } 849 849 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r275846 r276677 234 234 void registerBlobURLFromURL(const URL&, const URL& srcURL); 235 235 void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType); 236 void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end );236 void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end, const String& contentType); 237 237 void blobSize(const URL&, CompletionHandler<void(uint64_t)>&&); 238 238 void unregisterBlobURL(const URL&); -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r275846 r276677 53 53 RegisterBlobURLFromURL(URL url, URL srcURL) 54 54 RegisterBlobURLOptionallyFileBacked(URL url, URL srcURL, String fileBackedPath, String contentType) 55 RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end )55 RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end, String contentType) 56 56 UnregisterBlobURL(URL url) 57 57 BlobSize(URL url) -> (uint64_t resultSize) Synchronous -
trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp
r263830 r276677 62 62 void registerBlobURL(const URL&, const URL& srcURL) final { ASSERT_NOT_REACHED(); } 63 63 void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); } 64 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end ) final { ASSERT_NOT_REACHED(); }64 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final { ASSERT_NOT_REACHED(); } 65 65 void unregisterBlobURL(const URL&) final { ASSERT_NOT_REACHED(); } 66 66 unsigned long long blobSize(const URL&) final { ASSERT_NOT_REACHED(); return 0; } -
trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp
r263830 r276677 70 70 } 71 71 72 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end )72 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) 73 73 { 74 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end ), 0);74 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end, contentType), 0); 75 75 } 76 76 -
trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h
r263830 r276677 37 37 void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) final; 38 38 void unregisterBlobURL(const URL&) final; 39 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end ) final;39 void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final; 40 40 unsigned long long blobSize(const URL&) final; 41 41 void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r276652 r276677 1 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 3 charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost 4 https://bugs.webkit.org/show_bug.cgi?id=225057 5 6 Reviewed by Chris Dumez. 7 8 * WebCoreSupport/WebPlatformStrategies.mm: 9 1 10 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 11 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm
r274829 r276677 88 88 void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); } 89 89 void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); } 90 void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end ) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }90 void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); } 91 91 void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); } 92 92 unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); } -
trunk/Source/WebKitLegacy/win/ChangeLog
r276468 r276677 1 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 3 charset in contentType used in Blob.prototype.slice(start, end, contentType) is lost 4 https://bugs.webkit.org/show_bug.cgi?id=225057 5 6 Reviewed by Chris Dumez. 7 8 * WebCoreSupport/WebPlatformStrategies.cpp: 9 1 10 2021-04-22 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp
r270808 r276677 85 85 void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); } 86 86 void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); } 87 void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end ) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }87 void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); } 88 88 void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); } 89 89 unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
Note:
See TracChangeset
for help on using the changeset viewer.