| 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'' |
| 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 | #pragma once |
| 27 | |
| 28 | #include "CacheModel.h" |
| 29 | #include "SandboxExtension.h" |
| 30 | #include "TextCheckerState.h" |
| 31 | #include "UserData.h" |
| 32 | #include <pal/SessionID.h> |
| 33 | #include <wtf/HashMap.h> |
| 34 | #include <wtf/ProcessID.h> |
| 35 | #include <wtf/RetainPtr.h> |
| 36 | #include <wtf/Vector.h> |
| 37 | #include <wtf/text/StringHash.h> |
| 38 | #include <wtf/text/WTFString.h> |
| 39 | |
| 40 | #if PLATFORM(COCOA) |
| 41 | #include <wtf/MachSendRight.h> |
| 42 | #endif |
| 43 | |
| 44 | #if PLATFORM(MAC) |
| 45 | #include <WebCore/PlatformScreen.h> |
| 46 | #include <WebCore/ScreenProperties.h> |
| 47 | #endif |
| 48 | |
| 49 | #if USE(SOUP) |
| 50 | #include "HTTPCookieAcceptPolicy.h" |
| 51 | #include <WebCore/SoupNetworkProxySettings.h> |
| 52 | #endif |
| 53 | |
| 54 | namespace API { |
| 55 | class Data; |
| 56 | } |
| 57 | |
| 58 | namespace IPC { |
| 59 | class Decoder; |
| 60 | class Encoder; |
| 61 | } |
| 62 | |
| 63 | namespace WebKit { |
| 64 | |
| 65 | struct WebProcessCreationParameters { |
| 66 | WebProcessCreationParameters(); |
| 67 | ~WebProcessCreationParameters(); |
| 68 | WebProcessCreationParameters(WebProcessCreationParameters&&); |
| 69 | WebProcessCreationParameters& operator=(WebProcessCreationParameters&&); |
| 70 | |
| 71 | void encode(IPC::Encoder&) const; |
| 72 | static bool decode(IPC::Decoder&, WebProcessCreationParameters&); |
| 73 | |
| 74 | String injectedBundlePath; |
| 75 | SandboxExtension::Handle injectedBundlePathExtensionHandle; |
| 76 | SandboxExtension::HandleArray additionalSandboxExtensionHandles; |
| 77 | |
| 78 | UserData initializationUserData; |
| 79 | |
| 80 | #if PLATFORM(IOS_FAMILY) |
| 81 | SandboxExtension::Handle cookieStorageDirectoryExtensionHandle; |
| 82 | SandboxExtension::Handle containerCachesDirectoryExtensionHandle; |
| 83 | SandboxExtension::Handle containerTemporaryDirectoryExtensionHandle; |
| 84 | #endif |
| 85 | #if ENABLE(MEDIA_STREAM) |
| 86 | SandboxExtension::Handle audioCaptureExtensionHandle; |
| 87 | bool shouldCaptureAudioInUIProcess { false }; |
| 88 | bool shouldCaptureVideoInUIProcess { false }; |
| 89 | bool shouldCaptureDisplayInUIProcess { false }; |
| 90 | #endif |
| 91 | |
| 92 | String webCoreLoggingChannels; |
| 93 | String webKitLoggingChannels; |
| 94 | |
| 95 | Vector<String> urlSchemesRegisteredAsEmptyDocument; |
| 96 | Vector<String> urlSchemesRegisteredAsSecure; |
| 97 | Vector<String> urlSchemesRegisteredAsBypassingContentSecurityPolicy; |
| 98 | Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden; |
| 99 | Vector<String> urlSchemesRegisteredAsLocal; |
| 100 | Vector<String> urlSchemesRegisteredAsNoAccess; |
| 101 | Vector<String> urlSchemesRegisteredAsDisplayIsolated; |
| 102 | Vector<String> urlSchemesRegisteredAsCORSEnabled; |
| 103 | Vector<String> urlSchemesRegisteredAsAlwaysRevalidated; |
| 104 | Vector<String> urlSchemesRegisteredAsCachePartitioned; |
| 105 | Vector<String> urlSchemesServiceWorkersCanHandle; |
| 106 | Vector<String> urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest; |
| 107 | |
| 108 | Vector<String> fontWhitelist; |
| 109 | Vector<String> languages; |
| 110 | #if USE(GSTREAMER) |
| 111 | Vector<String> gstreamerOptions; |
| 112 | #endif |
| 113 | |
| 114 | CacheModel cacheModel; |
| 115 | |
| 116 | double defaultRequestTimeoutInterval { INT_MAX }; |
| 117 | |
| 118 | bool shouldAlwaysUseComplexTextCodePath { false }; |
| 119 | bool shouldEnableMemoryPressureReliefLogging { false }; |
| 120 | bool shouldSuppressMemoryPressureHandler { false }; |
| 121 | bool shouldUseFontSmoothing { true }; |
| 122 | bool fullKeyboardAccessEnabled { false }; |
| 123 | bool memoryCacheDisabled { false }; |
| 124 | bool attrStyleEnabled { false }; |
| 125 | |
| 126 | #if ENABLE(SERVICE_CONTROLS) |
| 127 | bool hasImageServices { false }; |
| 128 | bool hasSelectionServices { false }; |
| 129 | bool hasRichContentServices { false }; |
| 130 | #endif |
| 131 | |
| 132 | Seconds terminationTimeout; |
| 133 | |
| 134 | TextCheckerState textCheckerState; |
| 135 | |
| 136 | #if PLATFORM(COCOA) |
| 137 | String uiProcessBundleIdentifier; |
| 138 | uint32_t uiProcessSDKVersion { 0 }; |
| 139 | #endif |
| 140 | |
| 141 | ProcessID presentingApplicationPID { 0 }; |
| 142 | |
| 143 | #if PLATFORM(COCOA) |
| 144 | WTF::MachSendRight acceleratedCompositingPort; |
| 145 | |
| 146 | String uiProcessBundleResourcePath; |
| 147 | SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle; |
| 148 | |
| 149 | bool shouldEnableJIT { false }; |
| 150 | bool shouldEnableFTLJIT { false }; |
| 151 | bool accessibilityEnhancedUserInterfaceEnabled { false }; |
| 152 | |
| 153 | RefPtr<API::Data> bundleParameterData; |
| 154 | #endif // PLATFORM(COCOA) |
| 155 | |
| 156 | #if ENABLE(NOTIFICATIONS) |
| 157 | HashMap<String, bool> notificationPermissions; |
| 158 | #endif |
| 159 | |
| 160 | HashMap<PAL::SessionID, HashMap<unsigned, WallTime>> plugInAutoStartOriginHashes; |
| 161 | Vector<String> plugInAutoStartOrigins; |
| 162 | |
| 163 | #if ENABLE(NETSCAPE_PLUGIN_API) |
| 164 | HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies; |
| 165 | #endif |
| 166 | |
| 167 | #if PLATFORM(COCOA) |
| 168 | RetainPtr<CFDataRef> networkATSContext; |
| 169 | #endif |
| 170 | |
| 171 | #if PLATFORM(WAYLAND) |
| 172 | String waylandCompositorDisplayName; |
| 173 | #endif |
| 174 | |
| 175 | #if USE(SOUP) |
| 176 | WebCore::SoupNetworkProxySettings proxySettings; |
| 177 | #endif |
| 178 | |
| 179 | #if PLATFORM(COCOA) |
| 180 | Vector<String> mediaMIMETypes; |
| 181 | #endif |
| 182 | |
| 183 | #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED |
| 184 | bool shouldLogUserInteraction { false }; |
| 185 | #endif |
| 186 | |
| 187 | #if PLATFORM(MAC) |
| 188 | WebCore::ScreenProperties screenProperties; |
| 189 | bool useOverlayScrollbars { true }; |
| 190 | #endif |
| 191 | |
| 192 | #if PLATFORM(WPE) |
| 193 | bool isServiceWorkerProcess { false }; |
| 194 | IPC::Attachment hostClientFileDescriptor; |
| 195 | CString implementationLibraryName; |
| 196 | #endif |
| 197 | }; |
| 198 | |
| 199 | } // namespace WebKit |
| 200 | |