1/*
2 * Copyright (C) 2010-2018 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'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "config.h"
26
27#include "NetworkConnectionToWebProcess.h"
28
29#include "ArgumentCoders.h"
30#include "Decoder.h"
31#include "DownloadID.h"
32#include "HandleMessage.h"
33#include "NetworkConnectionToWebProcessMessages.h"
34#include "NetworkResourceLoadParameters.h"
35#include "SandboxExtension.h"
36#include "WebCoreArgumentCoders.h"
37#include <WebCore/BlobPart.h>
38#include <WebCore/Cookie.h>
39#include <WebCore/CookieJar.h>
40#if ENABLE(RESOURCE_LOAD_STATISTICS)
41#include <WebCore/DocumentStorageAccess.h>
42#endif
43#include <WebCore/NetworkLoadInformation.h>
44#include <WebCore/NetworkLoadMetrics.h>
45#include <WebCore/PageIdentifier.h>
46#if ENABLE(RESOURCE_LOAD_STATISTICS)
47#include <WebCore/RegistrableDomain.h>
48#endif
49#include <WebCore/ResourceError.h>
50#if ENABLE(RESOURCE_LOAD_STATISTICS)
51#include <WebCore/ResourceLoadStatistics.h>
52#endif
53#include <WebCore/ResourceRequest.h>
54#include <WebCore/ResourceResponse.h>
55#include <WebCore/SameSiteInfo.h>
56#if ENABLE(SERVICE_WORKER)
57#include <WebCore/ServiceWorkerTypes.h>
58#endif
59#include <pal/SessionID.h>
60#include <wtf/Optional.h>
61#include <wtf/Vector.h>
62#if ENABLE(RESOURCE_LOAD_STATISTICS)
63#include <wtf/WallTime.h>
64#endif
65#include <wtf/text/WTFString.h>
66
67namespace Messages {
68
69namespace NetworkConnectionToWebProcess {
70
71void PerformSynchronousLoad::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebCore::ResourceError& error, const WebCore::ResourceResponse& response, const Vector<char>& data)
72{
73 *encoder << error;
74 *encoder << response;
75 *encoder << data;
76 connection.sendSyncReply(WTFMove(encoder));
77}
78
79void CookiesForDOM::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const String& cookieString, bool didAccessSecureCookies)
80{
81 *encoder << cookieString;
82 *encoder << didAccessSecureCookies;
83 connection.sendSyncReply(WTFMove(encoder));
84}
85
86void CookiesEnabled::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, bool enabled)
87{
88 *encoder << enabled;
89 connection.sendSyncReply(WTFMove(encoder));
90}
91
92void CookieRequestHeaderFieldValue::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const String& cookieString, bool didAccessSecureCookies)
93{
94 *encoder << cookieString;
95 *encoder << didAccessSecureCookies;
96 connection.sendSyncReply(WTFMove(encoder));
97}
98
99void GetRawCookies::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const Vector<WebCore::Cookie>& cookies)
100{
101 *encoder << cookies;
102 connection.sendSyncReply(WTFMove(encoder));
103}
104
105void BlobSize::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, uint64_t resultSize)
106{
107 *encoder << resultSize;
108 connection.sendSyncReply(WTFMove(encoder));
109}
110
111void WriteBlobsToTemporaryFiles::callReply(IPC::Decoder& decoder, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
112{
113 Optional<Vector<String>> fileNames;
114 decoder >> fileNames;
115 if (!fileNames) {
116 ASSERT_NOT_REACHED();
117 cancelReply(WTFMove(completionHandler));
118 return;
119 }
120 completionHandler(WTFMove(*fileNames));
121}
122
123void WriteBlobsToTemporaryFiles::cancelReply(CompletionHandler<void(Vector<String>&&)>&& completionHandler)
124{
125 completionHandler(IPC::AsyncReplyError<Vector<String>>::create());
126}
127
128void WriteBlobsToTemporaryFiles::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const Vector<String>& fileNames)
129{
130 *encoder << fileNames;
131 connection.sendSyncReply(WTFMove(encoder));
132}
133
134#if ENABLE(RESOURCE_LOAD_STATISTICS)
135
136void HasStorageAccess::callReply(IPC::Decoder& decoder, CompletionHandler<void(bool&&)>&& completionHandler)
137{
138 Optional<bool> hasStorageAccess;
139 decoder >> hasStorageAccess;
140 if (!hasStorageAccess) {
141 ASSERT_NOT_REACHED();
142 cancelReply(WTFMove(completionHandler));
143 return;
144 }
145 completionHandler(WTFMove(*hasStorageAccess));
146}
147
148void HasStorageAccess::cancelReply(CompletionHandler<void(bool&&)>&& completionHandler)
149{
150 completionHandler(IPC::AsyncReplyError<bool>::create());
151}
152
153void HasStorageAccess::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, bool hasStorageAccess)
154{
155 *encoder << hasStorageAccess;
156 connection.sendSyncReply(WTFMove(encoder));
157}
158
159#endif
160
161#if ENABLE(RESOURCE_LOAD_STATISTICS)
162
163void RequestStorageAccess::callReply(IPC::Decoder& decoder, CompletionHandler<void(WebCore::StorageAccessWasGranted&&, WebCore::StorageAccessPromptWasShown&&)>&& completionHandler)
164{
165 Optional<WebCore::StorageAccessWasGranted> wasGranted;
166 decoder >> wasGranted;
167 if (!wasGranted) {
168 ASSERT_NOT_REACHED();
169 cancelReply(WTFMove(completionHandler));
170 return;
171 }
172 Optional<WebCore::StorageAccessPromptWasShown> promptWasShown;
173 decoder >> promptWasShown;
174 if (!promptWasShown) {
175 ASSERT_NOT_REACHED();
176 cancelReply(WTFMove(completionHandler));
177 return;
178 }
179 completionHandler(WTFMove(*wasGranted), WTFMove(*promptWasShown));
180}
181
182void RequestStorageAccess::cancelReply(CompletionHandler<void(WebCore::StorageAccessWasGranted&&, WebCore::StorageAccessPromptWasShown&&)>&& completionHandler)
183{
184 completionHandler(IPC::AsyncReplyError<WebCore::StorageAccessWasGranted>::create(), IPC::AsyncReplyError<WebCore::StorageAccessPromptWasShown>::create());
185}
186
187void RequestStorageAccess::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, WebCore::StorageAccessWasGranted wasGranted, WebCore::StorageAccessPromptWasShown promptWasShown)
188{
189 *encoder << wasGranted;
190 *encoder << promptWasShown;
191 connection.sendSyncReply(WTFMove(encoder));
192}
193
194#endif
195
196void GetNetworkLoadInformationRequest::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebCore::ResourceRequest& request)
197{
198 *encoder << request;
199 connection.sendSyncReply(WTFMove(encoder));
200}
201
202void GetNetworkLoadInformationResponse::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebCore::ResourceResponse& response)
203{
204 *encoder << response;
205 connection.sendSyncReply(WTFMove(encoder));
206}
207
208void GetNetworkLoadIntermediateInformation::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const Vector<WebCore::NetworkTransactionInformation>& transactions)
209{
210 *encoder << transactions;
211 connection.sendSyncReply(WTFMove(encoder));
212}
213
214void TakeNetworkLoadInformationMetrics::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebCore::NetworkLoadMetrics& networkMetrics)
215{
216 *encoder << networkMetrics;
217 connection.sendSyncReply(WTFMove(encoder));
218}
219
220#if ENABLE(INDEXED_DATABASE)
221
222void EstablishIDBConnectionToServer::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, uint64_t serverConnectionIdentifier)
223{
224 *encoder << serverConnectionIdentifier;
225 connection.sendSyncReply(WTFMove(encoder));
226}
227
228#endif
229
230#if ENABLE(SERVICE_WORKER)
231
232void EstablishSWServerConnection::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebCore::SWServerConnectionIdentifier& serverConnectionIdentifier)
233{
234 *encoder << serverConnectionIdentifier;
235 connection.sendSyncReply(WTFMove(encoder));
236}
237
238#endif
239
240} // namespace NetworkConnectionToWebProcess
241
242} // namespace Messages
243
244namespace WebKit {
245
246void NetworkConnectionToWebProcess::didReceiveNetworkConnectionToWebProcessMessage(IPC::Connection& connection, IPC::Decoder& decoder)
247{
248 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad::name()) {
249 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad>(decoder, this, &NetworkConnectionToWebProcess::scheduleResourceLoad);
250 return;
251 }
252 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::LoadPing::name()) {
253 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::LoadPing>(decoder, this, &NetworkConnectionToWebProcess::loadPing);
254 return;
255 }
256 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier::name()) {
257 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier>(decoder, this, &NetworkConnectionToWebProcess::removeLoadIdentifier);
258 return;
259 }
260 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::PageLoadCompleted::name()) {
261 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::PageLoadCompleted>(decoder, this, &NetworkConnectionToWebProcess::pageLoadCompleted);
262 return;
263 }
264 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::PrefetchDNS::name()) {
265 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::PrefetchDNS>(decoder, this, &NetworkConnectionToWebProcess::prefetchDNS);
266 return;
267 }
268 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::PreconnectTo::name()) {
269 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::PreconnectTo>(decoder, this, &NetworkConnectionToWebProcess::preconnectTo);
270 return;
271 }
272 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::StartDownload::name()) {
273 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::StartDownload>(decoder, this, &NetworkConnectionToWebProcess::startDownload);
274 return;
275 }
276 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload::name()) {
277 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload>(decoder, this, &NetworkConnectionToWebProcess::convertMainResourceLoadToDownload);
278 return;
279 }
280 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM::name()) {
281 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM>(decoder, this, &NetworkConnectionToWebProcess::setCookiesFromDOM);
282 return;
283 }
284 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::DeleteCookie::name()) {
285 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::DeleteCookie>(decoder, this, &NetworkConnectionToWebProcess::deleteCookie);
286 return;
287 }
288 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL::name()) {
289 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL>(decoder, this, &NetworkConnectionToWebProcess::registerFileBlobURL);
290 return;
291 }
292 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RegisterBlobURL::name()) {
293 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RegisterBlobURL>(decoder, this, &NetworkConnectionToWebProcess::registerBlobURL);
294 return;
295 }
296 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL::name()) {
297 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL>(decoder, this, &NetworkConnectionToWebProcess::registerBlobURLFromURL);
298 return;
299 }
300 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked::name()) {
301 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked>(decoder, this, &NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked);
302 return;
303 }
304 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice::name()) {
305 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice>(decoder, this, &NetworkConnectionToWebProcess::registerBlobURLForSlice);
306 return;
307 }
308 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::UnregisterBlobURL::name()) {
309 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::UnregisterBlobURL>(decoder, this, &NetworkConnectionToWebProcess::unregisterBlobURL);
310 return;
311 }
312 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles::name()) {
313 IPC::handleMessageAsync<Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles>(connection, decoder, this, &NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles);
314 return;
315 }
316 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled::name()) {
317 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled>(decoder, this, &NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled);
318 return;
319 }
320 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::CreateSocketStream::name()) {
321 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::CreateSocketStream>(decoder, this, &NetworkConnectionToWebProcess::createSocketStream);
322 return;
323 }
324 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::CreateSocketChannel::name()) {
325 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::CreateSocketChannel>(decoder, this, &NetworkConnectionToWebProcess::createSocketChannel);
326 return;
327 }
328 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession::name()) {
329 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession>(decoder, this, &NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession);
330 return;
331 }
332#if ENABLE(RESOURCE_LOAD_STATISTICS)
333 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RemoveStorageAccessForFrame::name()) {
334 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RemoveStorageAccessForFrame>(decoder, this, &NetworkConnectionToWebProcess::removeStorageAccessForFrame);
335 return;
336 }
337#endif
338#if ENABLE(RESOURCE_LOAD_STATISTICS)
339 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::ClearPageSpecificDataForResourceLoadStatistics::name()) {
340 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::ClearPageSpecificDataForResourceLoadStatistics>(decoder, this, &NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics);
341 return;
342 }
343#endif
344#if ENABLE(RESOURCE_LOAD_STATISTICS)
345 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::LogUserInteraction::name()) {
346 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::LogUserInteraction>(decoder, this, &NetworkConnectionToWebProcess::logUserInteraction);
347 return;
348 }
349#endif
350#if ENABLE(RESOURCE_LOAD_STATISTICS)
351 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::LogWebSocketLoading::name()) {
352 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::LogWebSocketLoading>(decoder, this, &NetworkConnectionToWebProcess::logWebSocketLoading);
353 return;
354 }
355#endif
356#if ENABLE(RESOURCE_LOAD_STATISTICS)
357 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::LogSubresourceLoading::name()) {
358 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::LogSubresourceLoading>(decoder, this, &NetworkConnectionToWebProcess::logSubresourceLoading);
359 return;
360 }
361#endif
362#if ENABLE(RESOURCE_LOAD_STATISTICS)
363 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::LogSubresourceRedirect::name()) {
364 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::LogSubresourceRedirect>(decoder, this, &NetworkConnectionToWebProcess::logSubresourceRedirect);
365 return;
366 }
367#endif
368#if ENABLE(RESOURCE_LOAD_STATISTICS)
369 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::ResourceLoadStatisticsUpdated::name()) {
370 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::ResourceLoadStatisticsUpdated>(decoder, this, &NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated);
371 return;
372 }
373#endif
374#if ENABLE(RESOURCE_LOAD_STATISTICS)
375 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::HasStorageAccess::name()) {
376 IPC::handleMessageAsync<Messages::NetworkConnectionToWebProcess::HasStorageAccess>(connection, decoder, this, &NetworkConnectionToWebProcess::hasStorageAccess);
377 return;
378 }
379#endif
380#if ENABLE(RESOURCE_LOAD_STATISTICS)
381 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RequestStorageAccess::name()) {
382 IPC::handleMessageAsync<Messages::NetworkConnectionToWebProcess::RequestStorageAccess>(connection, decoder, this, &NetworkConnectionToWebProcess::requestStorageAccess);
383 return;
384 }
385#endif
386#if ENABLE(RESOURCE_LOAD_STATISTICS)
387 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RequestStorageAccessUnderOpener::name()) {
388 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RequestStorageAccessUnderOpener>(decoder, this, &NetworkConnectionToWebProcess::requestStorageAccessUnderOpener);
389 return;
390 }
391#endif
392 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry::name()) {
393 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry>(decoder, this, &NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry);
394 return;
395 }
396 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::RemoveOriginAccessWhitelistEntry::name()) {
397 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::RemoveOriginAccessWhitelistEntry>(decoder, this, &NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry);
398 return;
399 }
400 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::ResetOriginAccessWhitelists::name()) {
401 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::ResetOriginAccessWhitelists>(decoder, this, &NetworkConnectionToWebProcess::resetOriginAccessWhitelists);
402 return;
403 }
404 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::WebPageWasAdded::name()) {
405 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::WebPageWasAdded>(decoder, this, &NetworkConnectionToWebProcess::webPageWasAdded);
406 return;
407 }
408 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::WebPageWasRemoved::name()) {
409 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::WebPageWasRemoved>(decoder, this, &NetworkConnectionToWebProcess::webPageWasRemoved);
410 return;
411 }
412 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::WebProcessSessionChanged::name()) {
413 IPC::handleMessage<Messages::NetworkConnectionToWebProcess::WebProcessSessionChanged>(decoder, this, &NetworkConnectionToWebProcess::webProcessSessionChanged);
414 return;
415 }
416 UNUSED_PARAM(connection);
417 UNUSED_PARAM(decoder);
418 ASSERT_NOT_REACHED();
419}
420
421void NetworkConnectionToWebProcess::didReceiveSyncNetworkConnectionToWebProcessMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder)
422{
423 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::name()) {
424 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::performSynchronousLoad);
425 return;
426 }
427 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::CookiesForDOM::name()) {
428 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::CookiesForDOM>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::cookiesForDOM);
429 return;
430 }
431 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::CookiesEnabled::name()) {
432 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::CookiesEnabled>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::cookiesEnabled);
433 return;
434 }
435 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::name()) {
436 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue);
437 return;
438 }
439 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::GetRawCookies::name()) {
440 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::GetRawCookies>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::getRawCookies);
441 return;
442 }
443 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::BlobSize::name()) {
444 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::BlobSize>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::blobSize);
445 return;
446 }
447 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::GetNetworkLoadInformationRequest::name()) {
448 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::GetNetworkLoadInformationRequest>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::getNetworkLoadInformationRequest);
449 return;
450 }
451 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::GetNetworkLoadInformationResponse::name()) {
452 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::GetNetworkLoadInformationResponse>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::getNetworkLoadInformationResponse);
453 return;
454 }
455 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::GetNetworkLoadIntermediateInformation::name()) {
456 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::GetNetworkLoadIntermediateInformation>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation);
457 return;
458 }
459 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::TakeNetworkLoadInformationMetrics::name()) {
460 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::TakeNetworkLoadInformationMetrics>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics);
461 return;
462 }
463#if ENABLE(INDEXED_DATABASE)
464 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::EstablishIDBConnectionToServer::name()) {
465 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::EstablishIDBConnectionToServer>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::establishIDBConnectionToServer);
466 return;
467 }
468#endif
469#if ENABLE(SERVICE_WORKER)
470 if (decoder.messageName() == Messages::NetworkConnectionToWebProcess::EstablishSWServerConnection::name()) {
471 IPC::handleMessageSynchronous<Messages::NetworkConnectionToWebProcess::EstablishSWServerConnection>(connection, decoder, replyEncoder, this, &NetworkConnectionToWebProcess::establishSWServerConnection);
472 return;
473 }
474#endif
475 UNUSED_PARAM(connection);
476 UNUSED_PARAM(decoder);
477 UNUSED_PARAM(replyEncoder);
478 ASSERT_NOT_REACHED();
479}
480
481} // namespace WebKit
482
483