<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[278521] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/278521">278521</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-06-04 21:47:23 -0700 (Fri, 04 Jun 2021)</dd>
</dl>
<h3>Log Message</h3>
<pre>FileSystem::readFromFile() should return data as `void*`
https://bugs.webkit.org/show_bug.cgi?id=226671
Reviewed by Darin Adler.
FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
consistent with FileSystem::writeToFile().
Source/JavaScriptCore:
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::backendCommands const):
Source/WebCore:
* platform/FileHandle.cpp:
(WebCore::FileHandle::read):
* platform/FileStream.cpp:
(WebCore::FileStream::read):
* platform/FileStream.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::readSync):
(WebCore::BlobResourceHandle::readDataSync):
(WebCore::BlobResourceHandle::readFileSync):
(WebCore::BlobResourceHandle::notifyReceiveData):
* platform/network/BlobResourceHandle.h:
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::readCachedData):
(WebCore::CurlCacheEntry::loadResponseHeaders):
(WebCore::CurlCacheEntry::loadFileToBuffer):
* platform/network/curl/CurlCacheEntry.h:
* rendering/RenderThemeWin.cpp:
(WebCore::fillBufferWithContentsOfFile):
(WebCore::RenderThemeWin::stringWithContentsOfFile):
Source/WebKit:
* NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
(WebKit::NetworkCache::IOChannel::read):
* Shared/PersistencyUtils.cpp:
(WebKit::createForFile):
Source/WTF:
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::appendFileContentsToFileHandle):
(WTF::FileSystemImpl::readOrMakeSalt):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::readFromFile):
Tools:
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
(TestWebKitAPI::readContentsOfFile):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremotesocketRemoteInspectorSocketcpp">trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFileSystemcpp">trunk/Source/WTF/wtf/FileSystem.cpp</a></li>
<li><a href="#trunkSourceWTFwtfFileSystemh">trunk/Source/WTF/wtf/FileSystem.h</a></li>
<li><a href="#trunkSourceWTFwtfglibFileSystemGlibcpp">trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp</a></li>
<li><a href="#trunkSourceWTFwtfposixFileSystemPOSIXcpp">trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp</a></li>
<li><a href="#trunkSourceWTFwtfwinFileSystemWincpp">trunk/Source/WTF/wtf/win/FileSystemWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorefileapiAsyncFileStreamcpp">trunk/Source/WebCore/fileapi/AsyncFileStream.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiAsyncFileStreamh">trunk/Source/WebCore/fileapi/AsyncFileStream.h</a></li>
<li><a href="#trunkSourceWebCoreplatformFileHandlecpp">trunk/Source/WebCore/platform/FileHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileStreamcpp">trunk/Source/WebCore/platform/FileStream.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileStreamh">trunk/Source/WebCore/platform/FileStream.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandleh">trunk/Source/WebCore/platform/network/BlobResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlCacheEntrycpp">trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlCacheEntryh">trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeWincpp">trunk/Source/WebCore/rendering/RenderThemeWin.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesscacheNetworkCacheIOChannelCurlcpp">trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedPersistencyUtilscpp">trunk/Source/WebKit/Shared/PersistencyUtils.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreFileMonitorcpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/JavaScriptCore/ChangeLog 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2021-06-04 Chris Dumez <cdumez@apple.com>
+
+ FileSystem::readFromFile() should return data as `void*`
+ https://bugs.webkit.org/show_bug.cgi?id=226671
+
+ Reviewed by Darin Adler.
+
+ FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
+ consistent with FileSystem::writeToFile().
+
+ * inspector/remote/socket/RemoteInspectorSocket.cpp:
+ (Inspector::RemoteInspector::backendCommands const):
+
</ins><span class="cx"> 2021-06-04 Devin Rousso <drousso@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: mark recently added protocol commands/events as page-only
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremotesocketRemoteInspectorSocketcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx"> String result;
</span><span class="cx"> if (auto size = FileSystem::fileSize(handle)) {
</span><span class="cx"> Vector<LChar> buffer(*size);
</span><del>- if (FileSystem::readFromFile(handle, reinterpret_cast<char*>(buffer.data()), *size) == *size)
</del><ins>+ if (FileSystem::readFromFile(handle, buffer.data(), *size) == *size)
</ins><span class="cx"> result = String::adopt(WTFMove(buffer));
</span><span class="cx"> }
</span><span class="cx"> FileSystem::closeFile(handle);
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/ChangeLog 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2021-06-04 Chris Dumez <cdumez@apple.com>
+
+ FileSystem::readFromFile() should return data as `void*`
+ https://bugs.webkit.org/show_bug.cgi?id=226671
+
+ Reviewed by Darin Adler.
+
+ FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
+ consistent with FileSystem::writeToFile().
+
+ * wtf/FileSystem.cpp:
+ (WTF::FileSystemImpl::appendFileContentsToFileHandle):
+ (WTF::FileSystemImpl::readOrMakeSalt):
+ * wtf/FileSystem.h:
+ * wtf/glib/FileSystemGlib.cpp:
+ (WTF::FileSystemImpl::readFromFile):
+ * wtf/posix/FileSystemPOSIX.cpp:
+ (WTF::FileSystemImpl::readFromFile):
+ * wtf/win/FileSystemWin.cpp:
+ (WTF::FileSystemImpl::readFromFile):
+
</ins><span class="cx"> 2021-06-04 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize
</span></span></pre></div>
<a id="trunkSourceWTFwtfFileSystemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FileSystem.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FileSystem.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/wtf/FileSystem.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> static int bufferSize = 1 << 19;
</span><del>- Vector<char> buffer(bufferSize);
</del><ins>+ Vector<uint8_t> buffer(bufferSize);
</ins><span class="cx">
</span><span class="cx"> auto fileCloser = WTF::makeScopeExit([source]() {
</span><span class="cx"> PlatformFileHandle handle = source;
</span><span class="lines">@@ -498,7 +498,7 @@
</span><span class="cx"> if (FileSystem::fileExists(path)) {
</span><span class="cx"> auto file = FileSystem::openFile(path, FileSystem::FileOpenMode::Read);
</span><span class="cx"> Salt salt;
</span><del>- auto bytesRead = static_cast<std::size_t>(FileSystem::readFromFile(file, reinterpret_cast<char*>(salt.data()), salt.size()));
</del><ins>+ auto bytesRead = static_cast<std::size_t>(FileSystem::readFromFile(file, salt.data(), salt.size()));
</ins><span class="cx"> FileSystem::closeFile(file);
</span><span class="cx"> if (bytesRead == salt.size())
</span><span class="cx"> return salt;
</span></span></pre></div>
<a id="trunkSourceWTFwtfFileSystemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FileSystem.h (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FileSystem.h 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/wtf/FileSystem.h 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> // Returns number of bytes actually read if successful, -1 otherwise.
</span><span class="cx"> WTF_EXPORT_PRIVATE int writeToFile(PlatformFileHandle, const void* data, int length);
</span><span class="cx"> // Returns number of bytes actually written if successful, -1 otherwise.
</span><del>-WTF_EXPORT_PRIVATE int readFromFile(PlatformFileHandle, char* data, int length); // FIXME: Should use `void*`.
</del><ins>+WTF_EXPORT_PRIVATE int readFromFile(PlatformFileHandle, void* data, int length);
</ins><span class="cx">
</span><span class="cx"> WTF_EXPORT_PRIVATE PlatformFileHandle openAndLockFile(const String&, FileOpenMode, OptionSet<FileLockMode> = FileLockMode::Exclusive);
</span><span class="cx"> WTF_EXPORT_PRIVATE void unlockAndCloseFile(PlatformFileHandle);
</span></span></pre></div>
<a id="trunkSourceWTFwtfglibFileSystemGlibcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx"> return bytesWritten;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int readFromFile(PlatformFileHandle handle, char* data, int length)
</del><ins>+int readFromFile(PlatformFileHandle handle, void* data, int length)
</ins><span class="cx"> {
</span><span class="cx"> GUniqueOutPtr<GError> error;
</span><span class="cx"> do {
</span></span></pre></div>
<a id="trunkSourceWTFwtfposixFileSystemPOSIXcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> return -1;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int readFromFile(PlatformFileHandle handle, char* data, int length)
</del><ins>+int readFromFile(PlatformFileHandle handle, void* data, int length)
</ins><span class="cx"> {
</span><span class="cx"> do {
</span><span class="cx"> int bytesRead = read(handle, data, static_cast<size_t>(length));
</span></span></pre></div>
<a id="trunkSourceWTFwtfwinFileSystemWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/win/FileSystemWin.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/win/FileSystemWin.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WTF/wtf/win/FileSystemWin.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> return static_cast<int>(bytesWritten);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int readFromFile(PlatformFileHandle handle, char* data, int length)
</del><ins>+int readFromFile(PlatformFileHandle handle, void* data, int length)
</ins><span class="cx"> {
</span><span class="cx"> if (!isHandleValid(handle))
</span><span class="cx"> return -1;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/ChangeLog 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2021-06-04 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ FileSystem::readFromFile() should return data as `void*`
+ https://bugs.webkit.org/show_bug.cgi?id=226671
+
+ Reviewed by Darin Adler.
+
+ FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
+ consistent with FileSystem::writeToFile().
+
+ * platform/FileHandle.cpp:
+ (WebCore::FileHandle::read):
+ * platform/FileStream.cpp:
+ (WebCore::FileStream::read):
+ * platform/FileStream.h:
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::readSync):
+ (WebCore::BlobResourceHandle::readDataSync):
+ (WebCore::BlobResourceHandle::readFileSync):
+ (WebCore::BlobResourceHandle::notifyReceiveData):
+ * platform/network/BlobResourceHandle.h:
+ * platform/network/curl/CurlCacheEntry.cpp:
+ (WebCore::CurlCacheEntry::readCachedData):
+ (WebCore::CurlCacheEntry::loadResponseHeaders):
+ (WebCore::CurlCacheEntry::loadFileToBuffer):
+ * platform/network/curl/CurlCacheEntry.h:
+ * rendering/RenderThemeWin.cpp:
+ (WebCore::fillBufferWithContentsOfFile):
+ (WebCore::RenderThemeWin::stringWithContentsOfFile):
+
+2021-06-04 Chris Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Worker.constructor throws an exception when the url param is an empty string
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=226637
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiAsyncFileStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/AsyncFileStream.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/AsyncFileStream.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/fileapi/AsyncFileStream.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AsyncFileStream::read(char* buffer, int length)
</del><ins>+void AsyncFileStream::read(void* buffer, int length)
</ins><span class="cx"> {
</span><span class="cx"> perform([buffer, length](FileStream& stream) -> WTF::Function<void(FileStreamClient&)> {
</span><span class="cx"> int bytesRead = stream.read(buffer, length);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiAsyncFileStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/AsyncFileStream.h (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/AsyncFileStream.h 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/fileapi/AsyncFileStream.h 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> void getSize(const String& path, std::optional<WallTime> expectedModificationTime);
</span><span class="cx"> void openForRead(const String& path, long long offset, long long length);
</span><span class="cx"> void close();
</span><del>- void read(char* buffer, int length);
</del><ins>+ void read(void* buffer, int length);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void start();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileHandle.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileHandle.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/FileHandle.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!open())
</span><span class="cx"> return -1;
</span><del>- return FileSystem::readFromFile(m_fileHandle, static_cast<char*>(data), length);
</del><ins>+ return FileSystem::readFromFile(m_fileHandle, data, length);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int FileHandle::write(const void* data, int length)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileStream.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileStream.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/FileStream.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int FileStream::read(char* buffer, int bufferSize)
</del><ins>+int FileStream::read(void* buffer, int bufferSize)
</ins><span class="cx"> {
</span><span class="cx"> if (!FileSystem::isHandleValid(m_handle))
</span><span class="cx"> return -1;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileStream.h (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileStream.h 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/FileStream.h 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> // Reads a file into the provided data buffer.
</span><span class="cx"> // Returns number of bytes being read on success. -1 otherwise.
</span><span class="cx"> // If 0 is returned, it means that the reading is completed.
</span><del>- int read(char* buffer, int length);
</del><ins>+ int read(void* buffer, int length);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> FileSystem::PlatformFileHandle m_handle;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">
</span><span class="cx"> // Read all the data.
</span><span class="cx"> m_data.resize(static_cast<size_t>(response.expectedContentLength()));
</span><del>- static_cast<BlobResourceHandle*>(handle)->readSync(reinterpret_cast<char*>(m_data.data()), static_cast<int>(m_data.size()));
</del><ins>+ static_cast<BlobResourceHandle*>(handle)->readSync(m_data.data(), static_cast<int>(m_data.size()));
</ins><span class="cx"> completionHandler();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx"> m_totalRemainingSize -= m_rangeOffset;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int BlobResourceHandle::readSync(char* buf, int length)
</del><ins>+int BlobResourceHandle::readSync(uint8_t* buf, int length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int BlobResourceHandle::readDataSync(const BlobDataItem& item, char* buf, int length)
</del><ins>+int BlobResourceHandle::readDataSync(const BlobDataItem& item, void* buf, int length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="lines">@@ -390,7 +390,7 @@
</span><span class="cx"> return bytesToRead;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int BlobResourceHandle::readFileSync(const BlobDataItem& item, char* buf, int length)
</del><ins>+int BlobResourceHandle::readFileSync(const BlobDataItem& item, void* buf, int length)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="lines">@@ -460,7 +460,7 @@
</span><span class="cx"> if (bytesToRead > m_totalRemainingSize)
</span><span class="cx"> bytesToRead = m_totalRemainingSize;
</span><span class="cx">
</span><del>- auto* data = reinterpret_cast<const char*>(item.data().data()->data()) + item.offset() + m_currentItemReadSize;
</del><ins>+ auto* data = item.data().data()->data() + item.offset() + m_currentItemReadSize;
</ins><span class="cx"> m_currentItemReadSize = 0;
</span><span class="cx">
</span><span class="cx"> consumeData(data, static_cast<int>(bytesToRead));
</span><span class="lines">@@ -506,7 +506,7 @@
</span><span class="cx"> consumeData(m_buffer.data(), bytesRead);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BlobResourceHandle::consumeData(const char* data, int bytesRead)
</del><ins>+void BlobResourceHandle::consumeData(const uint8_t* data, int bytesRead)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_async);
</span><span class="cx"> Ref<BlobResourceHandle> protectedThis(*this);
</span><span class="lines">@@ -614,10 +614,10 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BlobResourceHandle::notifyReceiveData(const char* data, int bytesRead)
</del><ins>+void BlobResourceHandle::notifyReceiveData(const uint8_t* data, int bytesRead)
</ins><span class="cx"> {
</span><span class="cx"> if (client())
</span><del>- client()->didReceiveBuffer(this, SharedBuffer::create(reinterpret_cast<const uint8_t*>(data), bytesRead), bytesRead);
</del><ins>+ client()->didReceiveBuffer(this, SharedBuffer::create(data, bytesRead), bytesRead);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void BlobResourceHandle::notifyFail(Error errorCode)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.h (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.h 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.h 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> static void loadResourceSynchronously(BlobData*, const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
</span><span class="cx">
</span><span class="cx"> void start();
</span><del>- int readSync(char*, int);
</del><ins>+ int readSync(uint8_t*, int);
</ins><span class="cx">
</span><span class="cx"> bool aborted() const { return m_aborted; }
</span><span class="cx">
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> void doStart();
</span><span class="cx"> void getSizeForNext();
</span><span class="cx"> void seek();
</span><del>- void consumeData(const char* data, int bytesRead);
</del><ins>+ void consumeData(const uint8_t* data, int bytesRead);
</ins><span class="cx"> void failed(Error);
</span><span class="cx">
</span><span class="cx"> void readAsync();
</span><span class="lines">@@ -86,13 +86,13 @@
</span><span class="cx"> void readDataAsync(const BlobDataItem&);
</span><span class="cx"> void readFileAsync(const BlobDataItem&);
</span><span class="cx">
</span><del>- int readDataSync(const BlobDataItem&, char*, int);
- int readFileSync(const BlobDataItem&, char*, int);
</del><ins>+ int readDataSync(const BlobDataItem&, void*, int);
+ int readFileSync(const BlobDataItem&, void*, int);
</ins><span class="cx">
</span><span class="cx"> void notifyResponse();
</span><span class="cx"> void notifyResponseOnSuccess();
</span><span class="cx"> void notifyResponseOnError();
</span><del>- void notifyReceiveData(const char*, int);
</del><ins>+ void notifyReceiveData(const uint8_t*, int);
</ins><span class="cx"> void notifyFail(Error);
</span><span class="cx"> void notifyFinish();
</span><span class="cx">
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> bool m_async;
</span><span class="cx"> std::unique_ptr<AsyncFileStream> m_asyncStream; // For asynchronous loading.
</span><span class="cx"> std::unique_ptr<FileStream> m_stream; // For synchronous loading.
</span><del>- Vector<char> m_buffer;
</del><ins>+ Vector<uint8_t> m_buffer;
</ins><span class="cx"> Vector<long long> m_itemLengthList;
</span><span class="cx"> Error m_errorCode { Error::NoError };
</span><span class="cx"> bool m_aborted { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlCacheEntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -113,12 +113,12 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(job->client());
</span><span class="cx">
</span><del>- Vector<char> buffer;
</del><ins>+ Vector<uint8_t> buffer;
</ins><span class="cx"> if (!loadFileToBuffer(m_contentFilename, buffer))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (buffer.size())
- job->getInternal()->client()->didReceiveBuffer(job, SharedBuffer::create(buffer.data(), buffer.size()), buffer.size());
</del><ins>+ if (auto bufferSize = buffer.size())
+ job->getInternal()->client()->didReceiveBuffer(job, SharedBuffer::create(WTFMove(buffer)), bufferSize);
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">
</span><span class="cx"> bool CurlCacheEntry::loadResponseHeaders()
</span><span class="cx"> {
</span><del>- Vector<char> buffer;
</del><ins>+ Vector<uint8_t> buffer;
</ins><span class="cx"> if (!loadFileToBuffer(m_headerFilename, buffer))
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx"> m_basename = baseNameBuilder.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CurlCacheEntry::loadFileToBuffer(const String& filepath, Vector<char>& buffer)
</del><ins>+bool CurlCacheEntry::loadFileToBuffer(const String& filepath, Vector<uint8_t>& buffer)
</ins><span class="cx"> {
</span><span class="cx"> // Open the file
</span><span class="cx"> FileSystem::PlatformFileHandle inputFile = FileSystem::openFile(filepath, FileSystem::FileOpenMode::Read);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlCacheEntryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.h (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.h 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.h 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> ResourceHandle* m_job;
</span><span class="cx">
</span><span class="cx"> void generateBaseFilename(const CString& url);
</span><del>- bool loadFileToBuffer(const String& filepath, Vector<char>& buffer);
</del><ins>+ bool loadFileToBuffer(const String& filepath, Vector<uint8_t>& buffer);
</ins><span class="cx"> bool loadResponseHeaders();
</span><span class="cx">
</span><span class="cx"> bool openContentFile();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1013,7 +1013,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-static void fillBufferWithContentsOfFile(FileSystem::PlatformFileHandle file, long long filesize, Vector<char>& buffer)
</del><ins>+static void fillBufferWithContentsOfFile(FileSystem::PlatformFileHandle file, long long filesize, Vector<uint8_t>& buffer)
</ins><span class="cx"> {
</span><span class="cx"> // Load the file content into buffer
</span><span class="cx"> buffer.resize(filesize + 1);
</span><span class="lines">@@ -1058,7 +1058,7 @@
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Vector<char> fileContents;
</del><ins>+ Vector<uint8_t> fileContents;
</ins><span class="cx"> fillBufferWithContentsOfFile(requestedFileHandle, *filesize, fileContents);
</span><span class="cx"> FileSystem::closeFile(requestedFileHandle);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebKit/ChangeLog 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2021-06-04 Chris Dumez <cdumez@apple.com>
+
+ FileSystem::readFromFile() should return data as `void*`
+ https://bugs.webkit.org/show_bug.cgi?id=226671
+
+ Reviewed by Darin Adler.
+
+ FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
+ consistent with FileSystem::writeToFile().
+
+ * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
+ (WebKit::NetworkCache::IOChannel::read):
+ * Shared/PersistencyUtils.cpp:
+ (WebKit::createForFile):
+
</ins><span class="cx"> 2021-06-04 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r275765) When ignoring HSTS, sometimes loads fail
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesscacheNetworkCacheIOChannelCurlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> readSize = std::min(size, readSize);
</span><span class="cx"> Vector<uint8_t> buffer(readSize);
</span><span class="cx"> FileSystem::seekFile(m_fileDescriptor, offset, FileSystem::FileSeekOrigin::Beginning);
</span><del>- int err = FileSystem::readFromFile(m_fileDescriptor, reinterpret_cast<char*>(buffer.data()), readSize);
</del><ins>+ int err = FileSystem::readFromFile(m_fileDescriptor, buffer.data(), readSize);
</ins><span class="cx"> err = err < 0 ? err : 0;
</span><span class="cx"> auto data = Data(WTFMove(buffer));
</span><span class="cx"> completionHandler(data, err);
</span></span></pre></div>
<a id="trunkSourceWebKitSharedPersistencyUtilscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/PersistencyUtils.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/PersistencyUtils.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Source/WebKit/Shared/PersistencyUtils.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Vector<char> buffer(bytesToRead);
</del><ins>+ Vector<uint8_t> buffer(bytesToRead);
</ins><span class="cx"> size_t totalBytesRead = FileSystem::readFromFile(handle, buffer.data(), buffer.size());
</span><span class="cx">
</span><span class="cx"> FileSystem::unlockAndCloseFile(handle);
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // FIXME: We should try to modify the constructor to pass &&.
</span><del>- return KeyedDecoder::decoder(reinterpret_cast<const uint8_t*>(buffer.data()), buffer.size());
</del><ins>+ return KeyedDecoder::decoder(buffer.data(), buffer.size());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void writeToDisk(std::unique_ptr<KeyedEncoder>&& encoder, String&& path)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Tools/ChangeLog 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> 2021-06-04 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ FileSystem::readFromFile() should return data as `void*`
+ https://bugs.webkit.org/show_bug.cgi?id=226671
+
+ Reviewed by Darin Adler.
+
+ FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
+ consistent with FileSystem::writeToFile().
+
+ * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
+ (TestWebKitAPI::readContentsOfFile):
+
+2021-06-04 Chris Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Use Vector<uint8_t> instead of Vector<char> to store bytes in SharedBuffer
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=226623
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreFileMonitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp (278520 => 278521)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp 2021-06-05 04:39:39 UTC (rev 278520)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp 2021-06-05 04:47:23 UTC (rev 278521)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> // Since we control the test files, we know we only need one read
</span><del>- int readBytes = FileSystem::readFromFile(source, reinterpret_cast<char*>(buffer.characters()), bufferSize);
</del><ins>+ int readBytes = FileSystem::readFromFile(source, buffer.characters(), bufferSize);
</ins><span class="cx"> if (readBytes < 0)
</span><span class="cx"> return emptyString();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>