Diff
Modified: trunk/Source/WTF/ChangeLog (215454 => 215455)
--- trunk/Source/WTF/ChangeLog 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WTF/ChangeLog 2017-04-18 07:57:21 UTC (rev 215455)
@@ -1,3 +1,14 @@
+2017-04-18 Carlos Garcia Campos <[email protected]>
+
+ [GLIB] Define priorities also for async network IO tasks
+ https://bugs.webkit.org/show_bug.cgi?id=170905
+
+ Reviewed by Žan Doberšek.
+
+ Add AsyncIONetwork, DiskCacheRead and DiskCacheWrite priorities.
+
+ * wtf/glib/RunLoopSourcePriority.h:
+
2017-04-18 Yusuke Suzuki <[email protected]>
[JSC][GTK] glib RunLoop does not accept negative start interval
Modified: trunk/Source/WTF/wtf/glib/RunLoopSourcePriority.h (215454 => 215455)
--- trunk/Source/WTF/wtf/glib/RunLoopSourcePriority.h 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WTF/wtf/glib/RunLoopSourcePriority.h 2017-04-18 07:57:21 UTC (rev 215455)
@@ -68,7 +68,16 @@
DisplayRefreshMonitorTimer = -100,
// Rendering timer in the main thread when accelerated compositing is not used.
- NonAcceleratedDrawingTimer = 100
+ NonAcceleratedDrawingTimer = 100,
+
+ // Async IO network callbacks.
+ AsyncIONetwork = 100,
+
+ // Disk cache read callbacks.
+ DiskCacheRead = 100,
+
+ // Disk cache write callbacks.
+ DiskCacheWrite = 200,
};
} // namespace WTF
Modified: trunk/Source/WebCore/ChangeLog (215454 => 215455)
--- trunk/Source/WebCore/ChangeLog 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebCore/ChangeLog 2017-04-18 07:57:21 UTC (rev 215455)
@@ -1,3 +1,19 @@
+2017-04-18 Carlos Garcia Campos <[email protected]>
+
+ [GLIB] Define priorities also for async network IO tasks
+ https://bugs.webkit.org/show_bug.cgi?id=170905
+
+ Reviewed by Žan Doberšek.
+
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::redirectSkipCallback):
+ (WebCore::sendRequestCallback):
+ (WebCore::continueAfterDidReceiveResponse):
+ (WebCore::readCallback):
+ * platform/network/soup/SocketStreamHandleImplSoup.cpp:
+ (WebCore::SocketStreamHandleImpl::connected):
+ (WebCore::SocketStreamHandleImpl::readBytes):
+
2017-04-17 Zan Dobersek <[email protected]>
Unreviewed build fix for !ENABLE(MEDIA_STREAM) configurations.
Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (215454 => 215455)
--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2017-04-18 07:57:21 UTC (rev 215455)
@@ -58,6 +58,7 @@
#endif
#include <wtf/CurrentTime.h>
#include <wtf/glib/GRefPtr.h>
+#include <wtf/glib/RunLoopSourcePriority.h>
#include <wtf/text/CString.h>
namespace WebCore {
@@ -382,7 +383,7 @@
}
if (bytesSkipped > 0) {
- g_input_stream_skip_async(d->m_inputStream.get(), gDefaultReadBufferSize, G_PRIORITY_DEFAULT,
+ g_input_stream_skip_async(d->m_inputStream.get(), gDefaultReadBufferSize, RunLoopSourcePriority::AsyncIONetwork,
d->m_cancellable.get(), redirectSkipCallback, handle.get());
return;
}
@@ -513,7 +514,7 @@
if (SOUP_STATUS_IS_REDIRECTION(soupMessage->status_code) && shouldRedirect(handle.get())) {
d->m_inputStream = inputStream;
- g_input_stream_skip_async(d->m_inputStream.get(), gDefaultReadBufferSize, G_PRIORITY_DEFAULT,
+ g_input_stream_skip_async(d->m_inputStream.get(), gDefaultReadBufferSize, RunLoopSourcePriority::AsyncIONetwork,
d->m_cancellable.get(), redirectSkipCallback, handle.get());
return;
}
@@ -551,7 +552,7 @@
ResourceHandleInternal* d = handle->getInternal();
if (d->m_soupMessage && d->m_multipartInputStream && !d->m_inputStream) {
- soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), G_PRIORITY_DEFAULT,
+ soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), RunLoopSourcePriority::AsyncIONetwork,
d->m_cancellable.get(), nextMultipartResponsePartCallback, handle);
return;
}
@@ -559,7 +560,7 @@
ASSERT(d->m_inputStream);
handle->ensureReadBuffer();
g_input_stream_read_async(d->m_inputStream.get(), const_cast<char*>(d->m_soupBuffer->data), d->m_soupBuffer->length,
- G_PRIORITY_DEFAULT, d->m_cancellable.get(), readCallback, handle);
+ RunLoopSourcePriority::AsyncIONetwork, d->m_cancellable.get(), readCallback, handle);
}
#if ENABLE(WEB_TIMING)
@@ -1004,7 +1005,7 @@
// If this is a multipart message, we'll look for another part.
if (d->m_soupMessage && d->m_multipartInputStream) {
d->m_inputStream.clear();
- soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), G_PRIORITY_DEFAULT,
+ soup_multipart_input_stream_next_part_async(d->m_multipartInputStream.get(), RunLoopSourcePriority::AsyncIONetwork,
d->m_cancellable.get(), nextMultipartResponsePartCallback, handle.get());
return;
}
@@ -1035,7 +1036,7 @@
}
handle->ensureReadBuffer();
- g_input_stream_read_async(d->m_inputStream.get(), const_cast<char*>(d->m_soupBuffer->data), d->m_soupBuffer->length, G_PRIORITY_DEFAULT,
+ g_input_stream_read_async(d->m_inputStream.get(), const_cast<char*>(d->m_soupBuffer->data), d->m_soupBuffer->length, RunLoopSourcePriority::AsyncIONetwork,
d->m_cancellable.get(), readCallback, handle.get());
}
Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp (215454 => 215455)
--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp 2017-04-18 07:57:21 UTC (rev 215455)
@@ -43,6 +43,7 @@
#include <glib.h>
#include <wtf/Vector.h>
#include <wtf/glib/GUniquePtr.h>
+#include <wtf/glib/RunLoopSourcePriority.h>
#include <wtf/text/CString.h>
#define READ_BUFFER_SIZE 1024
@@ -109,7 +110,7 @@
m_readBuffer = std::make_unique<char[]>(READ_BUFFER_SIZE);
RefPtr<SocketStreamHandleImpl> protectedThis(this);
- g_input_stream_read_async(m_inputStream.get(), m_readBuffer.get(), READ_BUFFER_SIZE, G_PRIORITY_DEFAULT, m_cancellable.get(),
+ g_input_stream_read_async(m_inputStream.get(), m_readBuffer.get(), READ_BUFFER_SIZE, RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(readReadyCallback), protectedThis.leakRef());
m_state = Open;
@@ -152,7 +153,7 @@
m_client.didReceiveSocketStreamData(*this, m_readBuffer.get(), static_cast<size_t>(bytesRead));
if (m_inputStream) {
- g_input_stream_read_async(m_inputStream.get(), m_readBuffer.get(), READ_BUFFER_SIZE, G_PRIORITY_DEFAULT, m_cancellable.get(),
+ g_input_stream_read_async(m_inputStream.get(), m_readBuffer.get(), READ_BUFFER_SIZE, RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(readReadyCallback), protectedThis.leakRef());
}
}
Modified: trunk/Source/WebKit2/ChangeLog (215454 => 215455)
--- trunk/Source/WebKit2/ChangeLog 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebKit2/ChangeLog 2017-04-18 07:57:21 UTC (rev 215455)
@@ -1,3 +1,25 @@
+2017-04-18 Carlos Garcia Campos <[email protected]>
+
+ [GLIB] Define priorities also for async network IO tasks
+ https://bugs.webkit.org/show_bug.cgi?id=170905
+
+ Reviewed by Žan Doberšek.
+
+ * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
+ (WebKit::NetworkCache::inputStreamReadReadyCallback):
+ (WebKit::NetworkCache::IOChannel::read):
+ (WebKit::NetworkCache::outputStreamWriteReadyCallback):
+ (WebKit::NetworkCache::IOChannel::write):
+ * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+ (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
+ (WebKit::NetworkDataTaskSoup::read):
+ (WebKit::NetworkDataTaskSoup::requestNextPart):
+ (WebKit::NetworkDataTaskSoup::writeDownload):
+ (WebKit::NetworkDataTaskSoup::didFinishDownload):
+ * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
+ (webkitURISchemeRequestReadCallback):
+ (webkit_uri_scheme_request_finish):
+
2017-04-17 Timothy Horton <[email protected]>
Plumb all four obscured insets to WebCore, instead of just top/left
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp (215454 => 215455)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp 2017-04-18 07:57:21 UTC (rev 215455)
@@ -32,6 +32,7 @@
#include <wtf/MainThread.h>
#include <wtf/RunLoop.h>
#include <wtf/glib/GUniquePtr.h>
+#include <wtf/glib/RunLoopSourcePriority.h>
namespace WebKit {
namespace NetworkCache {
@@ -148,7 +149,7 @@
size_t bytesToRead = std::min(pendingBytesToRead, asyncData->buffer->length);
// Use a local variable for the data buffer to pass it to g_input_stream_read_async(), because ReadAsyncData is released.
auto data = ""
- g_input_stream_read_async(stream, data, bytesToRead, G_PRIORITY_DEFAULT, nullptr,
+ g_input_stream_read_async(stream, data, bytesToRead, RunLoopSourcePriority::DiskCacheRead, nullptr,
reinterpret_cast<GAsyncReadyCallback>(inputStreamReadReadyCallback), asyncData.release());
}
@@ -174,7 +175,7 @@
ReadAsyncData* asyncData = new ReadAsyncData { this, buffer.get(), queue, size, completionHandler, { } };
// FIXME: implement offset.
- g_input_stream_read_async(m_inputStream.get(), const_cast<char*>(buffer->data), bufferSize, G_PRIORITY_DEFAULT, nullptr,
+ g_input_stream_read_async(m_inputStream.get(), const_cast<char*>(buffer->data), bufferSize, RunLoopSourcePriority::DiskCacheRead, nullptr,
reinterpret_cast<GAsyncReadyCallback>(inputStreamReadReadyCallback), asyncData);
}
@@ -251,7 +252,7 @@
asyncData->buffer = adoptGRef(soup_buffer_new_subbuffer(asyncData->buffer.get(), bytesWritten, pendingBytesToWrite));
// Use a local variable for the data buffer to pass it to g_output_stream_write_async(), because WriteAsyncData is released.
auto data = ""
- g_output_stream_write_async(stream, data, pendingBytesToWrite, G_PRIORITY_DEFAULT_IDLE, nullptr,
+ g_output_stream_write_async(stream, data, pendingBytesToWrite, RunLoopSourcePriority::DiskCacheWrite, nullptr,
reinterpret_cast<GAsyncReadyCallback>(outputStreamWriteReadyCallback), asyncData.release());
}
@@ -275,7 +276,7 @@
WriteAsyncData* asyncData = new WriteAsyncData { this, data.soupBuffer(), queue, completionHandler };
// FIXME: implement offset.
- g_output_stream_write_async(stream, asyncData->buffer->data, data.size(), G_PRIORITY_DEFAULT_IDLE, nullptr,
+ g_output_stream_write_async(stream, asyncData->buffer->data, data.size(), RunLoopSourcePriority::DiskCacheWrite, nullptr,
reinterpret_cast<GAsyncReadyCallback>(outputStreamWriteReadyCallback), asyncData);
}
Modified: trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp (215454 => 215455)
--- trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2017-04-18 07:57:21 UTC (rev 215455)
@@ -41,6 +41,7 @@
#include <WebCore/SharedBuffer.h>
#include <WebCore/SoupNetworkSession.h>
#include <wtf/MainThread.h>
+#include <wtf/glib/RunLoopSourcePriority.h>
using namespace WebCore;
@@ -577,7 +578,7 @@
{
ASSERT(m_inputStream);
RefPtr<NetworkDataTaskSoup> protectedThis(this);
- g_input_stream_skip_async(m_inputStream.get(), gDefaultReadBufferSize, G_PRIORITY_DEFAULT, m_cancellable.get(),
+ g_input_stream_skip_async(m_inputStream.get(), gDefaultReadBufferSize, RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(skipInputStreamForRedirectionCallback), protectedThis.leakRef());
}
@@ -732,7 +733,7 @@
RefPtr<NetworkDataTaskSoup> protectedThis(this);
ASSERT(m_inputStream);
m_readBuffer.grow(gDefaultReadBufferSize);
- g_input_stream_read_async(m_inputStream.get(), m_readBuffer.data(), m_readBuffer.size(), G_PRIORITY_DEFAULT, m_cancellable.get(),
+ g_input_stream_read_async(m_inputStream.get(), m_readBuffer.data(), m_readBuffer.size(), RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(readCallback), protectedThis.leakRef());
}
@@ -799,7 +800,7 @@
RefPtr<NetworkDataTaskSoup> protectedThis(this);
ASSERT(m_multipartInputStream);
ASSERT(!m_inputStream);
- soup_multipart_input_stream_next_part_async(m_multipartInputStream.get(), G_PRIORITY_DEFAULT, m_cancellable.get(),
+ soup_multipart_input_stream_next_part_async(m_multipartInputStream.get(), RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(requestNextPartCallback), protectedThis.leakRef());
}
@@ -936,7 +937,7 @@
{
RefPtr<NetworkDataTaskSoup> protectedThis(this);
#if GLIB_CHECK_VERSION(2, 44, 0)
- g_output_stream_write_all_async(m_downloadOutputStream.get(), m_readBuffer.data(), m_readBuffer.size(), G_PRIORITY_DEFAULT, m_cancellable.get(),
+ g_output_stream_write_all_async(m_downloadOutputStream.get(), m_readBuffer.data(), m_readBuffer.size(), RunLoopSourcePriority::AsyncIONetwork, m_cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(writeDownloadCallback), protectedThis.leakRef());
#else
GRefPtr<GTask> writeTask = adoptGRef(g_task_new(m_downloadOutputStream.get(), m_cancellable.get(),
@@ -990,7 +991,7 @@
CString uri = m_response.url().string().utf8();
g_file_info_set_attribute_string(info.get(), "metadata::download-uri", uri.data());
g_file_info_set_attribute_string(info.get(), "xattr::xdg.origin.url", uri.data());
- g_file_set_attributes_async(m_downloadDestinationFile.get(), info.get(), G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, nullptr, nullptr, nullptr);
+ g_file_set_attributes_async(m_downloadDestinationFile.get(), info.get(), G_FILE_QUERY_INFO_NONE, RunLoopSourcePriority::AsyncIONetwork, nullptr, nullptr, nullptr);
clearRequest();
auto* download = NetworkProcess::singleton().downloadManager().download(m_pendingDownloadID);
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp (215454 => 215455)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp 2017-04-18 07:28:38 UTC (rev 215454)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp 2017-04-18 07:57:21 UTC (rev 215455)
@@ -30,6 +30,7 @@
#include <WebCore/ResourceError.h>
#include <libsoup/soup.h>
#include <wtf/glib/GRefPtr.h>
+#include <wtf/glib/RunLoopSourcePriority.h>
#include <wtf/text/CString.h>
using namespace WebKit;
@@ -207,7 +208,7 @@
}
priv->bytesRead += bytesRead;
- g_input_stream_read_async(inputStream, priv->readBuffer, gReadBufferSize, G_PRIORITY_DEFAULT, priv->cancellable.get(),
+ g_input_stream_read_async(inputStream, priv->readBuffer, gReadBufferSize, RunLoopSourcePriority::AsyncIONetwork, priv->cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request.get()));
}
@@ -232,7 +233,7 @@
request->priv->cancellable = adoptGRef(g_cancellable_new());
request->priv->bytesRead = 0;
request->priv->mimeType = mimeType;
- g_input_stream_read_async(inputStream, request->priv->readBuffer, gReadBufferSize, G_PRIORITY_DEFAULT, request->priv->cancellable.get(),
+ g_input_stream_read_async(inputStream, request->priv->readBuffer, gReadBufferSize, RunLoopSourcePriority::AsyncIONetwork, request->priv->cancellable.get(),
reinterpret_cast<GAsyncReadyCallback>(webkitURISchemeRequestReadCallback), g_object_ref(request));
}