Diff
Modified: trunk/Source/WebKit2/ChangeLog (204995 => 204996)
--- trunk/Source/WebKit2/ChangeLog 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/ChangeLog 2016-08-25 23:09:28 UTC (rev 204996)
@@ -1,5 +1,94 @@
2016-08-25 Anders Carlsson <[email protected]>
+ Replace all IPC message send flags with OptionSet
+ https://bugs.webkit.org/show_bug.cgi?id=161211
+
+ Reviewed by Tim Horton.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::didFailLoading):
+ (WebKit::NetworkResourceLoader::sendAbortingOnFailure):
+ * NetworkProcess/NetworkResourceLoader.h:
+ * Platform/IPC/Connection.cpp:
+ (IPC::WaitForMessageState::WaitForMessageState):
+ (IPC::Connection::sendMessage):
+ (IPC::Connection::sendSyncReply):
+ (IPC::Connection::waitForMessage):
+ (IPC::Connection::sendSyncMessage):
+ (IPC::Connection::sendSyncMessageFromSecondaryThread):
+ (IPC::Connection::waitForSyncReply):
+ (IPC::Connection::processIncomingMessage):
+ * Platform/IPC/Connection.h:
+ (IPC::Connection::send):
+ (IPC::Connection::sendSync):
+ (IPC::Connection::waitForAndDispatchImmediately):
+ * Platform/IPC/MessageSender.cpp:
+ (IPC::MessageSender::sendMessage):
+ * Platform/IPC/MessageSender.h:
+ (IPC::MessageSender::send):
+ (IPC::MessageSender::sendSync):
+ * Platform/IPC/mac/ConnectionMac.mm:
+ (IPC::Connection::open):
+ (IPC::Connection::willSendSyncMessage):
+ (IPC::Connection::didReceiveSyncReply):
+ * PluginProcess/mac/PluginControllerProxyMac.mm:
+ (WebKit::PluginControllerProxy::setComplexTextInputState):
+ * UIProcess/ChildProcessProxy.cpp:
+ (WebKit::ChildProcessProxy::sendMessage):
+ (WebKit::ChildProcessProxy::didFinishLaunching):
+ * UIProcess/ChildProcessProxy.h:
+ (WebKit::ChildProcessProxy::send):
+ (WebKit::ChildProcessProxy::sendSync):
+ * UIProcess/Databases/DatabaseProcessProxy.cpp:
+ (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
+ * UIProcess/Plugins/PluginProcessProxy.cpp:
+ (WebKit::PluginProcessProxy::getPluginProcessConnection):
+ * UIProcess/WebEditCommandProxy.cpp:
+ (WebKit::WebEditCommandProxy::unapply):
+ (WebKit::WebEditCommandProxy::reapply):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::printingSendOptions):
+ (WebKit::WebPageProxy::preferencesDidChange):
+ (WebKit::WebPageProxy::sendMessage):
+ (WebKit::WebPageProxy::beginPrinting):
+ (WebKit::WebPageProxy::endPrinting):
+ (WebKit::WebPageProxy::computePagesForPrinting):
+ (WebKit::WebPageProxy::drawRectToImage):
+ (WebKit::WebPageProxy::drawPagesToPDF):
+ (WebKit::WebPageProxy::drawPagesForPrinting):
+ (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
+ (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight): Deleted.
+ (WebKit::WebPageProxy::handleAlternativeTextUIResult): Deleted.
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+ (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
+ * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+ (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState):
+ * WebProcess/Plugins/PluginProxy.cpp:
+ (WebKit::PluginProxy::geometryDidChange):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
+ (WebKit::WebChromeClient::runJavaScriptAlert):
+ (WebKit::WebChromeClient::runJavaScriptConfirm):
+ (WebKit::WebChromeClient::runJavaScriptPrompt):
+ (WebKit::WebChromeClient::print):
+ (WebKit::WebChromeClient::exceededDatabaseQuota):
+ (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::createWithCoreMainFrame):
+ (WebKit::WebFrame::createSubframe):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded):
+ (WebKit::WebPage::postSynchronousMessageForTesting):
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
+
+2016-08-25 Anders Carlsson <[email protected]>
+
Remove some more MessageRecorder gunk
https://bugs.webkit.org/show_bug.cgi?id=161209
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (204995 => 204996)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -419,7 +419,7 @@
m_synchronousLoadData->error = error;
sendReplyToSynchronousRequest(*m_synchronousLoadData, nullptr);
} else if (auto* connection = messageSenderConnection())
- connection->send(Messages::WebResourceLoader::DidFailResourceLoad(error), messageSenderDestinationID(), 0);
+ connection->send(Messages::WebResourceLoader::DidFailResourceLoad(error), messageSenderDestinationID());
cleanup();
}
@@ -635,9 +635,9 @@
}
template<typename T>
-bool NetworkResourceLoader::sendAbortingOnFailure(T&& message, unsigned messageSendFlags)
+bool NetworkResourceLoader::sendAbortingOnFailure(T&& message, OptionSet<IPC::SendOption> sendOption)
{
- bool result = messageSenderConnection()->send(std::forward<T>(message), messageSenderDestinationID(), messageSendFlags);
+ bool result = messageSenderConnection()->send(std::forward<T>(message), messageSenderDestinationID(), sendOption);
if (!result)
abort();
return result;
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (204995 => 204996)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h 2016-08-25 23:09:28 UTC (rev 204996)
@@ -134,7 +134,7 @@
void consumeSandboxExtensions();
void invalidateSandboxExtensions();
- template<typename T> bool sendAbortingOnFailure(T&& message, unsigned messageSendFlags = 0);
+ template<typename T> bool sendAbortingOnFailure(T&& message, OptionSet<IPC::SendOption> sendOption = { });
const NetworkResourceLoadParameters m_parameters;
Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (204995 => 204996)
--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -37,11 +37,11 @@
namespace IPC {
struct WaitForMessageState {
- WaitForMessageState(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, unsigned waitForMessageFlags)
+ WaitForMessageState(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, OptionSet<WaitForOption> waitForOptions)
: messageReceiverName(messageReceiverName)
, messageName(messageName)
, destinationID(destinationID)
- , waitForMessageFlags(waitForMessageFlags)
+ , waitForOptions(waitForOptions)
{
}
@@ -49,7 +49,7 @@
StringReference messageName;
uint64_t destinationID;
- unsigned waitForMessageFlags;
+ OptionSet<WaitForOption> waitForOptions;
bool messageWaitingInterrupted = false;
std::unique_ptr<Decoder> decoder;
@@ -336,7 +336,7 @@
return encoder;
}
-bool Connection::sendMessage(std::unique_ptr<Encoder> encoder, unsigned messageSendFlags)
+bool Connection::sendMessage(std::unique_ptr<Encoder> encoder, OptionSet<SendOption> sendOptions)
{
if (!isValid())
return false;
@@ -346,10 +346,10 @@
auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID);
wrappedMessage->setFullySynchronousModeForTesting();
wrappedMessage->wrapForTesting(WTFMove(encoder));
- return static_cast<bool>(sendSyncMessage(syncRequestID, WTFMove(wrappedMessage), std::chrono::milliseconds::max()));
+ return static_cast<bool>(sendSyncMessage(syncRequestID, WTFMove(wrappedMessage), std::chrono::milliseconds::max(), { }));
}
- if (messageSendFlags & DispatchMessageEvenWhenWaitingForSyncReply
+ if (sendOptions.contains(SendOption::DispatchMessageEvenWhenWaitingForSyncReply)
&& (!m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage
|| m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount))
encoder->setShouldDispatchMessageWhenWaitingForSyncReply(true);
@@ -368,7 +368,7 @@
bool Connection::sendSyncReply(std::unique_ptr<Encoder> encoder)
{
- return sendMessage(WTFMove(encoder));
+ return sendMessage(WTFMove(encoder), { });
}
std::chrono::milliseconds Connection::timeoutRespectingIgnoreTimeoutsForTesting(std::chrono::milliseconds timeout) const
@@ -376,7 +376,7 @@
return m_ignoreTimeoutsForTesting ? std::chrono::milliseconds::max() : timeout;
}
-std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags)
+std::unique_ptr<Decoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<WaitForOption> waitForOptions)
{
ASSERT(RunLoop::isMain());
@@ -404,12 +404,12 @@
}
// Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue.
- if (hasIncomingSynchronousMessage && waitForMessageFlags & InterruptWaitingIfSyncMessageArrives) {
+ if (hasIncomingSynchronousMessage && waitForOptions.contains(WaitForOption::InterruptWaitingIfSyncMessageArrives)) {
m_waitingForMessage = nullptr;
return nullptr;
}
- WaitForMessageState waitingForMessage(messageReceiverName, messageName, destinationID, waitForMessageFlags);
+ WaitForMessageState waitingForMessage(messageReceiverName, messageName, destinationID, waitForOptions);
{
std::lock_guard<Lock> lock(m_waitForMessageMutex);
@@ -447,11 +447,12 @@
return nullptr;
}
-std::unique_ptr<Decoder> Connection::sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder> encoder, std::chrono::milliseconds timeout, unsigned syncSendFlags)
+std::unique_ptr<Decoder> Connection::sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder> encoder, std::chrono::milliseconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
{
if (!RunLoop::isMain()) {
// No flags are supported for synchronous messages sent from secondary threads.
- ASSERT(!syncSendFlags);
+ ASSERT(sendSyncOptions.isEmpty());
+
return sendSyncMessageFromSecondaryThread(syncRequestID, WTFMove(encoder), timeout);
}
@@ -474,12 +475,12 @@
++m_inSendSyncCount;
// First send the message.
- sendMessage(WTFMove(encoder), DispatchMessageEvenWhenWaitingForSyncReply);
+ sendMessage(WTFMove(encoder), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
// Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so
// keep an extra reference to the connection here in case it's invalidated.
Ref<Connection> protect(*this);
- std::unique_ptr<Decoder> reply = waitForSyncReply(syncRequestID, timeout, syncSendFlags);
+ std::unique_ptr<Decoder> reply = waitForSyncReply(syncRequestID, timeout, sendSyncOptions);
--m_inSendSyncCount;
@@ -515,7 +516,7 @@
m_secondaryThreadPendingSyncReplyMap.add(syncRequestID, &pendingReply);
}
- sendMessage(WTFMove(encoder), 0);
+ sendMessage(WTFMove(encoder), { });
timeout = timeoutRespectingIgnoreTimeoutsForTesting(timeout);
pendingReply.semaphore.wait(currentTime() + (timeout.count() / 1000.0));
@@ -530,12 +531,12 @@
return WTFMove(pendingReply.replyDecoder);
}
-std::unique_ptr<Decoder> Connection::waitForSyncReply(uint64_t syncRequestID, std::chrono::milliseconds timeout, unsigned syncSendFlags)
+std::unique_ptr<Decoder> Connection::waitForSyncReply(uint64_t syncRequestID, std::chrono::milliseconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
{
timeout = timeoutRespectingIgnoreTimeoutsForTesting(timeout);
double absoluteTime = currentTime() + (timeout.count() / 1000.0);
- willSendSyncMessage(syncSendFlags);
+ willSendSyncMessage(sendSyncOptions);
bool timedOut = false;
while (!timedOut) {
@@ -553,7 +554,7 @@
// We found the sync reply, or the connection was closed.
if (pendingSyncReply.didReceiveReply || !m_shouldWaitForSyncReplies) {
- didReceiveSyncReply(syncSendFlags);
+ didReceiveSyncReply(sendSyncOptions);
return WTFMove(pendingSyncReply.replyDecoder);
}
}
@@ -564,7 +565,7 @@
// any more incoming messages.
if (!isValid()) {
RELEASE_LOG_ERROR("Connection::waitForSyncReply: Connection no longer valid, id = %" PRIu64, syncRequestID);
- didReceiveSyncReply(syncSendFlags);
+ didReceiveSyncReply(sendSyncOptions);
return nullptr;
}
@@ -575,7 +576,7 @@
}
RELEASE_LOG_ERROR("Connection::waitForSyncReply: Timed-out while waiting for reply, id = %" PRIu64, syncRequestID);
- didReceiveSyncReply(syncSendFlags);
+ didReceiveSyncReply(sendSyncOptions);
return nullptr;
}
@@ -682,7 +683,7 @@
return;
}
- if ((m_waitingForMessage->waitForMessageFlags & InterruptWaitingIfSyncMessageArrives) && message->isSyncMessage()) {
+ if (m_waitingForMessage->waitForOptions.contains(WaitForOption::InterruptWaitingIfSyncMessageArrives) && message->isSyncMessage()) {
m_waitingForMessage->messageWaitingInterrupted = true;
m_waitForMessageCondition.notifyOne();
}
Modified: trunk/Source/WebKit2/Platform/IPC/Connection.h (204995 => 204996)
--- trunk/Source/WebKit2/Platform/IPC/Connection.h 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.h 2016-08-25 23:09:28 UTC (rev 204996)
@@ -36,6 +36,7 @@
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Lock.h>
+#include <wtf/OptionSet.h>
#include <wtf/WorkQueue.h>
#include <wtf/text/CString.h>
@@ -53,19 +54,19 @@
struct WaitForMessageState;
-enum MessageSendFlags {
+enum class SendOption {
// Whether this message should be dispatched when waiting for a sync reply.
// This is the default for synchronous messages.
DispatchMessageEvenWhenWaitingForSyncReply = 1 << 0,
};
-enum SyncMessageSendFlags {
+enum class SendSyncOption {
// Use this to inform that this sync call will suspend this process until the user responds with input.
InformPlatformProcessWillSuspend = 1 << 0,
UseFullySynchronousModeForTesting = 1 << 1,
};
-enum WaitForMessageFlags {
+enum class WaitForOption {
// Use this to make waitForMessage be interrupted immediately by any incoming sync messages.
InterruptWaitingIfSyncMessageArrives = 1 << 0,
};
@@ -164,13 +165,13 @@
void postConnectionDidCloseOnConnectionWorkQueue();
- template<typename T> bool send(T&& message, uint64_t destinationID, unsigned messageSendFlags = 0);
- template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), unsigned syncSendFlags = 0);
- template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags = 0);
+ template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { });
+ template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), OptionSet<SendSyncOption> sendSyncOptions = { });
+ template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<WaitForOption> waitForOptions = { });
std::unique_ptr<Encoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID);
- bool sendMessage(std::unique_ptr<Encoder>, unsigned messageSendFlags = 0);
- std::unique_ptr<Decoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder>, std::chrono::milliseconds timeout, unsigned syncSendFlags = 0);
+ bool sendMessage(std::unique_ptr<Encoder>, OptionSet<SendOption> sendOptions);
+ std::unique_ptr<Decoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<Encoder>, std::chrono::milliseconds timeout, OptionSet<SendSyncOption> sendSyncOptions);
std::unique_ptr<Decoder> sendSyncMessageFromSecondaryThread(uint64_t syncRequestID, std::unique_ptr<Encoder>, std::chrono::milliseconds timeout);
bool sendSyncReply(std::unique_ptr<Encoder>);
@@ -207,9 +208,9 @@
void platformInitialize(Identifier);
void platformInvalidate();
- std::unique_ptr<Decoder> waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags);
+ std::unique_ptr<Decoder> waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<WaitForOption>);
- std::unique_ptr<Decoder> waitForSyncReply(uint64_t syncRequestID, std::chrono::milliseconds timeout, unsigned syncSendFlags);
+ std::unique_ptr<Decoder> waitForSyncReply(uint64_t syncRequestID, std::chrono::milliseconds timeout, OptionSet<SendSyncOption>);
// Called on the connection work queue.
void processIncomingMessage(std::unique_ptr<Decoder>);
@@ -234,8 +235,8 @@
// Can be called on any thread.
void enqueueIncomingMessage(std::unique_ptr<Decoder>);
- void willSendSyncMessage(unsigned syncSendFlags);
- void didReceiveSyncReply(unsigned syncSendFlags);
+ void willSendSyncMessage(OptionSet<SendSyncOption>);
+ void didReceiveSyncReply(OptionSet<SendSyncOption>);
std::chrono::milliseconds timeoutRespectingIgnoreTimeoutsForTesting(std::chrono::milliseconds) const;
@@ -354,7 +355,7 @@
#endif
};
-template<typename T> bool Connection::send(T&& message, uint64_t destinationID, unsigned messageSendFlags)
+template<typename T> bool Connection::send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions)
{
COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
@@ -361,10 +362,10 @@
auto encoder = std::make_unique<Encoder>(T::receiverName(), T::name(), destinationID);
encoder->encode(message.arguments());
- return sendMessage(WTFMove(encoder), messageSendFlags);
+ return sendMessage(WTFMove(encoder), sendOptions);
}
-template<typename T> bool Connection::sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout, unsigned syncSendFlags)
+template<typename T> bool Connection::sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<SendSyncOption> sendSyncOptions)
{
COMPILE_ASSERT(T::isSync, SyncMessageExpected);
@@ -371,7 +372,7 @@
uint64_t syncRequestID = 0;
std::unique_ptr<Encoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, syncRequestID);
- if (syncSendFlags & SyncMessageSendFlags::UseFullySynchronousModeForTesting) {
+ if (sendSyncOptions.contains(SendSyncOption::UseFullySynchronousModeForTesting)) {
encoder->setFullySynchronousModeForTesting();
m_fullySynchronousModeIsAllowedForTesting = true;
}
@@ -380,7 +381,7 @@
encoder->encode(message.arguments());
// Now send the message and wait for a reply.
- std::unique_ptr<Decoder> replyDecoder = sendSyncMessage(syncRequestID, WTFMove(encoder), timeout, syncSendFlags);
+ std::unique_ptr<Decoder> replyDecoder = sendSyncMessage(syncRequestID, WTFMove(encoder), timeout, sendSyncOptions);
if (!replyDecoder)
return false;
@@ -388,9 +389,9 @@
return replyDecoder->decode(reply);
}
-template<typename T> bool Connection::waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags)
+template<typename T> bool Connection::waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<WaitForOption> waitForOptions)
{
- std::unique_ptr<Decoder> decoder = waitForMessage(T::receiverName(), T::name(), destinationID, timeout, waitForMessageFlags);
+ std::unique_ptr<Decoder> decoder = waitForMessage(T::receiverName(), T::name(), destinationID, timeout, waitForOptions);
if (!decoder)
return false;
Modified: trunk/Source/WebKit2/Platform/IPC/MessageSender.cpp (204995 => 204996)
--- trunk/Source/WebKit2/Platform/IPC/MessageSender.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/Platform/IPC/MessageSender.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -32,11 +32,11 @@
{
}
-bool MessageSender::sendMessage(std::unique_ptr<Encoder> encoder, unsigned messageSendFlags)
+bool MessageSender::sendMessage(std::unique_ptr<Encoder> encoder, OptionSet<SendOption> sendOptions)
{
ASSERT(messageSenderConnection());
- return messageSenderConnection()->sendMessage(WTFMove(encoder), messageSendFlags);
+ return messageSenderConnection()->sendMessage(WTFMove(encoder), sendOptions);
}
} // namespace IPC
Modified: trunk/Source/WebKit2/Platform/IPC/MessageSender.h (204995 => 204996)
--- trunk/Source/WebKit2/Platform/IPC/MessageSender.h 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/Platform/IPC/MessageSender.h 2016-08-25 23:09:28 UTC (rev 204996)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MessageSender_h
-#define MessageSender_h
+#pragma once
#include <wtf/Assertions.h>
#include "Connection.h"
@@ -37,10 +36,10 @@
template<typename U> bool send(const U& message)
{
- return send(message, messageSenderDestinationID(), 0);
+ return send(message, messageSenderDestinationID(), { });
}
- template<typename U> bool send(const U& message, uint64_t destinationID, unsigned messageSendFlags = 0)
+ template<typename U> bool send(const U& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { })
{
static_assert(!U::isSync, "Message is sync!");
@@ -47,26 +46,26 @@
auto encoder = std::make_unique<Encoder>(U::receiverName(), U::name(), destinationID);
encoder->encode(message.arguments());
- return sendMessage(WTFMove(encoder), messageSendFlags);
+ return sendMessage(WTFMove(encoder), sendOptions);
}
template<typename T>
- bool sendSync(T&& message, typename T::Reply&& reply, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), unsigned syncSendFlags = 0)
+ bool sendSync(T&& message, typename T::Reply&& reply, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), OptionSet<SendSyncOption> sendSyncOptions = { })
{
static_assert(T::isSync, "Message is not sync!");
- return sendSync(std::forward<T>(message), WTFMove(reply), messageSenderDestinationID(), timeout, syncSendFlags);
+ return sendSync(std::forward<T>(message), WTFMove(reply), messageSenderDestinationID(), timeout, sendSyncOptions);
}
template<typename T>
- bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), unsigned syncSendFlags = 0)
+ bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::milliseconds::max(), OptionSet<SendSyncOption> sendSyncOptions = { })
{
ASSERT(messageSenderConnection());
- return messageSenderConnection()->sendSync(WTFMove(message), WTFMove(reply), destinationID, timeout, syncSendFlags);
+ return messageSenderConnection()->sendSync(WTFMove(message), WTFMove(reply), destinationID, timeout, sendSyncOptions);
}
- virtual bool sendMessage(std::unique_ptr<Encoder>, unsigned messageSendFlags);
+ virtual bool sendMessage(std::unique_ptr<Encoder>, OptionSet<SendOption>);
private:
virtual Connection* messageSenderConnection() = 0;
@@ -74,5 +73,3 @@
};
} // namespace IPC
-
-#endif // MessageSender_h
Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (204995 => 204996)
--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm 2016-08-25 23:09:28 UTC (rev 204996)
@@ -214,7 +214,7 @@
auto encoder = std::make_unique<Encoder>("IPC", "InitializeConnection", 0);
encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
- sendMessage(WTFMove(encoder));
+ sendMessage(WTFMove(encoder), { });
initializeDeadNameSource();
}
@@ -237,7 +237,7 @@
auto encoder = std::make_unique<Encoder>("IPC", "SetExceptionPort", 0);
encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
- sendMessage(WTFMove(encoder));
+ sendMessage(WTFMove(encoder), { });
}
#endif
@@ -649,15 +649,15 @@
#endif
}
-void Connection::willSendSyncMessage(unsigned flags)
+void Connection::willSendSyncMessage(OptionSet<SendSyncOption> sendSyncOptions)
{
- if ((flags & InformPlatformProcessWillSuspend) && WebCore::AXObjectCache::accessibilityEnabled())
+ if (sendSyncOptions.contains(IPC::SendSyncOption::InformPlatformProcessWillSuspend) && WebCore::AXObjectCache::accessibilityEnabled())
AccessibilityProcessSuspendedNotification(true);
}
-void Connection::didReceiveSyncReply(unsigned flags)
+void Connection::didReceiveSyncReply(OptionSet<SendSyncOption> sendSyncOptions)
{
- if ((flags & InformPlatformProcessWillSuspend) && WebCore::AXObjectCache::accessibilityEnabled())
+ if (sendSyncOptions.contains(IPC::SendSyncOption::InformPlatformProcessWillSuspend) && WebCore::AXObjectCache::accessibilityEnabled())
AccessibilityProcessSuspendedNotification(false);
}
Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm (204995 => 204996)
--- trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2016-08-25 23:09:28 UTC (rev 204996)
@@ -48,7 +48,7 @@
void PluginControllerProxy::setComplexTextInputState(PluginComplexTextInputState pluginComplexTextInputState)
{
- m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputState(pluginComplexTextInputState), m_pluginInstanceID, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputState(pluginComplexTextInputState), m_pluginInstanceID, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
}
const MachSendRight& PluginControllerProxy::compositingRenderServerPort()
Modified: trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -119,16 +119,16 @@
return ChildProcessProxy::State::Running;
}
-bool ChildProcessProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, unsigned messageSendFlags)
+bool ChildProcessProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, OptionSet<IPC::SendOption> sendOptions)
{
switch (state()) {
case State::Launching:
// If we're waiting for the child process to launch, we need to stash away the messages so we can send them once we have a connection.
- m_pendingMessages.append(std::make_pair(WTFMove(encoder), messageSendFlags));
+ m_pendingMessages.append(std::make_pair(WTFMove(encoder), sendOptions));
return true;
case State::Running:
- return connection()->sendMessage(WTFMove(encoder), messageSendFlags);
+ return connection()->sendMessage(WTFMove(encoder), sendOptions);
case State::Terminated:
return false;
@@ -184,8 +184,8 @@
for (size_t i = 0; i < m_pendingMessages.size(); ++i) {
std::unique_ptr<IPC::Encoder> message = WTFMove(m_pendingMessages[i].first);
- unsigned messageSendFlags = m_pendingMessages[i].second;
- m_connection->sendMessage(WTFMove(message), messageSendFlags);
+ OptionSet<IPC::SendOption> sendOptions = m_pendingMessages[i].second;
+ m_connection->sendMessage(WTFMove(message), sendOptions);
}
m_pendingMessages.clear();
Modified: trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/ChildProcessProxy.h 2016-08-25 23:09:28 UTC (rev 204996)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ChildProcessProxy_h
-#define ChildProcessProxy_h
+#pragma once
#include "Connection.h"
#include "MessageReceiverMap.h"
@@ -47,9 +46,9 @@
void connect();
void terminate();
- template<typename T> bool send(T&& message, uint64_t destinationID, unsigned messageSendFlags = 0);
- template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::seconds(1), unsigned sendSyncFlags = 0);
-
+ template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { });
+ template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, std::chrono::milliseconds timeout = std::chrono::seconds(1), OptionSet<IPC::SendSyncOption> sendSyncOptions = { });
+
IPC::Connection* connection() const
{
ASSERT(m_connection);
@@ -71,7 +70,7 @@
pid_t processIdentifier() const { return m_processLauncher->processIdentifier(); }
bool canSendMessage() const { return state() != State::Terminated;}
- bool sendMessage(std::unique_ptr<IPC::Encoder>, unsigned messageSendFlags);
+ bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>);
void shutDownProcess();
@@ -88,7 +87,7 @@
virtual void connectionWillOpen(IPC::Connection&);
virtual void processWillShutDown(IPC::Connection&) = 0;
- Vector<std::pair<std::unique_ptr<IPC::Encoder>, unsigned>> m_pendingMessages;
+ Vector<std::pair<std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>>> m_pendingMessages;
RefPtr<ProcessLauncher> m_processLauncher;
RefPtr<IPC::Connection> m_connection;
IPC::MessageReceiverMap m_messageReceiverMap;
@@ -95,7 +94,7 @@
};
template<typename T>
-bool ChildProcessProxy::send(T&& message, uint64_t destinationID, unsigned messageSendFlags)
+bool ChildProcessProxy::send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions)
{
COMPILE_ASSERT(!T::isSync, AsyncMessageExpected);
@@ -102,11 +101,11 @@
auto encoder = std::make_unique<IPC::Encoder>(T::receiverName(), T::name(), destinationID);
encoder->encode(message.arguments());
- return sendMessage(WTFMove(encoder), messageSendFlags);
+ return sendMessage(WTFMove(encoder), sendOptions);
}
template<typename U>
-bool ChildProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout, unsigned sendSyncFlags)
+bool ChildProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uint64_t destinationID, std::chrono::milliseconds timeout, OptionSet<IPC::SendSyncOption> sendSyncOptions)
{
COMPILE_ASSERT(U::isSync, SyncMessageExpected);
@@ -113,9 +112,7 @@
if (!m_connection)
return false;
- return connection()->sendSync(std::forward<U>(message), WTFMove(reply), destinationID, timeout, sendSyncFlags);
+ return connection()->sendSync(std::forward<U>(message), WTFMove(reply), destinationID, timeout, sendSyncOptions);
}
} // namespace WebKit
-
-#endif // ChildProcessProxy_h
Modified: trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -125,7 +125,7 @@
return;
}
- connection()->send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ connection()->send(Messages::DatabaseProcess::CreateDatabaseToWebProcessConnection(), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
}
void DatabaseProcessProxy::didClose(IPC::Connection&)
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -108,7 +108,7 @@
return;
}
- connection()->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(), 0, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ connection()->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
}
DownloadProxy* NetworkProcessProxy::createDownloadProxy(const ResourceRequest& resourceRequest)
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -110,7 +110,7 @@
// Ask the plug-in process to create a connection. Since the plug-in can be waiting for a synchronous reply
// we need to make sure that this message is always processed, even when the plug-in is waiting for a synchronus reply.
- m_connection->send(Messages::PluginProcess::CreateWebProcessConnection(), 0, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ m_connection->send(Messages::PluginProcess::CreateWebProcessConnection(), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
}
void PluginProcessProxy::fetchWebsiteData(std::function<void (Vector<String>)> completionHandler)
Modified: trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -55,7 +55,7 @@
if (!m_page || !m_page->isValid())
return;
- m_page->process().send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ m_page->process().send(Messages::WebPage::UnapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
m_page->registerEditCommand(this, WebPageProxy::Redo);
}
@@ -64,7 +64,7 @@
if (!m_page || !m_page->isValid())
return;
- m_page->process().send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ m_page->process().send(Messages::WebPage::ReapplyEditCommand(m_commandID), m_page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
m_page->registerEditCommand(this, WebPageProxy::Undo);
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -2987,6 +2987,14 @@
m_process->send(Messages::WebPage::ForceRepaint(callbackID), m_pageID);
}
+static OptionSet<IPC::SendOption> printingSendOptions(bool isPerformingDOMPrintOperation)
+{
+ if (isPerformingDOMPrintOperation)
+ return IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply;
+
+ return { };
+}
+
void WebPageProxy::preferencesDidChange()
{
if (!isValid())
@@ -3007,7 +3015,7 @@
// even if nothing changed in UI process, so that overrides get removed.
// Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
- m_process->send(Messages::WebPage::PreferencesDidChange(preferencesStore()), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::PreferencesDidChange(preferencesStore()), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
void WebPageProxy::didCreateMainFrame(uint64_t frameID)
@@ -4389,9 +4397,9 @@
m_findClient->didFailToFindString(this, string);
}
-bool WebPageProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, unsigned messageSendFlags)
+bool WebPageProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, OptionSet<IPC::SendOption> sendOptions)
{
- return m_process->sendMessage(WTFMove(encoder), messageSendFlags);
+ return m_process->sendMessage(WTFMove(encoder), sendOptions);
}
IPC::Connection* WebPageProxy::messageSenderConnection()
@@ -5788,7 +5796,7 @@
return;
m_isInPrintingMode = true;
- m_process->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::BeginPrinting(frame->frameID(), printInfo), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
void WebPageProxy::endPrinting()
@@ -5797,7 +5805,7 @@
return;
m_isInPrintingMode = false;
- m_process->send(Messages::WebPage::EndPrinting(), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::EndPrinting(), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
void WebPageProxy::computePagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<ComputedPagesCallback> prpCallback)
@@ -5811,7 +5819,7 @@
uint64_t callbackID = callback->callbackID();
m_callbacks.put(callback);
m_isInPrintingMode = true;
- m_process->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::ComputePagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
#if PLATFORM(COCOA)
@@ -5825,7 +5833,7 @@
uint64_t callbackID = callback->callbackID();
m_callbacks.put(callback);
- m_process->send(Messages::WebPage::DrawRectToImage(frame->frameID(), printInfo, rect, imageSize, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawRectToImage(frame->frameID(), printInfo, rect, imageSize, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
void WebPageProxy::drawPagesToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, uint32_t first, uint32_t count, PassRefPtr<DataCallback> prpCallback)
@@ -5838,7 +5846,7 @@
uint64_t callbackID = callback->callbackID();
m_callbacks.put(callback);
- m_process->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawPagesToPDF(frame->frameID(), printInfo, first, count, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation));
}
#elif PLATFORM(GTK)
void WebPageProxy::drawPagesForPrinting(WebFrameProxy* frame, const PrintInfo& printInfo, PassRefPtr<PrintFinishedCallback> didPrintCallback)
@@ -5852,7 +5860,7 @@
uint64_t callbackID = callback->callbackID();
m_callbacks.put(callback);
m_isInPrintingMode = true;
- m_process->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::DrawPagesForPrinting(frame->frameID(), printInfo, callbackID), m_pageID, printingSendOptions(m_isPerformingDOMPrintOperation)));
}
#endif
@@ -5894,7 +5902,7 @@
if (!isValid())
return;
- m_process->send(Messages::WebPage::SetMinimumLayoutSize(minimumLayoutSize), m_pageID, 0);
+ m_process->send(Messages::WebPage::SetMinimumLayoutSize(minimumLayoutSize), m_pageID);
m_drawingArea->minimumLayoutSizeDidChange();
#if USE(APPKIT)
@@ -5913,7 +5921,7 @@
if (!isValid())
return;
- m_process->send(Messages::WebPage::SetAutoSizingShouldExpandToViewHeight(shouldExpand), m_pageID, 0);
+ m_process->send(Messages::WebPage::SetAutoSizingShouldExpandToViewHeight(shouldExpand), m_pageID);
}
#if PLATFORM(MAC)
@@ -5946,7 +5954,7 @@
void WebPageProxy::handleAlternativeTextUIResult(const String& result)
{
if (!isClosed())
- m_process->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID, 0);
+ m_process->send(Messages::WebPage::HandleAlternativeTextUIResult(result), m_pageID);
}
#if USE(DICTATION_ALTERNATIVES)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-08-25 23:09:28 UTC (rev 204996)
@@ -1147,8 +1147,9 @@
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
+
// IPC::MessageSender
- bool sendMessage(std::unique_ptr<IPC::Encoder>, unsigned messageSendFlags) override;
+ bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>) override;
IPC::Connection* messageSenderConnection() override;
uint64_t messageSenderDestinationID() override;
Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm 2016-08-25 23:09:28 UTC (rev 204996)
@@ -438,7 +438,7 @@
return std::chrono::milliseconds(250);
#endif
}();
- m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_webPageProxy.pageID(), viewStateUpdateTimeout, InterruptWaitingIfSyncMessageArrives);
+ m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_webPageProxy.pageID(), viewStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
}
void RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)> callbackFunction)
Modified: trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (204995 => 204996)
--- trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2016-08-25 23:09:28 UTC (rev 204996)
@@ -79,7 +79,7 @@
if (m_webPageProxy.process().state() != WebProcessProxy::State::Running)
return;
- m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout, InterruptWaitingIfSyncMessageArrives);
+ m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
#endif
}
@@ -134,7 +134,7 @@
void TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState()
{
auto viewStateUpdateTimeout = std::chrono::milliseconds(250);
- m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DidUpdateViewState>(m_webPageProxy.pageID(), viewStateUpdateTimeout, InterruptWaitingIfSyncMessageArrives);
+ m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DidUpdateViewState>(m_webPageProxy.pageID(), viewStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
}
void TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange(const IntSize& newIntrinsicContentSize)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -283,7 +283,7 @@
m_pluginBackingStoreContainsValidData = false;
}
- m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(m_pluginSize, m_clipRect, m_pluginToRootViewTransform, contentsScaleFactor(), pluginBackingStoreHandle), m_pluginInstanceID, IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ m_connection->connection()->send(Messages::PluginControllerProxy::GeometryDidChange(m_pluginSize, m_clipRect, m_pluginToRootViewTransform, contentsScaleFactor(), pluginBackingStoreHandle), m_pluginInstanceID, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
}
void PluginProxy::geometryDidChange(const IntSize& pluginSize, const IntRect& clipRect, const AffineTransform& pluginToRootViewTransform)
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -354,7 +354,7 @@
HangDetectionDisabler hangDetectionDisabler;
- if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
+ if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunBeforeUnloadConfirmPanel(message, webFrame->frameID()), Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::Reply(shouldClose), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
return false;
return shouldClose;
@@ -389,7 +389,7 @@
HangDetectionDisabler hangDetectionDisabler;
- WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
+ WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptAlert(webFrame->frameID(), SecurityOriginData::fromFrame(frame), alertText), Messages::WebPageProxy::RunJavaScriptAlert::Reply(), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
}
bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
@@ -403,7 +403,7 @@
HangDetectionDisabler hangDetectionDisabler;
bool result = false;
- if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
+ if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptConfirm(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message), Messages::WebPageProxy::RunJavaScriptConfirm::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
return false;
return result;
@@ -419,7 +419,7 @@
HangDetectionDisabler hangDetectionDisabler;
- if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend))
+ if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPageProxy::RunJavaScriptPrompt(webFrame->frameID(), SecurityOriginData::fromFrame(frame), message, defaultValue), Messages::WebPageProxy::RunJavaScriptPrompt::Reply(result), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend))
return false;
return !result.isNull();
@@ -638,7 +638,7 @@
}
#endif
- m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
+ m_page->sendSync(Messages::WebPageProxy::PrintFrame(webFrame->frameID()), Messages::WebPageProxy::PrintFrame::Reply(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
}
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
@@ -658,7 +658,7 @@
if (!newQuota) {
WebProcess::singleton().parentProcessConnection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
- Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
+ Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
}
dbManager.setQuota(origin, newQuota);
@@ -683,7 +683,7 @@
uint64_t newQuota = 0;
WebProcess::singleton().parentProcessConnection()->sendSync(
Messages::WebPageProxy::ReachedApplicationCacheOriginQuota(origin->databaseIdentifier(), currentQuota, totalBytesNeeded),
- Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend);
+ Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
cacheStorage.storeUpdatedQuotaForOrigin(origin, newQuota);
}
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -690,7 +690,7 @@
Ref<WebFrame> protect(*m_frame);
WebCore::Frame* coreFrame = m_frame->coreFrame();
- if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), std::chrono::milliseconds::max(), IPC::InformPlatformProcessWillSuspend)) {
+ if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend)) {
m_frame->didReceivePolicyDecision(listenerID, PolicyIgnore, 0, { });
return;
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -111,7 +111,7 @@
PassRefPtr<WebFrame> WebFrame::createWithCoreMainFrame(WebPage* page, WebCore::Frame* coreFrame)
{
auto frame = create(std::unique_ptr<WebFrameLoaderClient>(static_cast<WebFrameLoaderClient*>(&coreFrame->loader().client())));
- page->send(Messages::WebPageProxy::DidCreateMainFrame(frame->frameID()), page->pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ page->send(Messages::WebPageProxy::DidCreateMainFrame(frame->frameID()), page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
frame->m_coreFrame = coreFrame;
frame->m_coreFrame->tree().setName(String());
@@ -122,7 +122,7 @@
PassRefPtr<WebFrame> WebFrame::createSubframe(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
{
auto frame = create(std::make_unique<WebFrameLoaderClient>());
- page->send(Messages::WebPageProxy::DidCreateSubframe(frame->frameID()), page->pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ page->send(Messages::WebPageProxy::DidCreateSubframe(frame->frameID()), page->pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
Ref<WebCore::Frame> coreFrame = Frame::create(page->corePage(), ownerElement, frame->m_frameLoaderClient.get());
frame->m_coreFrame = coreFrame.ptr();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-08-25 23:09:28 UTC (rev 204996)
@@ -4767,7 +4767,7 @@
} else
send(Messages::WebPageProxy::EditorStateChanged(editorState));
#else
- send(Messages::WebPageProxy::EditorStateChanged(editorState), pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ send(Messages::WebPageProxy::EditorStateChanged(editorState), pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
#endif
#if PLATFORM(IOS)
@@ -4842,7 +4842,7 @@
if (!m_isEditorStateMissingPostLayoutData)
return;
- send(Messages::WebPageProxy::EditorStateChanged(editorState(IncludePostLayoutDataHint::Yes)), pageID(), IPC::DispatchMessageEvenWhenWaitingForSyncReply);
+ send(Messages::WebPageProxy::EditorStateChanged(editorState(IncludePostLayoutDataHint::Yes)), pageID(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
m_isEditorStateMissingPostLayoutData = false;
}
@@ -5389,7 +5389,7 @@
UserData returnUserData;
auto& webProcess = WebProcess::singleton();
- if (!sendSync(Messages::WebPageProxy::HandleSynchronousMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), Messages::WebPageProxy::HandleSynchronousMessage::Reply(returnUserData), std::chrono::milliseconds::max(), IPC::SyncMessageSendFlags::UseFullySynchronousModeForTesting))
+ if (!sendSync(Messages::WebPageProxy::HandleSynchronousMessage(messageName, UserData(webProcess.transformObjectsToHandles(messageBody))), Messages::WebPageProxy::HandleSynchronousMessage::Reply(returnUserData), std::chrono::milliseconds::max(), IPC::SendSyncOption::UseFullySynchronousModeForTesting))
returnData = nullptr;
else
returnData = webProcess.transformHandlesToObjects(returnUserData.object());
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (204995 => 204996)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2016-08-25 23:02:52 UTC (rev 204995)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm 2016-08-25 23:09:28 UTC (rev 204996)
@@ -494,7 +494,7 @@
CGContextFlush(context.get());
m_hasFlushed = true;
- m_connection->sendMessage(WTFMove(m_commitEncoder));
+ m_connection->sendMessage(WTFMove(m_commitEncoder), { });
}
void RemoteLayerTreeDrawingArea::viewStateDidChange(ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>&)