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 "WebProcess.h"
28
29#include "ArgumentCoders.h"
30#include "CacheModel.h"
31#include "DataReference.h"
32#include "Decoder.h"
33#if ENABLE(GAMEPAD)
34#include "GamepadData.h"
35#endif
36#include "HandleMessage.h"
37#if (ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS))
38#include "MediaDeviceSandboxExtensions.h"
39#endif
40#include "SandboxExtension.h"
41#include "TextCheckerState.h"
42#include "UserData.h"
43#include "WebCoreArgumentCoders.h"
44#include "WebPageCreationParameters.h"
45#if ENABLE(SERVICE_WORKER)
46#include "WebPreferencesStore.h"
47#endif
48#include "WebProcessCreationParameters.h"
49#include "WebProcessDataStoreParameters.h"
50#include "WebProcessMessages.h"
51#include "WebsiteData.h"
52#include "WebsiteDataType.h"
53#include <WebCore/MessagePortIdentifier.h>
54#include <WebCore/MessageWithMessagePorts.h>
55#if ENABLE(MEDIA_STREAM)
56#include <WebCore/MockMediaDevice.h>
57#endif
58#include <WebCore/PageIdentifier.h>
59#include <WebCore/PrewarmInformation.h>
60#if PLATFORM(MAC)
61#include <WebCore/ScreenProperties.h>
62#endif
63#include <WebCore/SecurityOriginData.h>
64#include <pal/SessionID.h>
65#include <wtf/HashMap.h>
66#include <wtf/OptionSet.h>
67#include <wtf/Vector.h>
68#include <wtf/WallTime.h>
69#include <wtf/text/WTFString.h>
70
71namespace Messages {
72
73namespace WebProcess {
74
75void FetchWebsiteData::callReply(IPC::Decoder& decoder, CompletionHandler<void(WebKit::WebsiteData&&)>&& completionHandler)
76{
77 Optional<WebKit::WebsiteData> websiteData;
78 decoder >> websiteData;
79 if (!websiteData) {
80 ASSERT_NOT_REACHED();
81 cancelReply(WTFMove(completionHandler));
82 return;
83 }
84 completionHandler(WTFMove(*websiteData));
85}
86
87void FetchWebsiteData::cancelReply(CompletionHandler<void(WebKit::WebsiteData&&)>&& completionHandler)
88{
89 completionHandler(IPC::AsyncReplyError<WebKit::WebsiteData>::create());
90}
91
92void FetchWebsiteData::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const WebKit::WebsiteData& websiteData)
93{
94 *encoder << websiteData;
95 connection.sendSyncReply(WTFMove(encoder));
96}
97
98void DeleteWebsiteData::callReply(IPC::Decoder& decoder, CompletionHandler<void()>&& completionHandler)
99{
100 completionHandler();
101}
102
103void DeleteWebsiteData::cancelReply(CompletionHandler<void()>&& completionHandler)
104{
105 completionHandler();
106}
107
108void DeleteWebsiteData::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection)
109{
110 connection.sendSyncReply(WTFMove(encoder));
111}
112
113void DeleteWebsiteDataForOrigins::callReply(IPC::Decoder& decoder, CompletionHandler<void()>&& completionHandler)
114{
115 completionHandler();
116}
117
118void DeleteWebsiteDataForOrigins::cancelReply(CompletionHandler<void()>&& completionHandler)
119{
120 completionHandler();
121}
122
123void DeleteWebsiteDataForOrigins::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection)
124{
125 connection.sendSyncReply(WTFMove(encoder));
126}
127
128void GetActivePagesOriginsForTesting::callReply(IPC::Decoder& decoder, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
129{
130 Optional<Vector<String>> activeOrigins;
131 decoder >> activeOrigins;
132 if (!activeOrigins) {
133 ASSERT_NOT_REACHED();
134 cancelReply(WTFMove(completionHandler));
135 return;
136 }
137 completionHandler(WTFMove(*activeOrigins));
138}
139
140void GetActivePagesOriginsForTesting::cancelReply(CompletionHandler<void(Vector<String>&&)>&& completionHandler)
141{
142 completionHandler(IPC::AsyncReplyError<Vector<String>>::create());
143}
144
145void GetActivePagesOriginsForTesting::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, const Vector<String>& activeOrigins)
146{
147 *encoder << activeOrigins;
148 connection.sendSyncReply(WTFMove(encoder));
149}
150
151void IsJITEnabled::callReply(IPC::Decoder& decoder, CompletionHandler<void(bool&&)>&& completionHandler)
152{
153 Optional<bool> enabled;
154 decoder >> enabled;
155 if (!enabled) {
156 ASSERT_NOT_REACHED();
157 cancelReply(WTFMove(completionHandler));
158 return;
159 }
160 completionHandler(WTFMove(*enabled));
161}
162
163void IsJITEnabled::cancelReply(CompletionHandler<void(bool&&)>&& completionHandler)
164{
165 completionHandler(IPC::AsyncReplyError<bool>::create());
166}
167
168void IsJITEnabled::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection, bool enabled)
169{
170 *encoder << enabled;
171 connection.sendSyncReply(WTFMove(encoder));
172}
173
174} // namespace WebProcess
175
176} // namespace Messages
177
178namespace WebKit {
179
180void WebProcess::didReceiveWebProcessMessage(IPC::Connection& connection, IPC::Decoder& decoder)
181{
182 if (decoder.messageName() == Messages::WebProcess::InitializeWebProcess::name()) {
183 IPC::handleMessage<Messages::WebProcess::InitializeWebProcess>(decoder, this, &WebProcess::initializeWebProcess);
184 return;
185 }
186 if (decoder.messageName() == Messages::WebProcess::SetWebsiteDataStoreParameters::name()) {
187 IPC::handleMessage<Messages::WebProcess::SetWebsiteDataStoreParameters>(decoder, this, &WebProcess::setWebsiteDataStoreParameters);
188 return;
189 }
190 if (decoder.messageName() == Messages::WebProcess::CreateWebPage::name()) {
191 IPC::handleMessage<Messages::WebProcess::CreateWebPage>(decoder, this, &WebProcess::createWebPage);
192 return;
193 }
194 if (decoder.messageName() == Messages::WebProcess::PrewarmGlobally::name()) {
195 IPC::handleMessage<Messages::WebProcess::PrewarmGlobally>(decoder, this, &WebProcess::prewarmGlobally);
196 return;
197 }
198 if (decoder.messageName() == Messages::WebProcess::PrewarmWithDomainInformation::name()) {
199 IPC::handleMessage<Messages::WebProcess::PrewarmWithDomainInformation>(decoder, this, &WebProcess::prewarmWithDomainInformation);
200 return;
201 }
202 if (decoder.messageName() == Messages::WebProcess::SetCacheModel::name()) {
203 IPC::handleMessage<Messages::WebProcess::SetCacheModel>(decoder, this, &WebProcess::setCacheModel);
204 return;
205 }
206 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsEmptyDocument::name()) {
207 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsEmptyDocument>(decoder, this, &WebProcess::registerURLSchemeAsEmptyDocument);
208 return;
209 }
210 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsSecure::name()) {
211 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsSecure>(decoder, this, &WebProcess::registerURLSchemeAsSecure);
212 return;
213 }
214 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsBypassingContentSecurityPolicy::name()) {
215 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsBypassingContentSecurityPolicy>(decoder, this, &WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy);
216 return;
217 }
218 if (decoder.messageName() == Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme::name()) {
219 IPC::handleMessage<Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme>(decoder, this, &WebProcess::setDomainRelaxationForbiddenForURLScheme);
220 return;
221 }
222 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsLocal::name()) {
223 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsLocal>(decoder, this, &WebProcess::registerURLSchemeAsLocal);
224 return;
225 }
226 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsNoAccess::name()) {
227 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsNoAccess>(decoder, this, &WebProcess::registerURLSchemeAsNoAccess);
228 return;
229 }
230 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated::name()) {
231 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsDisplayIsolated>(decoder, this, &WebProcess::registerURLSchemeAsDisplayIsolated);
232 return;
233 }
234 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsCORSEnabled::name()) {
235 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsCORSEnabled>(decoder, this, &WebProcess::registerURLSchemeAsCORSEnabled);
236 return;
237 }
238 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsCachePartitioned::name()) {
239 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsCachePartitioned>(decoder, this, &WebProcess::registerURLSchemeAsCachePartitioned);
240 return;
241 }
242 if (decoder.messageName() == Messages::WebProcess::RegisterURLSchemeAsCanDisplayOnlyIfCanRequest::name()) {
243 IPC::handleMessage<Messages::WebProcess::RegisterURLSchemeAsCanDisplayOnlyIfCanRequest>(decoder, this, &WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest);
244 return;
245 }
246 if (decoder.messageName() == Messages::WebProcess::SetDefaultRequestTimeoutInterval::name()) {
247 IPC::handleMessage<Messages::WebProcess::SetDefaultRequestTimeoutInterval>(decoder, this, &WebProcess::setDefaultRequestTimeoutInterval);
248 return;
249 }
250 if (decoder.messageName() == Messages::WebProcess::SetAlwaysUsesComplexTextCodePath::name()) {
251 IPC::handleMessage<Messages::WebProcess::SetAlwaysUsesComplexTextCodePath>(decoder, this, &WebProcess::setAlwaysUsesComplexTextCodePath);
252 return;
253 }
254 if (decoder.messageName() == Messages::WebProcess::SetShouldUseFontSmoothing::name()) {
255 IPC::handleMessage<Messages::WebProcess::SetShouldUseFontSmoothing>(decoder, this, &WebProcess::setShouldUseFontSmoothing);
256 return;
257 }
258 if (decoder.messageName() == Messages::WebProcess::SetResourceLoadStatisticsEnabled::name()) {
259 IPC::handleMessage<Messages::WebProcess::SetResourceLoadStatisticsEnabled>(decoder, this, &WebProcess::setResourceLoadStatisticsEnabled);
260 return;
261 }
262 if (decoder.messageName() == Messages::WebProcess::ClearResourceLoadStatistics::name()) {
263 IPC::handleMessage<Messages::WebProcess::ClearResourceLoadStatistics>(decoder, this, &WebProcess::clearResourceLoadStatistics);
264 return;
265 }
266 if (decoder.messageName() == Messages::WebProcess::UserPreferredLanguagesChanged::name()) {
267 IPC::handleMessage<Messages::WebProcess::UserPreferredLanguagesChanged>(decoder, this, &WebProcess::userPreferredLanguagesChanged);
268 return;
269 }
270 if (decoder.messageName() == Messages::WebProcess::FullKeyboardAccessModeChanged::name()) {
271 IPC::handleMessage<Messages::WebProcess::FullKeyboardAccessModeChanged>(decoder, this, &WebProcess::fullKeyboardAccessModeChanged);
272 return;
273 }
274 if (decoder.messageName() == Messages::WebProcess::DidAddPlugInAutoStartOriginHash::name()) {
275 IPC::handleMessage<Messages::WebProcess::DidAddPlugInAutoStartOriginHash>(decoder, this, &WebProcess::didAddPlugInAutoStartOriginHash);
276 return;
277 }
278 if (decoder.messageName() == Messages::WebProcess::ResetPlugInAutoStartOriginDefaultHashes::name()) {
279 IPC::handleMessage<Messages::WebProcess::ResetPlugInAutoStartOriginDefaultHashes>(decoder, this, &WebProcess::resetPlugInAutoStartOriginDefaultHashes);
280 return;
281 }
282 if (decoder.messageName() == Messages::WebProcess::ResetPlugInAutoStartOriginHashes::name()) {
283 IPC::handleMessage<Messages::WebProcess::ResetPlugInAutoStartOriginHashes>(decoder, this, &WebProcess::resetPlugInAutoStartOriginHashes);
284 return;
285 }
286 if (decoder.messageName() == Messages::WebProcess::SetPluginLoadClientPolicy::name()) {
287 IPC::handleMessage<Messages::WebProcess::SetPluginLoadClientPolicy>(decoder, this, &WebProcess::setPluginLoadClientPolicy);
288 return;
289 }
290 if (decoder.messageName() == Messages::WebProcess::ResetPluginLoadClientPolicies::name()) {
291 IPC::handleMessage<Messages::WebProcess::ResetPluginLoadClientPolicies>(decoder, this, &WebProcess::resetPluginLoadClientPolicies);
292 return;
293 }
294 if (decoder.messageName() == Messages::WebProcess::ClearPluginClientPolicies::name()) {
295 IPC::handleMessage<Messages::WebProcess::ClearPluginClientPolicies>(decoder, this, &WebProcess::clearPluginClientPolicies);
296 return;
297 }
298 if (decoder.messageName() == Messages::WebProcess::RefreshPlugins::name()) {
299 IPC::handleMessage<Messages::WebProcess::RefreshPlugins>(decoder, this, &WebProcess::refreshPlugins);
300 return;
301 }
302 if (decoder.messageName() == Messages::WebProcess::StartMemorySampler::name()) {
303 IPC::handleMessage<Messages::WebProcess::StartMemorySampler>(decoder, this, &WebProcess::startMemorySampler);
304 return;
305 }
306 if (decoder.messageName() == Messages::WebProcess::StopMemorySampler::name()) {
307 IPC::handleMessage<Messages::WebProcess::StopMemorySampler>(decoder, this, &WebProcess::stopMemorySampler);
308 return;
309 }
310 if (decoder.messageName() == Messages::WebProcess::SetTextCheckerState::name()) {
311 IPC::handleMessage<Messages::WebProcess::SetTextCheckerState>(decoder, this, &WebProcess::setTextCheckerState);
312 return;
313 }
314 if (decoder.messageName() == Messages::WebProcess::SetEnhancedAccessibility::name()) {
315 IPC::handleMessage<Messages::WebProcess::SetEnhancedAccessibility>(decoder, this, &WebProcess::setEnhancedAccessibility);
316 return;
317 }
318 if (decoder.messageName() == Messages::WebProcess::GetWebCoreStatistics::name()) {
319 IPC::handleMessage<Messages::WebProcess::GetWebCoreStatistics>(decoder, this, &WebProcess::getWebCoreStatistics);
320 return;
321 }
322 if (decoder.messageName() == Messages::WebProcess::GarbageCollectJavaScriptObjects::name()) {
323 IPC::handleMessage<Messages::WebProcess::GarbageCollectJavaScriptObjects>(decoder, this, &WebProcess::garbageCollectJavaScriptObjects);
324 return;
325 }
326 if (decoder.messageName() == Messages::WebProcess::SetJavaScriptGarbageCollectorTimerEnabled::name()) {
327 IPC::handleMessage<Messages::WebProcess::SetJavaScriptGarbageCollectorTimerEnabled>(decoder, this, &WebProcess::setJavaScriptGarbageCollectorTimerEnabled);
328 return;
329 }
330 if (decoder.messageName() == Messages::WebProcess::SetInjectedBundleParameter::name()) {
331 IPC::handleMessage<Messages::WebProcess::SetInjectedBundleParameter>(decoder, this, &WebProcess::setInjectedBundleParameter);
332 return;
333 }
334 if (decoder.messageName() == Messages::WebProcess::SetInjectedBundleParameters::name()) {
335 IPC::handleMessage<Messages::WebProcess::SetInjectedBundleParameters>(decoder, this, &WebProcess::setInjectedBundleParameters);
336 return;
337 }
338 if (decoder.messageName() == Messages::WebProcess::HandleInjectedBundleMessage::name()) {
339 IPC::handleMessage<Messages::WebProcess::HandleInjectedBundleMessage>(decoder, this, &WebProcess::handleInjectedBundleMessage);
340 return;
341 }
342 if (decoder.messageName() == Messages::WebProcess::ReleasePageCache::name()) {
343 IPC::handleMessage<Messages::WebProcess::ReleasePageCache>(decoder, this, &WebProcess::releasePageCache);
344 return;
345 }
346 if (decoder.messageName() == Messages::WebProcess::FetchWebsiteData::name()) {
347 IPC::handleMessageAsync<Messages::WebProcess::FetchWebsiteData>(connection, decoder, this, &WebProcess::fetchWebsiteData);
348 return;
349 }
350 if (decoder.messageName() == Messages::WebProcess::DeleteWebsiteData::name()) {
351 IPC::handleMessageAsync<Messages::WebProcess::DeleteWebsiteData>(connection, decoder, this, &WebProcess::deleteWebsiteData);
352 return;
353 }
354 if (decoder.messageName() == Messages::WebProcess::DeleteWebsiteDataForOrigins::name()) {
355 IPC::handleMessageAsync<Messages::WebProcess::DeleteWebsiteDataForOrigins>(connection, decoder, this, &WebProcess::deleteWebsiteDataForOrigins);
356 return;
357 }
358 if (decoder.messageName() == Messages::WebProcess::SetHiddenPageDOMTimerThrottlingIncreaseLimit::name()) {
359 IPC::handleMessage<Messages::WebProcess::SetHiddenPageDOMTimerThrottlingIncreaseLimit>(decoder, this, &WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit);
360 return;
361 }
362#if PLATFORM(COCOA)
363 if (decoder.messageName() == Messages::WebProcess::SetQOS::name()) {
364 IPC::handleMessage<Messages::WebProcess::SetQOS>(decoder, this, &WebProcess::setQOS);
365 return;
366 }
367#endif
368 if (decoder.messageName() == Messages::WebProcess::SetMemoryCacheDisabled::name()) {
369 IPC::handleMessage<Messages::WebProcess::SetMemoryCacheDisabled>(decoder, this, &WebProcess::setMemoryCacheDisabled);
370 return;
371 }
372#if ENABLE(SERVICE_CONTROLS)
373 if (decoder.messageName() == Messages::WebProcess::SetEnabledServices::name()) {
374 IPC::handleMessage<Messages::WebProcess::SetEnabledServices>(decoder, this, &WebProcess::setEnabledServices);
375 return;
376 }
377#endif
378 if (decoder.messageName() == Messages::WebProcess::EnsureAutomationSessionProxy::name()) {
379 IPC::handleMessage<Messages::WebProcess::EnsureAutomationSessionProxy>(decoder, this, &WebProcess::ensureAutomationSessionProxy);
380 return;
381 }
382 if (decoder.messageName() == Messages::WebProcess::DestroyAutomationSessionProxy::name()) {
383 IPC::handleMessage<Messages::WebProcess::DestroyAutomationSessionProxy>(decoder, this, &WebProcess::destroyAutomationSessionProxy);
384 return;
385 }
386 if (decoder.messageName() == Messages::WebProcess::ProcessWillSuspendImminently::name()) {
387 IPC::handleMessage<Messages::WebProcess::ProcessWillSuspendImminently>(decoder, this, &WebProcess::processWillSuspendImminently);
388 return;
389 }
390 if (decoder.messageName() == Messages::WebProcess::PrepareToSuspend::name()) {
391 IPC::handleMessage<Messages::WebProcess::PrepareToSuspend>(decoder, this, &WebProcess::prepareToSuspend);
392 return;
393 }
394 if (decoder.messageName() == Messages::WebProcess::CancelPrepareToSuspend::name()) {
395 IPC::handleMessage<Messages::WebProcess::CancelPrepareToSuspend>(decoder, this, &WebProcess::cancelPrepareToSuspend);
396 return;
397 }
398 if (decoder.messageName() == Messages::WebProcess::ProcessDidResume::name()) {
399 IPC::handleMessage<Messages::WebProcess::ProcessDidResume>(decoder, this, &WebProcess::processDidResume);
400 return;
401 }
402 if (decoder.messageName() == Messages::WebProcess::MainThreadPing::name()) {
403 IPC::handleMessage<Messages::WebProcess::MainThreadPing>(decoder, this, &WebProcess::mainThreadPing);
404 return;
405 }
406 if (decoder.messageName() == Messages::WebProcess::BackgroundResponsivenessPing::name()) {
407 IPC::handleMessage<Messages::WebProcess::BackgroundResponsivenessPing>(decoder, this, &WebProcess::backgroundResponsivenessPing);
408 return;
409 }
410#if ENABLE(GAMEPAD)
411 if (decoder.messageName() == Messages::WebProcess::SetInitialGamepads::name()) {
412 IPC::handleMessage<Messages::WebProcess::SetInitialGamepads>(decoder, this, &WebProcess::setInitialGamepads);
413 return;
414 }
415#endif
416#if ENABLE(GAMEPAD)
417 if (decoder.messageName() == Messages::WebProcess::GamepadConnected::name()) {
418 IPC::handleMessage<Messages::WebProcess::GamepadConnected>(decoder, this, &WebProcess::gamepadConnected);
419 return;
420 }
421#endif
422#if ENABLE(GAMEPAD)
423 if (decoder.messageName() == Messages::WebProcess::GamepadDisconnected::name()) {
424 IPC::handleMessage<Messages::WebProcess::GamepadDisconnected>(decoder, this, &WebProcess::gamepadDisconnected);
425 return;
426 }
427#endif
428#if ENABLE(SERVICE_WORKER)
429 if (decoder.messageName() == Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess::name()) {
430 IPC::handleMessage<Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess>(decoder, this, &WebProcess::establishWorkerContextConnectionToNetworkProcess);
431 return;
432 }
433#endif
434#if ENABLE(SERVICE_WORKER)
435 if (decoder.messageName() == Messages::WebProcess::RegisterServiceWorkerClients::name()) {
436 IPC::handleMessage<Messages::WebProcess::RegisterServiceWorkerClients>(decoder, this, &WebProcess::registerServiceWorkerClients);
437 return;
438 }
439#endif
440 if (decoder.messageName() == Messages::WebProcess::DidTakeAllMessagesForPort::name()) {
441 IPC::handleMessage<Messages::WebProcess::DidTakeAllMessagesForPort>(decoder, this, &WebProcess::didTakeAllMessagesForPort);
442 return;
443 }
444 if (decoder.messageName() == Messages::WebProcess::DidCheckRemotePortForActivity::name()) {
445 IPC::handleMessage<Messages::WebProcess::DidCheckRemotePortForActivity>(decoder, this, &WebProcess::didCheckRemotePortForActivity);
446 return;
447 }
448 if (decoder.messageName() == Messages::WebProcess::CheckProcessLocalPortForActivity::name()) {
449 IPC::handleMessage<Messages::WebProcess::CheckProcessLocalPortForActivity>(decoder, this, &WebProcess::checkProcessLocalPortForActivity);
450 return;
451 }
452 if (decoder.messageName() == Messages::WebProcess::MessagesAvailableForPort::name()) {
453 IPC::handleMessage<Messages::WebProcess::MessagesAvailableForPort>(decoder, this, &WebProcess::messagesAvailableForPort);
454 return;
455 }
456 if (decoder.messageName() == Messages::WebProcess::SetHasSuspendedPageProxy::name()) {
457 IPC::handleMessage<Messages::WebProcess::SetHasSuspendedPageProxy>(decoder, this, &WebProcess::setHasSuspendedPageProxy);
458 return;
459 }
460 if (decoder.messageName() == Messages::WebProcess::SetIsInProcessCache::name()) {
461 IPC::handleMessage<Messages::WebProcess::SetIsInProcessCache>(decoder, this, &WebProcess::setIsInProcessCache);
462 return;
463 }
464 if (decoder.messageName() == Messages::WebProcess::MarkIsNoLongerPrewarmed::name()) {
465 IPC::handleMessage<Messages::WebProcess::MarkIsNoLongerPrewarmed>(decoder, this, &WebProcess::markIsNoLongerPrewarmed);
466 return;
467 }
468 if (decoder.messageName() == Messages::WebProcess::UpdateActivePages::name()) {
469 IPC::handleMessage<Messages::WebProcess::UpdateActivePages>(decoder, this, &WebProcess::updateActivePages);
470 return;
471 }
472 if (decoder.messageName() == Messages::WebProcess::GetActivePagesOriginsForTesting::name()) {
473 IPC::handleMessageAsync<Messages::WebProcess::GetActivePagesOriginsForTesting>(connection, decoder, this, &WebProcess::getActivePagesOriginsForTesting);
474 return;
475 }
476#if PLATFORM(MAC)
477 if (decoder.messageName() == Messages::WebProcess::SetScreenProperties::name()) {
478 IPC::handleMessage<Messages::WebProcess::SetScreenProperties>(decoder, this, &WebProcess::setScreenProperties);
479 return;
480 }
481#endif
482#if (PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING))
483 if (decoder.messageName() == Messages::WebProcess::ScrollerStylePreferenceChanged::name()) {
484 IPC::handleMessage<Messages::WebProcess::ScrollerStylePreferenceChanged>(decoder, this, &WebProcess::scrollerStylePreferenceChanged);
485 return;
486 }
487#endif
488#if (PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING))
489 if (decoder.messageName() == Messages::WebProcess::DisplayConfigurationChanged::name()) {
490 IPC::handleMessage<Messages::WebProcess::DisplayConfigurationChanged>(decoder, this, &WebProcess::displayConfigurationChanged);
491 return;
492 }
493#endif
494#if (PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING))
495 if (decoder.messageName() == Messages::WebProcess::DisplayWasRefreshed::name()) {
496 IPC::handleMessage<Messages::WebProcess::DisplayWasRefreshed>(decoder, this, &WebProcess::displayWasRefreshed);
497 return;
498 }
499#endif
500#if PLATFORM(IOS)
501 if (decoder.messageName() == Messages::WebProcess::BacklightLevelDidChange::name()) {
502 IPC::handleMessage<Messages::WebProcess::BacklightLevelDidChange>(decoder, this, &WebProcess::backlightLevelDidChange);
503 return;
504 }
505#endif
506 if (decoder.messageName() == Messages::WebProcess::IsJITEnabled::name()) {
507 IPC::handleMessageAsync<Messages::WebProcess::IsJITEnabled>(connection, decoder, this, &WebProcess::isJITEnabled);
508 return;
509 }
510#if PLATFORM(COCOA)
511 if (decoder.messageName() == Messages::WebProcess::SetMediaMIMETypes::name()) {
512 IPC::handleMessage<Messages::WebProcess::SetMediaMIMETypes>(decoder, this, &WebProcess::setMediaMIMETypes);
513 return;
514 }
515#endif
516#if ENABLE(MEDIA_STREAM)
517 if (decoder.messageName() == Messages::WebProcess::AddMockMediaDevice::name()) {
518 IPC::handleMessage<Messages::WebProcess::AddMockMediaDevice>(decoder, this, &WebProcess::addMockMediaDevice);
519 return;
520 }
521#endif
522#if ENABLE(MEDIA_STREAM)
523 if (decoder.messageName() == Messages::WebProcess::ClearMockMediaDevices::name()) {
524 IPC::handleMessage<Messages::WebProcess::ClearMockMediaDevices>(decoder, this, &WebProcess::clearMockMediaDevices);
525 return;
526 }
527#endif
528#if ENABLE(MEDIA_STREAM)
529 if (decoder.messageName() == Messages::WebProcess::RemoveMockMediaDevice::name()) {
530 IPC::handleMessage<Messages::WebProcess::RemoveMockMediaDevice>(decoder, this, &WebProcess::removeMockMediaDevice);
531 return;
532 }
533#endif
534#if ENABLE(MEDIA_STREAM)
535 if (decoder.messageName() == Messages::WebProcess::ResetMockMediaDevices::name()) {
536 IPC::handleMessage<Messages::WebProcess::ResetMockMediaDevices>(decoder, this, &WebProcess::resetMockMediaDevices);
537 return;
538 }
539#endif
540#if (ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS))
541 if (decoder.messageName() == Messages::WebProcess::GrantUserMediaDeviceSandboxExtensions::name()) {
542 IPC::handleMessage<Messages::WebProcess::GrantUserMediaDeviceSandboxExtensions>(decoder, this, &WebProcess::grantUserMediaDeviceSandboxExtensions);
543 return;
544 }
545#endif
546#if (ENABLE(MEDIA_STREAM) && ENABLE(SANDBOX_EXTENSIONS))
547 if (decoder.messageName() == Messages::WebProcess::RevokeUserMediaDeviceSandboxExtensions::name()) {
548 IPC::handleMessage<Messages::WebProcess::RevokeUserMediaDeviceSandboxExtensions>(decoder, this, &WebProcess::revokeUserMediaDeviceSandboxExtensions);
549 return;
550 }
551#endif
552 if (decoder.messageName() == Messages::WebProcess::ClearCurrentModifierStateForTesting::name()) {
553 IPC::handleMessage<Messages::WebProcess::ClearCurrentModifierStateForTesting>(decoder, this, &WebProcess::clearCurrentModifierStateForTesting);
554 return;
555 }
556#if PLATFORM(IOS_FAMILY)
557 if (decoder.messageName() == Messages::WebProcess::UnblockAccessibilityServer::name()) {
558 IPC::handleMessage<Messages::WebProcess::UnblockAccessibilityServer>(decoder, this, &WebProcess::unblockAccessibilityServer);
559 return;
560 }
561#endif
562 UNUSED_PARAM(connection);
563 UNUSED_PARAM(decoder);
564 ASSERT_NOT_REACHED();
565}
566
567} // namespace WebKit
568
569