| File: | Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp |
| Warning: | line 296, column 11 Local variable 'resource' is uncounted and unsafe |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* |
| 2 | * Copyright (C) 2010-2025 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "config.h" |
| 27 | #include "NetworkProcessConnection.h" |
| 28 | |
| 29 | #include "LibWebRTCNetwork.h" |
| 30 | #include "Logging.h" |
| 31 | #include "NetworkConnectionToWebProcessMessages.h" |
| 32 | #include "RTCDataChannelRemoteManager.h" |
| 33 | #include "StorageAreaMap.h" |
| 34 | #include "StorageAreaMapMessages.h" |
| 35 | #include "WebBroadcastChannelRegistry.h" |
| 36 | #include "WebBroadcastChannelRegistryMessages.h" |
| 37 | #include "WebCacheStorageProvider.h" |
| 38 | #include "WebCookieJar.h" |
| 39 | #include "WebFileSystemStorageConnection.h" |
| 40 | #include "WebFileSystemStorageConnectionMessages.h" |
| 41 | #include "WebFrame.h" |
| 42 | #include "WebIDBConnectionToServer.h" |
| 43 | #include "WebIDBConnectionToServerMessages.h" |
| 44 | #include "WebLoaderStrategy.h" |
| 45 | #include "WebPage.h" |
| 46 | #include "WebPageMessages.h" |
| 47 | #include "WebPaymentCoordinator.h" |
| 48 | #include "WebProcess.h" |
| 49 | #include "WebRTCMonitor.h" |
| 50 | #include "WebRTCMonitorMessages.h" |
| 51 | #include "WebRTCResolverMessages.h" |
| 52 | #include "WebResourceLoaderMessages.h" |
| 53 | #include "WebSWClientConnection.h" |
| 54 | #include "WebSWClientConnectionMessages.h" |
| 55 | #include "WebSWContextManagerConnection.h" |
| 56 | #include "WebSWContextManagerConnectionMessages.h" |
| 57 | #include "WebServiceWorkerProvider.h" |
| 58 | #include "WebSharedWorkerContextManagerConnection.h" |
| 59 | #include "WebSharedWorkerContextManagerConnectionMessages.h" |
| 60 | #include "WebSharedWorkerObjectConnection.h" |
| 61 | #include "WebSharedWorkerObjectConnectionMessages.h" |
| 62 | #include "WebSocketChannel.h" |
| 63 | #include "WebSocketChannelMessages.h" |
| 64 | #include "WebTransportSession.h" |
| 65 | #include "WebTransportSessionMessages.h" |
| 66 | #include <WebCore/BackgroundFetchRecordInformation.h> |
| 67 | #include <WebCore/CachedResource.h> |
| 68 | #include <WebCore/HTTPCookieAcceptPolicy.h> |
| 69 | #include <WebCore/InspectorInstrumentationWebKit.h> |
| 70 | #include <WebCore/MemoryCache.h> |
| 71 | #include <WebCore/MessagePort.h> |
| 72 | #include <WebCore/NavigationScheduler.h> |
| 73 | #include <WebCore/Page.h> |
| 74 | #include <WebCore/PermissionController.h> |
| 75 | #include <WebCore/SharedBuffer.h> |
| 76 | #include <pal/SessionID.h> |
| 77 | |
| 78 | #if USE(LIBRICE)(defined USE_LIBRICE && USE_LIBRICE) |
| 79 | #include "RiceBackendProxy.h" |
| 80 | #include "RiceBackendProxyMessages.h" |
| 81 | #endif |
| 82 | |
| 83 | #if ENABLE(APPLE_PAY_REMOTE_UI)(defined 0 && 0) |
| 84 | #include "WebPaymentCoordinatorMessages.h" |
| 85 | #endif |
| 86 | |
| 87 | namespace WebKit { |
| 88 | using namespace WebCore; |
| 89 | |
| 90 | NetworkProcessConnection::NetworkProcessConnection(IPC::Connection::Identifier&& connectionIdentifier, HTTPCookieAcceptPolicy cookieAcceptPolicy) |
| 91 | : m_connection(IPC::Connection::createClientConnection(WTF::move(connectionIdentifier))) |
| 92 | , m_cookieAcceptPolicy(cookieAcceptPolicy) |
| 93 | { |
| 94 | m_connection->open(*this); |
| 95 | |
| 96 | #if USE(LIBWEBRTC)(defined 1 && 1) |
| 97 | if (WebRTCProvider::webRTCAvailable()) |
| 98 | protect(WebProcess::singleton().libWebRTCNetwork())->setConnection(m_connection.copyRef()); |
| 99 | #endif |
| 100 | } |
| 101 | |
| 102 | NetworkProcessConnection::~NetworkProcessConnection() |
| 103 | { |
| 104 | m_connection->invalidate(); |
| 105 | } |
| 106 | |
| 107 | bool NetworkProcessConnection::dispatchMessage(IPC::Connection& connection, IPC::Decoder& decoder) |
| 108 | { |
| 109 | if (decoder.messageReceiverName() == Messages::WebResourceLoader::messageReceiverName()) { |
| 110 | if (RefPtr webResourceLoader = protect(WebProcess::singleton().webLoaderStrategy())->webResourceLoaderForIdentifier(AtomicObjectIdentifier<WebCore::ResourceLoaderIdentifierType>(decoder.destinationID()))) |
| 111 | webResourceLoader->didReceiveMessage(connection, decoder); |
| 112 | return true; |
| 113 | } |
| 114 | if (decoder.messageReceiverName() == Messages::WebBroadcastChannelRegistry::messageReceiverName()) { |
| 115 | WebProcess::singleton().broadcastChannelRegistry().didReceiveMessage(connection, decoder); |
| 116 | return true; |
| 117 | } |
| 118 | if (decoder.messageReceiverName() == Messages::WebSocketChannel::messageReceiverName()) { |
| 119 | WebProcess::singleton().webSocketChannelManager().didReceiveMessage(connection, decoder); |
| 120 | return true; |
| 121 | } |
| 122 | if (decoder.messageReceiverName() == Messages::WebPage::messageReceiverName()) { |
| 123 | if (RefPtr webPage = WebProcess::singleton().webPage(ObjectIdentifier<PageIdentifierType>(decoder.destinationID()))) |
| 124 | webPage->didReceiveMessage(connection, decoder); |
| 125 | return true; |
| 126 | } |
| 127 | if (decoder.messageReceiverName() == Messages::StorageAreaMap::messageReceiverName()) { |
| 128 | if (auto storageAreaMap = WebProcess::singleton().storageAreaMap(ObjectIdentifier<StorageAreaMapIdentifierType>(decoder.destinationID()))) |
| 129 | storageAreaMap->didReceiveMessage(connection, decoder); |
| 130 | return true; |
| 131 | } |
| 132 | if (decoder.messageReceiverName() == Messages::WebFileSystemStorageConnection::messageReceiverName()) { |
| 133 | protect(WebProcess::singleton().fileSystemStorageConnection())->didReceiveMessage(connection, decoder); |
| 134 | return true; |
| 135 | } |
| 136 | if (decoder.messageReceiverName() == Messages::WebTransportSession::messageReceiverName()) { |
| 137 | if (RefPtr webTransportSession = WebProcess::singleton().webTransportSession(WebTransportSessionIdentifier(decoder.destinationID()))) |
| 138 | webTransportSession->didReceiveMessage(connection, decoder); |
| 139 | return true; |
| 140 | } |
| 141 | |
| 142 | #if USE(LIBWEBRTC)(defined 1 && 1) |
| 143 | if (decoder.messageReceiverName() == Messages::WebRTCMonitor::messageReceiverName()) { |
| 144 | Ref network = WebProcess::singleton().libWebRTCNetwork(); |
| 145 | if (network->isActive()) |
| 146 | protect(network->monitor())->didReceiveMessage(connection, decoder); |
| 147 | else |
| 148 | RELEASE_LOG_ERROR(WebRTC, "Received WebRTCMonitor message while libWebRTCNetwork is not active")clang diagnostic push
clang diagnostic ignored "-Wunknown-warning-option" clang diagnostic ignored "-Wunsafe-buffer-usage" clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call" clang diagnostic ignored "-Wunsafe-buffer-usage-in-format-attr-call" [[clang ::suppress]] __extension__({ os_log_t _log_tmp = (WebKit2LogWebRTC .osLogChannel); os_log_type_t _type_tmp = OS_LOG_TYPE_ERROR; if (os_log_type_enabled(_log_tmp, _type_tmp)) { __extension__({ clang diagnostic push clang diagnostic ignored "-Wvla" clang diagnostic error "-Wformat" _Static_assert(__builtin_constant_p ("Received WebRTCMonitor message while libWebRTCNetwork is not active" ), "format/label/description argument must be a string constant" ); __attribute__((section("__TEXT,__oslogstring,cstring_literals" ),internal_linkage)) static const char _os_fmt_str[] __asm("LOS_LOG40" ) = "Received WebRTCMonitor message while libWebRTCNetwork is not active" ; uint8_t _Alignas(16) __attribute__((uninitialized)) _os_fmt_buf [__builtin_os_log_format_buffer_size("Received WebRTCMonitor message while libWebRTCNetwork is not active" )]; _os_log_error_impl(&__dso_handle, _log_tmp, _type_tmp , _os_fmt_str, (uint8_t *)__builtin_os_log_format(_os_fmt_buf , "Received WebRTCMonitor message while libWebRTCNetwork is not active" ), (uint32_t)sizeof(_os_fmt_buf)) clang diagnostic pop ; }); } }) clang diagnostic pop ; |
| 149 | return true; |
| 150 | } |
| 151 | if (decoder.messageReceiverName() == Messages::WebRTCResolver::messageReceiverName()) { |
| 152 | Ref network = WebProcess::singleton().libWebRTCNetwork(); |
| 153 | if (network->isActive()) |
| 154 | network->resolver(AtomicObjectIdentifier<LibWebRTCResolverIdentifierType>(decoder.destinationID()))->didReceiveMessage(connection, decoder); |
| 155 | else |
| 156 | RELEASE_LOG_ERROR(WebRTC, "Received WebRTCResolver message while libWebRTCNetwork is not active")clang diagnostic push
clang diagnostic ignored "-Wunknown-warning-option" clang diagnostic ignored "-Wunsafe-buffer-usage" clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call" clang diagnostic ignored "-Wunsafe-buffer-usage-in-format-attr-call" [[clang ::suppress]] __extension__({ os_log_t _log_tmp = (WebKit2LogWebRTC .osLogChannel); os_log_type_t _type_tmp = OS_LOG_TYPE_ERROR; if (os_log_type_enabled(_log_tmp, _type_tmp)) { __extension__({ clang diagnostic push clang diagnostic ignored "-Wvla" clang diagnostic error "-Wformat" _Static_assert(__builtin_constant_p ("Received WebRTCResolver message while libWebRTCNetwork is not active" ), "format/label/description argument must be a string constant" ); __attribute__((section("__TEXT,__oslogstring,cstring_literals" ),internal_linkage)) static const char _os_fmt_str[] __asm("LOS_LOG41" ) = "Received WebRTCResolver message while libWebRTCNetwork is not active" ; uint8_t _Alignas(16) __attribute__((uninitialized)) _os_fmt_buf [__builtin_os_log_format_buffer_size("Received WebRTCResolver message while libWebRTCNetwork is not active" )]; _os_log_error_impl(&__dso_handle, _log_tmp, _type_tmp , _os_fmt_str, (uint8_t *)__builtin_os_log_format(_os_fmt_buf , "Received WebRTCResolver message while libWebRTCNetwork is not active" ), (uint32_t)sizeof(_os_fmt_buf)) clang diagnostic pop ; }); } }) clang diagnostic pop ; |
| 157 | return true; |
| 158 | } |
| 159 | #endif |
| 160 | |
| 161 | #if USE(LIBRICE)(defined USE_LIBRICE && USE_LIBRICE) |
| 162 | if (decoder.messageReceiverName() == Messages::RiceBackendProxy::messageReceiverName()) { |
| 163 | if (RefPtr agent = WebProcess::singleton().gstreamerIceBackend(RiceBackendIdentifier(decoder.destinationID()))) |
| 164 | agent->didReceiveMessage(connection, decoder); |
| 165 | return true; |
| 166 | } |
| 167 | #endif |
| 168 | |
| 169 | if (decoder.messageReceiverName() == Messages::WebIDBConnectionToServer::messageReceiverName()) { |
| 170 | if (RefPtr webIDBConnection = m_webIDBConnection) |
| 171 | webIDBConnection->didReceiveMessage(connection, decoder); |
| 172 | return true; |
| 173 | } |
| 174 | |
| 175 | if (decoder.messageReceiverName() == Messages::WebSWClientConnection::messageReceiverName()) { |
| 176 | protect(serviceWorkerConnection())->didReceiveMessage(connection, decoder); |
| 177 | return true; |
| 178 | } |
| 179 | if (decoder.messageReceiverName() == Messages::WebSWContextManagerConnection::messageReceiverName()) { |
| 180 | ASSERT(SWContextManager::singleton().connection())((void)0); |
| 181 | if (RefPtr contextManagerConnection = SWContextManager::singleton().connection()) |
| 182 | downcast<WebSWContextManagerConnection>(*contextManagerConnection).didReceiveMessage(connection, decoder); |
| 183 | return true; |
| 184 | } |
| 185 | if (decoder.messageReceiverName() == Messages::WebSharedWorkerObjectConnection::messageReceiverName()) { |
| 186 | protect(sharedWorkerConnection())->didReceiveMessage(connection, decoder); |
| 187 | return true; |
| 188 | } |
| 189 | if (decoder.messageReceiverName() == Messages::WebSharedWorkerContextManagerConnection::messageReceiverName()) { |
| 190 | ASSERT(SharedWorkerContextManager::singleton().connection())((void)0); |
| 191 | if (RefPtr contextManagerConnection = SharedWorkerContextManager::singleton().connection()) |
| 192 | downcast<WebSharedWorkerContextManagerConnection>(*contextManagerConnection).didReceiveMessage(connection, decoder); |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | #if ENABLE(APPLE_PAY_REMOTE_UI)(defined 0 && 0) |
| 197 | if (decoder.messageReceiverName() == Messages::WebPaymentCoordinator::messageReceiverName()) { |
| 198 | if (RefPtr webPage = WebProcess::singleton().webPage(ObjectIdentifier<PageIdentifierType>(decoder.destinationID()))) |
| 199 | RefPtr { webPage->paymentCoordinator() }->didReceiveMessage(connection, decoder); |
| 200 | return true; |
| 201 | } |
| 202 | #endif |
| 203 | return false; |
| 204 | } |
| 205 | |
| 206 | bool NetworkProcessConnection::dispatchSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, UniqueRef<IPC::Encoder>& replyEncoder) |
| 207 | { |
| 208 | #if ENABLE(APPLE_PAY_REMOTE_UI)(defined 0 && 0) |
| 209 | if (decoder.messageReceiverName() == Messages::WebPaymentCoordinator::messageReceiverName()) { |
| 210 | if (RefPtr webPage = WebProcess::singleton().webPage(ObjectIdentifier<PageIdentifierType>(decoder.destinationID()))) { |
| 211 | RefPtr { webPage->paymentCoordinator() }->didReceiveSyncMessage(connection, decoder, replyEncoder); |
| 212 | return true; |
| 213 | } |
| 214 | return false; |
| 215 | } |
| 216 | #endif |
| 217 | return false; |
| 218 | } |
| 219 | |
| 220 | void NetworkProcessConnection::didClose(IPC::Connection&) |
| 221 | { |
| 222 | // The NetworkProcess probably crashed. |
| 223 | Ref<NetworkProcessConnection> protector(*this); |
| 224 | WebProcess::singleton().networkProcessConnectionClosed(this); |
| 225 | |
| 226 | if (auto idbConnection = std::exchange(m_webIDBConnection, nullptr)) |
| 227 | idbConnection->connectionToServerLost(); |
| 228 | |
| 229 | if (auto swConnection = std::exchange(m_swConnection, nullptr)) |
| 230 | swConnection->connectionToServerLost(); |
| 231 | } |
| 232 | |
| 233 | void NetworkProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::MessageName, const Vector<uint32_t>&) |
| 234 | { |
| 235 | } |
| 236 | |
| 237 | void NetworkProcessConnection::writeBlobsToTemporaryFilesForIndexedDB(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) |
| 238 | { |
| 239 | m_connection->sendWithAsyncReply(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFilesForIndexedDB(blobURLs), WTF::move(completionHandler)); |
| 240 | } |
| 241 | |
| 242 | void NetworkProcessConnection::didFinishPingLoad(WebCore::ResourceLoaderIdentifier pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response) |
| 243 | { |
| 244 | protect(WebProcess::singleton().webLoaderStrategy())->didFinishPingLoad(pingLoadIdentifier, WTF::move(error), WTF::move(response)); |
| 245 | } |
| 246 | |
| 247 | void NetworkProcessConnection::didFinishPreconnection(WebCore::ResourceLoaderIdentifier preconnectionIdentifier, ResourceError&& error) |
| 248 | { |
| 249 | protect(WebProcess::singleton().webLoaderStrategy())->didFinishPreconnection(preconnectionIdentifier, WTF::move(error)); |
| 250 | } |
| 251 | |
| 252 | void NetworkProcessConnection::setOnLineState(bool isOnLine) |
| 253 | { |
| 254 | protect(WebProcess::singleton().webLoaderStrategy())->setOnLineState(isOnLine); |
| 255 | } |
| 256 | |
| 257 | bool NetworkProcessConnection::cookiesEnabled() const |
| 258 | { |
| 259 | return m_cookieAcceptPolicy != HTTPCookieAcceptPolicy::Never; |
| 260 | } |
| 261 | |
| 262 | void NetworkProcessConnection::cookieAcceptPolicyChanged(HTTPCookieAcceptPolicy newPolicy) |
| 263 | { |
| 264 | if (m_cookieAcceptPolicy == newPolicy) |
| 265 | return; |
| 266 | |
| 267 | m_cookieAcceptPolicy = newPolicy; |
| 268 | WebProcess::singleton().cookieJar().clearCache(); |
| 269 | } |
| 270 | |
| 271 | #if HAVE(COOKIE_CHANGE_LISTENER_API)(defined 1 && 1) |
| 272 | void NetworkProcessConnection::cookiesAdded(const String& host, Vector<WebCore::Cookie>&& cookies) |
| 273 | { |
| 274 | WebProcess::singleton().cookieJar().cookiesAdded(host, WTF::move(cookies)); |
| 275 | } |
| 276 | |
| 277 | void NetworkProcessConnection::cookiesDeleted(const String& host, Vector<WebCore::Cookie>&& cookies) |
| 278 | { |
| 279 | WebProcess::singleton().cookieJar().cookiesDeleted(host, WTF::move(cookies)); |
| 280 | } |
| 281 | |
| 282 | void NetworkProcessConnection::allCookiesDeleted() |
| 283 | { |
| 284 | WebProcess::singleton().cookieJar().allCookiesDeleted(); |
| 285 | } |
| 286 | #endif |
| 287 | |
| 288 | void NetworkProcessConnection::updateCachedCookiesEnabled() |
| 289 | { |
| 290 | WebProcess::singleton().updateCachedCookiesEnabled(); |
| 291 | } |
| 292 | |
| 293 | #if ENABLE(SHAREABLE_RESOURCE)(defined 1 && 1) |
| 294 | void NetworkProcessConnection::didCacheResource(const ResourceRequest& request, ShareableResource::Handle&& handle) |
| 295 | { |
| 296 | auto* resource = MemoryCache::singleton().resourceForRequest(request, WebProcess::singleton().sessionID()); |
Local variable 'resource' is uncounted and unsafe | |
| 297 | if (!resource) |
| 298 | return; |
| 299 | |
| 300 | auto buffer = WTF::move(handle).tryWrapInSharedBuffer(); |
| 301 | if (!buffer) { |
| 302 | LOG_ERROR("Unable to create FragmentedSharedBuffer from ShareableResource handle for resource url %s", request.url().string().utf8().data())((void)0); |
| 303 | return; |
| 304 | } |
| 305 | |
| 306 | resource->tryReplaceEncodedData(*buffer); |
| 307 | } |
| 308 | #endif |
| 309 | |
| 310 | WebIDBConnectionToServer& NetworkProcessConnection::idbConnectionToServer() |
| 311 | { |
| 312 | if (!m_webIDBConnection) |
| 313 | m_webIDBConnection = WebIDBConnectionToServer::create(WebProcess::singleton().sessionID()); |
| 314 | |
| 315 | return *m_webIDBConnection; |
| 316 | } |
| 317 | |
| 318 | WebSWClientConnection& NetworkProcessConnection::serviceWorkerConnection() |
| 319 | { |
| 320 | if (!m_swConnection) |
| 321 | m_swConnection = WebSWClientConnection::create(); |
| 322 | return *m_swConnection; |
| 323 | } |
| 324 | |
| 325 | WebSharedWorkerObjectConnection& NetworkProcessConnection::sharedWorkerConnection() |
| 326 | { |
| 327 | if (!m_sharedWorkerConnection) |
| 328 | m_sharedWorkerConnection = WebSharedWorkerObjectConnection::create(); |
| 329 | return *m_sharedWorkerConnection; |
| 330 | } |
| 331 | |
| 332 | void NetworkProcessConnection::messagesAvailableForPort(const WebCore::MessagePortIdentifier& messagePortIdentifier) |
| 333 | { |
| 334 | WebProcess::singleton().messagesAvailableForPort(messagePortIdentifier); |
| 335 | } |
| 336 | |
| 337 | void NetworkProcessConnection::broadcastConsoleMessage(MessageSource source, MessageLevel level, const String& message) |
| 338 | { |
| 339 | FAST_RETURN_IF_NO_FRONTENDS(void())if (!InspectorInstrumentationPublic::hasFrontends()) [[likely ]] return void();; |
| 340 | |
| 341 | Page::forEachPage([&] (auto& page) { |
| 342 | if (RefPtr localTopDocument = page.localTopDocument()) |
| 343 | localTopDocument->addConsoleMessage(source, level, message); |
| 344 | }); |
| 345 | } |
| 346 | |
| 347 | void NetworkProcessConnection::loadCancelledDownloadRedirectRequestInFrame(WebCore::ResourceRequest&& request, WebCore::FrameIdentifier frameID, WebCore::PageIdentifier pageID) |
| 348 | { |
| 349 | if (RefPtr webPage = WebProcess::singleton().webPage(pageID); webPage && WebProcess::singleton().webFrame(frameID)) { |
| 350 | LoadParameters loadParameters; |
| 351 | loadParameters.frameIdentifier = frameID; |
| 352 | loadParameters.request = request; |
| 353 | webPage->loadRequest(WTF::move(loadParameters)); |
| 354 | } else |
| 355 | RELEASE_LOG_ERROR(Process, "Trying to load Invalid page or frame for %s", request.url().string().utf8().data())clang diagnostic push
clang diagnostic ignored "-Wunknown-warning-option" clang diagnostic ignored "-Wunsafe-buffer-usage" clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call" clang diagnostic ignored "-Wunsafe-buffer-usage-in-format-attr-call" [[clang ::suppress]] __extension__({ os_log_t _log_tmp = (WebKit2LogProcess .osLogChannel); os_log_type_t _type_tmp = OS_LOG_TYPE_ERROR; if (os_log_type_enabled(_log_tmp, _type_tmp)) { __extension__({ clang diagnostic push clang diagnostic ignored "-Wvla" clang diagnostic error "-Wformat" _Static_assert(__builtin_constant_p ("Trying to load Invalid page or frame for %s"), "format/label/description argument must be a string constant" ); __attribute__((section("__TEXT,__oslogstring,cstring_literals" ),internal_linkage)) static const char _os_fmt_str[] __asm("LOS_LOG42" ) = "Trying to load Invalid page or frame for %s"; uint8_t _Alignas (16) __attribute__((uninitialized)) _os_fmt_buf[__builtin_os_log_format_buffer_size ("Trying to load Invalid page or frame for %s", request.url() .string().utf8().data())]; _os_log_error_impl(&__dso_handle , _log_tmp, _type_tmp, _os_fmt_str, (uint8_t *)__builtin_os_log_format (_os_fmt_buf, "Trying to load Invalid page or frame for %s", request .url().string().utf8().data()), (uint32_t)sizeof(_os_fmt_buf) ) clang diagnostic pop ; }); } }) clang diagnostic pop ; |
| 356 | } |
| 357 | |
| 358 | #if ENABLE(WEB_RTC)(defined 1 && 1) |
| 359 | void NetworkProcessConnection::connectToRTCDataChannelRemoteSource(WebCore::RTCDataChannelIdentifier localIdentifier, WebCore::RTCDataChannelIdentifier remoteIdentifier, CompletionHandler<void(std::optional<bool>)>&& callback) |
| 360 | { |
| 361 | callback(RTCDataChannelRemoteManager::singleton().connectToRemoteSource(localIdentifier, remoteIdentifier)); |
| 362 | } |
| 363 | #endif |
| 364 | |
| 365 | void NetworkProcessConnection::storageAccessPermissionChanged(const WebCore::RegistrableDomain& topFrameDomain, const WebCore::RegistrableDomain& subFrameDomain) |
| 366 | { |
| 367 | WebCore::PermissionController::singleton().storageAccessPermissionChanged(topFrameDomain, subFrameDomain); |
| 368 | } |
| 369 | |
| 370 | } // namespace WebKit |