Skip to content

Commit

Permalink
Unreviewed, reverting 266259@main.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259475

Broke 60+ test on mac-AS-debug-wk2 configuration

Reverted changeset:

"Disable builtInNotification endpoints when builtInNotificationsEnabled is set to false"
https://bugs.webkit.org/show_bug.cgi?id=259443
https://commits.webkit.org/266259@main

Canonical link: https://commits.webkit.org/266288@main
  • Loading branch information
webkit-commit-queue authored and aj062 committed Jul 25, 2023
1 parent bad55b6 commit 9b1fbb5
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 47 deletions.
2 changes: 0 additions & 2 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -6316,8 +6316,6 @@ imported/w3c/web-platform-tests/css/css-text/text-spacing/tentative/parsing [ Sk
# This test is checking that WebContent is terminated when performing an invalid IPC operation
ipc/restrictedendpoints/no-test-only-ipc-expected-crash.html [ Crash ]
ipc/restrictedendpoints/deny-access-updateQuotaBasedOnSpaceUsageForTesting.html [ Crash ]
[ Debug ] ipc/restrictedendpoints/deny-access-webPush.html [ Crash ]
[ Release ] ipc/restrictedendpoints/deny-access-webPush.html [ Skip ]

# Early hints require network callbacks that are only present in macOS 12 / iOS 15 or greater.
http/wpt/loading/early-hints [ Skip ]
Expand Down
13 changes: 0 additions & 13 deletions LayoutTests/ipc/restrictedendpoints/deny-access-webPush.html

This file was deleted.

17 changes: 4 additions & 13 deletions Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "NetworkSocketChannel.h"
#include "NetworkSocketChannelMessages.h"
#include "NetworkStorageManager.h"
#include "NotificationManagerMessageHandlerMessages.h"
#include "PingLoad.h"
#include "PreconnectTask.h"
#include "RTCDataChannelRemoteManagerProxy.h"
Expand All @@ -77,7 +76,6 @@
#include <WebCore/ClientOrigin.h>
#include <WebCore/Cookie.h>
#include <WebCore/CookieStoreGetOptions.h>
#include <WebCore/DeprecatedGlobalSettings.h>
#include <WebCore/DocumentStorageAccess.h>
#include <WebCore/HTTPCookieAcceptPolicy.h>
#include <WebCore/LogInitialization.h>
Expand Down Expand Up @@ -227,10 +225,11 @@ void NetworkConnectionToWebProcess::transferKeptAliveLoad(NetworkResourceLoader&

void NetworkConnectionToWebProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
ASSERT_WITH_SECURITY_IMPLICATION(RunLoop::isMain());

// For security reasons, Messages::NetworkProcess IPC is only supposed to come from the UIProcess.
ASSERT_WITH_SECURITY_IMPLICATION(decoder.messageReceiverName() != Messages::NetworkProcess::messageReceiverName());
ASSERT(decoder.messageReceiverName() != Messages::NetworkProcess::messageReceiverName());

if (m_networkProcess->messageReceiverMap().dispatchMessage(connection, decoder))
return;

if (decoder.messageReceiverName() == Messages::NetworkConnectionToWebProcess::messageReceiverName()) {
didReceiveNetworkConnectionToWebProcessMessage(connection, decoder);
Expand All @@ -257,14 +256,6 @@ void NetworkConnectionToWebProcess::didReceiveMessage(IPC::Connection& connectio
return;
}

#if ENABLE(BUILT_IN_NOTIFICATIONS)
if (decoder.messageReceiverName() == Messages::NotificationManagerMessageHandler::messageReceiverName()) {
NETWORK_PROCESS_MESSAGE_CHECK(m_networkProcess->builtInNotificationsEnabled());
if (auto* networkSession = this->networkSession())
networkSession->notificationManager().didReceiveMessage(connection, decoder);
return;
}
#endif
#if USE(LIBWEBRTC)
if (decoder.messageReceiverName() == Messages::NetworkRTCMonitor::messageReceiverName()) {
rtcProvider().didReceiveNetworkRTCMonitorMessage(connection, decoder);
Expand Down
3 changes: 0 additions & 3 deletions Source/WebKit/NetworkProcess/NetworkProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,6 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&&

setPrivateClickMeasurementEnabled(parameters.enablePrivateClickMeasurement);
m_ftpEnabled = parameters.ftpEnabled;
#if ENABLE(BUILT_IN_NOTIFICATIONS)
m_builtInNotificationsEnabled = parameters.builtInNotificationsEnabled;
#endif

for (auto [processIdentifier, domain] : parameters.allowedFirstPartiesForCookies) {
if (auto* connection = webProcessConnection(processIdentifier))
Expand Down
2 changes: 0 additions & 2 deletions Source/WebKit/NetworkProcess/NetworkProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,
#endif

bool ftpEnabled() const { return m_ftpEnabled; }
bool builtInNotificationsEnabled() const { return m_builtInNotificationsEnabled; }

#if ENABLE(SERVICE_WORKER)
void getPendingPushMessages(PAL::SessionID, CompletionHandler<void(const Vector<WebPushMessage>&)>&&);
Expand Down Expand Up @@ -574,7 +573,6 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,

bool m_privateClickMeasurementEnabled { true };
bool m_ftpEnabled { false };
bool m_builtInNotificationsEnabled { false };
bool m_isSuspended { false };
bool m_didSyncCookiesForClose { false };
#if PLATFORM(COCOA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ struct NetworkProcessCreationParameters {

bool enablePrivateClickMeasurement { true };
bool ftpEnabled { false };
#if ENABLE(BUILT_IN_NOTIFICATIONS)
bool builtInNotificationsEnabled { false };
#endif

Vector<WebsiteDataStoreParameters> websiteDataStoreParameters;
Vector<std::pair<WebCore::ProcessIdentifier, WebCore::RegistrableDomain>> allowedFirstPartiesForCookies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ struct WebKit::NetworkProcessCreationParameters {

bool enablePrivateClickMeasurement
bool ftpEnabled
#if ENABLE(BUILT_IN_NOTIFICATIONS)
bool builtInNotificationsEnabled
#endif

Vector<WebKit::WebsiteDataStoreParameters> websiteDataStoreParameters
Vector<std::pair<WebCore::ProcessIdentifier, WebCore::RegistrableDomain>> allowedFirstPartiesForCookies;
Expand Down
4 changes: 4 additions & 0 deletions Source/WebKit/NetworkProcess/NetworkSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ NetworkSession::NetworkSession(NetworkProcess& networkProcess, const NetworkSess
parameters.serviceWorkerProcessTerminationDelayEnabled
};
#endif

#if ENABLE(BUILT_IN_NOTIFICATIONS)
m_networkProcess->addMessageReceiver(Messages::NotificationManagerMessageHandler::messageReceiverName(), m_sessionID.toUInt64(), m_notificationManager);
#endif
}

NetworkSession::~NetworkSession()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class NotificationManagerMessageHandler : public IPC::MessageReceiver {
virtual void didDestroyNotification(const WTF::UUID& notificationID) = 0;
virtual void pageWasNotifiedOfNotificationPermission() = 0;

private:
// IPC::MessageReceiver
void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
};
Expand Down
8 changes: 0 additions & 8 deletions Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@
#include "LegacyCustomProtocolManagerClient.h"
#endif

#if ENABLE(BUILT_IN_NOTIFICATIONS)
#include <WebCore/DeprecatedGlobalSettings.h>
#endif

#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, connection())

namespace WebKit {
Expand Down Expand Up @@ -231,10 +227,6 @@ void NetworkProcessProxy::sendCreationParametersToNewProcess()
parameters.enablePrivateClickMeasurement = false;
#endif

#if ENABLE(BUILT_IN_NOTIFICATIONS)
parameters.builtInNotificationsEnabled = DeprecatedGlobalSettings::builtInNotificationsEnabled();
#endif

parameters.allowedFirstPartiesForCookies = WebProcessProxy::allowedFirstPartiesForCookies();

#if PLATFORM(COCOA)
Expand Down

0 comments on commit 9b1fbb5

Please sign in to comment.