Changeset 270998 in webkit
- Timestamp:
- Dec 18, 2020 5:02:47 PM (19 months ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/Plugins/PDF/PDFPlugin.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r270997 r270998 1 2020-12-18 Brady Eidson <beidson@apple.com> 2 3 Fix some issues with PDFs as <object>. 4 https://bugs.webkit.org/show_bug.cgi?id=220024 5 6 Reviewed by Tim Horton. 7 8 No new tests (Unable to write automated tests) 9 10 * WebProcess/Plugins/PDF/PDFPlugin.mm: 11 (WebKit::dataProviderGetBytesAtPositionCallback): 12 (WebKit::PDFPlugin::getResourceBytesAtPosition): Set the correct URL. 13 (WebKit::PDFPlugin::ByteRangeRequest::completeWithAccumulatedData): Try harder to catch mismatches in delivered bytes vs expected bytes. 14 1 15 2020-12-18 Jeff Miller <jeffm@apple.com> 2 16 -
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
r270946 r270998 786 786 RunLoop::main().dispatch([plugin = WTFMove(plugin), position, count, buffer, &dataSemaphore, &bytesProvided] { 787 787 plugin->getResourceBytesAtPosition(count, position, [count, buffer, &dataSemaphore, &bytesProvided](const uint8_t* bytes, size_t bytesCount) { 788 ASSERT_UNUSED(count,bytesCount <= count);788 RELEASE_ASSERT(bytesCount <= count); 789 789 memcpy(buffer, bytes, bytesCount); 790 790 bytesProvided = bytesCount; … … 975 975 976 976 auto resourceRequest = documentLoader->request(); 977 resourceRequest.setURL(m_sourceURL); 977 978 resourceRequest.setHTTPHeaderField(HTTPHeaderName::Range, makeString("bytes="_s, position, "-"_s, position + count - 1)); 978 979 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::DoNotUseAnyCache); … … 1055 1056 #endif 1056 1057 1057 m_completionHandler(m_accumulatedData.data(), m_accumulatedData.size()); 1058 auto completionSize = m_accumulatedData.size(); 1059 if (completionSize > m_count) { 1060 RELEASE_LOG_ERROR(IncrementalPDF, "PDF byte range request got more bytes back from the server than requested. This is likely due to a misconfigured server. Capping result at the requested number of bytes."); 1061 completionSize = m_count; 1062 } 1063 1064 m_completionHandler(m_accumulatedData.data(), completionSize); 1058 1065 1059 1066 // Fold this data into the main data buffer so that if something in its range is requested again (which happens quite often)
Note: See TracChangeset
for help on using the changeset viewer.